Source release 19.3.0

This commit is contained in:
John W. Bruce
2024-09-05 07:02:36 +00:00
parent cd8256726f
commit 11c108a8da
122 changed files with 2259 additions and 1082 deletions

View File

@@ -6,6 +6,8 @@
#include <inttypes.h>
#include "wv_class_utils.h"
namespace wvcdm {
// OTA Keybox Provisioning (OKP)
namespace okp {
@@ -23,38 +25,43 @@ const char* SystemStateToString(SystemState state);
// Container for all the device information related to OKP.
class SystemFallbackInfo {
public:
SystemState state() const { return state_; }
void SetState(SystemState state) { state_ = state; }
constexpr SystemFallbackInfo() = default;
WVCDM_CONSTEXPR_DEFAULT_COPY_AND_MOVE(SystemFallbackInfo);
bool HasFirstCheckedTime() const { return first_checked_time_ != 0; }
int64_t first_checked_time() const { return first_checked_time_; }
void SetFirstCheckedTime(int64_t time) {
constexpr SystemState state() const { return state_; }
constexpr void SetState(SystemState state) { state_ = state; }
constexpr bool HasFirstCheckedTime() const {
return first_checked_time_ != 0;
}
constexpr int64_t first_checked_time() const { return first_checked_time_; }
constexpr void SetFirstCheckedTime(int64_t time) {
first_checked_time_ = (time > 0 ? time : 0);
}
bool HasBackoffStartTime() const { return backoff_start_time_ > 0; }
int64_t backoff_start_time() const { return backoff_start_time_; }
void SetBackoffStartTime(int64_t time) {
constexpr bool HasBackoffStartTime() const { return backoff_start_time_ > 0; }
constexpr int64_t backoff_start_time() const { return backoff_start_time_; }
constexpr void SetBackoffStartTime(int64_t time) {
backoff_start_time_ = (time > 0 ? time : 0);
}
void ClearBackoffStartTime() { backoff_start_time_ = 0; }
constexpr void ClearBackoffStartTime() { backoff_start_time_ = 0; }
bool HasBackoffDuration() const { return backoff_duration_ > 0; }
int64_t backoff_duration() const { return backoff_duration_; }
void SetBackoffDuration(int64_t duration) {
constexpr bool HasBackoffDuration() const { return backoff_duration_ > 0; }
constexpr int64_t backoff_duration() const { return backoff_duration_; }
constexpr void SetBackoffDuration(int64_t duration) {
backoff_duration_ = (duration > 0 ? duration : 0);
}
void DoubleBackoffDuration() { backoff_duration_ *= 2; }
void ClearBackoffDuration() { backoff_duration_ = 0; }
constexpr void DoubleBackoffDuration() { backoff_duration_ *= 2; }
constexpr void ClearBackoffDuration() { backoff_duration_ = 0; }
bool HasProvisioningTime() const { return provisioning_time_ != 0; }
int64_t provisioning_time() const { return provisioning_time_; }
void SetProvisioningTime(int64_t time) {
constexpr bool HasProvisioningTime() const { return provisioning_time_ != 0; }
constexpr int64_t provisioning_time() const { return provisioning_time_; }
constexpr void SetProvisioningTime(int64_t time) {
provisioning_time_ = (time > 0 ? time : 0);
}
void ClearProvisioningTime() { provisioning_time_ = 0; }
constexpr void ClearProvisioningTime() { provisioning_time_ = 0; }
void Clear() {
constexpr void Clear() {
state_ = SystemState::kUnknown;
first_checked_time_ = 0;
backoff_start_time_ = 0;
@@ -62,10 +69,8 @@ class SystemFallbackInfo {
provisioning_time_ = 0;
}
bool operator==(const SystemFallbackInfo& other) const;
bool operator!=(const SystemFallbackInfo& other) const {
return !(*this == other);
}
bool IsEqualTo(const SystemFallbackInfo& other) const;
WVCDM_DEFINE_EQ_OPERATORS(SystemFallbackInfo);
private:
SystemState state_ = SystemState::kUnknown;