nl::Weave::Profiles::Time::TimeSyncResponse

Summary

Constructors and Destructors

TimeSyncResponse(void)
default constructor shall be used with Decode, as all members will be initialized through decoding

Public types

@271 enum
maximum number of contributors in the last successful time sync operation on local fabric
@272 enum
time, in number of minutes, since last successful time sync with some proxy of atomic time.

Public attributes

mIsTimeCoordinator
bool
true if this response is constructed by a coordinator; false implies this response is constructed by a server.
mNumContributorInLastLocalSync
uint8_t
number of local contributors (coordinators or servers) used in last successful time sync
mTimeOfRequest
timesync_t
system time (number of microseconds since 1970/1/1 0:00:00) when the request arrived
mTimeOfResponse
timesync_t
system time (number of microseconds since 1970/1/1 0:00:00) when the response was prepared
mTimeSinceLastSyncWithServer_min
uint16_t
time, in number of minutes, since last successful time sync with some proxy of atomic time

Public functions

Encode(PacketBuffer *const aMsg)
encode time sync response into an PacketBuffer.
Init(const TimeSyncRole aRole, const timesync_t aTimeOfRequest, const timesync_t aTimeOfResponse, const uint8_t aNumContributorInLastLocalSync, const uint16_t aTimeSinceLastSyncWithServer_min)
void
initialize this object for encoding.

Public static functions

Decode(TimeSyncResponse *const aObject, PacketBuffer *const aMsg)
decode time sync response from an PacketBuffer.

Public types

@271

 @271

maximum number of contributors in the last successful time sync operation on local fabric

@272

 @272

time, in number of minutes, since last successful time sync with some proxy of atomic time.

kTimeSinceLastSyncWithServer_Invalid means this happened too long ago to be relevant, if ever

Public attributes

mIsTimeCoordinator

bool mIsTimeCoordinator

true if this response is constructed by a coordinator; false implies this response is constructed by a server.

mNumContributorInLastLocalSync

uint8_t mNumContributorInLastLocalSync

number of local contributors (coordinators or servers) used in last successful time sync

mTimeOfRequest

timesync_t mTimeOfRequest

system time (number of microseconds since 1970/1/1 0:00:00) when the request arrived

mTimeOfResponse

timesync_t mTimeOfResponse

system time (number of microseconds since 1970/1/1 0:00:00) when the response was prepared

mTimeSinceLastSyncWithServer_min

uint16_t mTimeSinceLastSyncWithServer_min

time, in number of minutes, since last successful time sync with some proxy of atomic time

Public functions

Encode

WEAVE_ERROR Encode(
  PacketBuffer *const aMsg
)

encode time sync response into an PacketBuffer.

Details
Parameters
[out] aMsg
A pointer to the PacketBuffer
Returns
WEAVE_NO_ERROR on success

Init

void Init(
  const TimeSyncRole aRole,
  const timesync_t aTimeOfRequest,
  const timesync_t aTimeOfResponse,
  const uint8_t aNumContributorInLastLocalSync,
  const uint16_t aTimeSinceLastSyncWithServer_min
)

initialize this object for encoding.

Details
Parameters
[in] aRole
the role this responder is playing. can be either kTimeSyncRole_Server or kTimeSyncRole_Coordinator
[in] aTimeOfRequest
the system time when the original request was received
[in] aTimeOfResponse
the system time when this response is being sent out
[in] aNumContributorInLastLocalSync
number of nodes contributed in the last local time sync
[in] aTimeSinceLastSyncWithServer_min
number of minutes passed since last sync with a Server

TimeSyncResponse

 TimeSyncResponse(
  void
)

default constructor shall be used with Decode, as all members will be initialized through decoding

Public static functions

Decode

WEAVE_ERROR Decode(
  TimeSyncResponse *const aObject,
  PacketBuffer *const aMsg
)

decode time sync response from an PacketBuffer.

Details
Parameters
[out] aObject
A pointer to the decoded object
[in] aMsg
A pointer to the PacketBuffer
Returns
WEAVE_NO_ERROR on success