nl::Weave::Profiles::DataManagement_Current::SubscriptionClient

Summary

Public types

@118 enum
EventCallback)(void *const aAppState, EventID aEvent, const InEventParam &aInParam, OutEventParam &aOutParam) typedef
void(*
Callback to pass subscription events to application.
EventID enum
ResubscribePolicyCallback)(void *const aAppState, ResubscribeParam &aInParam, uint32_t &aOutIntervalMsec) typedef
void(*
Callback to fetch the interval of time to wait before the next resubscribe.

Public static functions

DefaultEventHandler(EventID aEvent, const InEventParam & aInParam, OutEventParam & aOutParam)
void
DefaultResubscribePolicyCallback(void *const aAppState, ResubscribeParam & aInParam, uint32_t & aOutIntervalMsec)
void
The default policy implementation will pick a random timeslot with millisecond resolution over an ever increasing window, following a fibonacci sequence upto WDM_RESUBSCRIBE_MAX_FIBONACCI_STEP_INDEX.

Public functions

AbortSubscription(void)
void
DisableResubscribe(void)
void
Disable the resubscribe mechanism.
DiscardUpdates()
void
Tells the SubscriptionClient to empty the set of TraitPaths pending to be updated and abort the update request that is in progress, if any.
EnableResubscribe(ResubscribePolicyCallback aCallback)
void
Enable automatic resubscribes.
EndSubscription(void)
FlushUpdate()
Signals that the application has finished mutating all TraitUpdatableDataSinks.
FlushUpdate(bool aForce)
Free(void)
void
GetBinding(void) const
GetLivenessTimeoutMsec(void) const
uint32_t
GetPeerNodeId(void) const
uint64_t
GetSubscriptionId(uint64_t *const apSubscriptionId)
IndicateActivity(void)
void
InitiateCounterSubscription(const uint32_t aLivenessTimeoutSec)
void
InitiateSubscription(void)
void
Configure the SubscriptionClient as an initiator (as opposed to a counter-subscriber) and bring the subscription up if it is not.
IsAborting()
bool
IsEstablished()
bool
IsEstablishedIdle()
bool
IsFree()
bool
IsInProgressOrEstablished()
bool
IsInResubscribeHoldoff()
bool
IsRetryEnabled()
bool
IsUpdatePendingOrInProgress()
bool
LockUpdateMutex(void)
void
ResetResubscribe(void)
void
Kick the resubscribe mechanism.
SetLivenessTimeoutMsec(uint32_t val)
void
SetUpdated(TraitUpdatableDataSink *aDataSink, PropertyPathHandle aPropertyHandle, bool aIsConditional)
SuspendUpdateRetries()
void
Tells the SubscriptionClient to stop retrying update requests.
UnlockUpdateMutex(void)
void

Structs

nl::Weave::Profiles::DataManagement_Current::SubscriptionClient::LastObservedEvent
nl::Weave::Profiles::DataManagement_Current::SubscriptionClient::ResubscribeParam

Unions

nl::Weave::Profiles::DataManagement_Current::SubscriptionClient::InEventParam
nl::Weave::Profiles::DataManagement_Current::SubscriptionClient::OutEventParam

Public types

@118

 @118

EventCallback

void(* EventCallback)(void *const aAppState, EventID aEvent, const InEventParam &aInParam, OutEventParam &aOutParam)

Callback to pass subscription events to application.

Details
Parameters
[in] aAppState
App state pointer set during initialization of the SubscriptionClient.
[in] aEvent
Indicates which event is happening
[in] aInParam
Struct with additional details about the event
[out] aOutParam
Information passed back by the application

EventID

 EventID

ResubscribePolicyCallback

void(* ResubscribePolicyCallback)(void *const aAppState, ResubscribeParam &aInParam, uint32_t &aOutIntervalMsec)

Callback to fetch the interval of time to wait before the next resubscribe.

Applications are allowed to abort/free in this function if they've decided to give up on resubscribing.

Details
Parameters
[in] aAppState
App state pointer set during initialization of the SubscriptionClient.
[in] aInParam
Struct with additional details about the retry
[out] aOutIntervalMsec
Time in milliseconds to wait before next retry

Public static functions

DefaultEventHandler

void DefaultEventHandler(
  EventID aEvent,
  const InEventParam & aInParam,
  OutEventParam & aOutParam
)

DefaultResubscribePolicyCallback

void DefaultResubscribePolicyCallback(
  void *const aAppState,
  ResubscribeParam & aInParam,
  uint32_t & aOutIntervalMsec
)

The default policy implementation will pick a random timeslot with millisecond resolution over an ever increasing window, following a fibonacci sequence upto WDM_RESUBSCRIBE_MAX_FIBONACCI_STEP_INDEX.

Average of the randomized wait time past the WDM_RESUBSCRIBE_MAX_FIBONACCI_STEP_INDEX will be around one hour. When the retry count resets to 0, the sequence starts from the beginning again.

Public functions

AbortSubscription

void AbortSubscription(
  void
)

DisableResubscribe

void DisableResubscribe(
  void
)

Disable the resubscribe mechanism.

This will abort if a resubscribe was pending.

DiscardUpdates

void DiscardUpdates()

Tells the SubscriptionClient to empty the set of TraitPaths pending to be updated and abort the update request that is in progress, if any.

This method can be invoked from any callback.

EnableResubscribe

void EnableResubscribe(
  ResubscribePolicyCallback aCallback
)

Enable automatic resubscribes.

Attach a callback to specify the next retry time on failure.

Details
Parameters
[in] aCallback
Optional callback to fetch the amount of time to wait before retrying after a failure. If NULL use a default policy.

EndSubscription

WEAVE_ERROR EndSubscription(
  void
)

FlushUpdate

WEAVE_ERROR FlushUpdate()

Signals that the application has finished mutating all TraitUpdatableDataSinks.

Unless a previous update exchange is in progress, the client will take all data marked as updated and send it to the responder in one update request. This method can be called from any thread.

Details
Parameters
[in] aForce
If true, causes the update to be sent immediately even if a retry has been scheduled in the future. This parameter is considered false by default.
Returns
WEAVE_NO_ERROR in case of success; other WEAVE_ERROR codes in case of failure.

FlushUpdate

WEAVE_ERROR FlushUpdate(
  bool aForce
)

Free

void Free(
  void
)

GetBinding

Binding * GetBinding(
  void
) const 

GetLivenessTimeoutMsec

uint32_t GetLivenessTimeoutMsec(
  void
) const 

GetPeerNodeId

uint64_t GetPeerNodeId(
  void
) const 

GetSubscriptionId

WEAVE_ERROR GetSubscriptionId(
  uint64_t *const apSubscriptionId
)

IndicateActivity

void IndicateActivity(
  void
)

InitiateCounterSubscription

void InitiateCounterSubscription(
  const uint32_t aLivenessTimeoutSec
)

InitiateSubscription

void InitiateSubscription(
  void
)

Configure the SubscriptionClient as an initiator (as opposed to a counter-subscriber) and bring the subscription up if it is not.

IsAborting

bool IsAborting()

IsEstablished

bool IsEstablished()

IsEstablishedIdle

bool IsEstablishedIdle()

IsFree

bool IsFree()

IsInProgressOrEstablished

bool IsInProgressOrEstablished()

IsInResubscribeHoldoff

bool IsInResubscribeHoldoff()

IsRetryEnabled

bool IsRetryEnabled()

IsUpdatePendingOrInProgress

bool IsUpdatePendingOrInProgress()

LockUpdateMutex

void LockUpdateMutex(
  void
)

ResetResubscribe

void ResetResubscribe(
  void
)

Kick the resubscribe mechanism.

This will initiate an immediate retry

SetLivenessTimeoutMsec

void SetLivenessTimeoutMsec(
  uint32_t val
)

SetUpdated

WEAVE_ERROR SetUpdated(
  TraitUpdatableDataSink *aDataSink,
  PropertyPathHandle aPropertyHandle,
  bool aIsConditional
)

SuspendUpdateRetries

void SuspendUpdateRetries()

Tells the SubscriptionClient to stop retrying update requests.

Allows the application to suspend updates for a period of time without discarding all metadata. Updates and retries will be resumed when FlushUpdate is called. When called to suspend updates while an update is in-flight, the update is not canceled but in case it fails it will not be retried until FlushUpdate is called again.

UnlockUpdateMutex

void UnlockUpdateMutex(
  void
)