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

Summary

Public types

@106 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.
EnableResubscribe(ResubscribePolicyCallback aCallback)
void
Enable automatic resubscribes.
EndSubscription(void)
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
IsAborted()
bool
IsAborting()
bool
IsEstablishedIdle()
bool
IsFree()
bool
IsInProgressOrEstablished()
bool
IsRetryEnabled()
bool
ResetResubscribe(void)
void
Kick the resubscribe mechanism.
SetLivenessTimeoutMsec(uint32_t val)
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

@106

 @106

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.

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
)

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
)

IsAborted

bool IsAborted()

IsAborting

bool IsAborting()

IsEstablishedIdle

bool IsEstablishedIdle()

IsFree

bool IsFree()

IsInProgressOrEstablished

bool IsInProgressOrEstablished()

IsRetryEnabled

bool IsRetryEnabled()

ResetResubscribe

void ResetResubscribe(
  void
)

Kick the resubscribe mechanism.

This will initiate an immediate retry

SetLivenessTimeoutMsec

void SetLivenessTimeoutMsec(
  uint32_t val
)