class SubscriptionClient

Defined at line 63 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionClient.h

Public Methods

void DefaultEventHandler (EventID aEvent, const InEventParam & aInParam, OutEventParam & aOutParam)
void DefaultResubscribePolicyCallback (void *const aAppState, ResubscribeParam & aInParam, uint32_t & aOutIntervalMsec)
void InitiateSubscription ()
void InitiateCounterSubscription (const uint32_t aLivenessTimeoutSec)
Binding * GetBinding ()
uint64_t GetPeerNodeId ()
WEAVE_ERROR EndSubscription ()

End the subscription.

When #WDM_ENABLE_SUBSCRIPTION_CANCEL compile-time option is enabled,

gracefully end the subscription by sending a CancelRequest to the peer.

The resources associated with the subscription are freed on response

from the peer or on timeout. When the option is disabled, the call is

equivalent to AbortSubscription().

void AbortSubscription ()

Abort the subscription.

Immediately stop accepting all traffic associated with the subscription,

and release all underlying communication resources. The

SubscriptionClient object itself remains valid and may be used again.

void Free ()

Free this SubscriptionClient object.

Calls AbortSubscription() if necessary and releases the refcount on this

SubscriptionClient object. Under correct usage, this should enable the

object to be returned to the object pool

WEAVE_ERROR GetSubscriptionId (uint64_t *const apSubscriptionId)
void EnableResubscribe (ResubscribePolicyCallback aCallback)
void DisableResubscribe ()
uint32_t GetLivenessTimeoutMsec ()

Defined at line 363 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionClient.h

void ResetResubscribe ()
void IndicateActivity ()
void SetLivenessTimeoutMsec (uint32_t val)

Defined at line 364 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionClient.h

bool IsInProgressOrEstablished ()

Defined at line 370 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionClient.h

bool IsRetryEnabled ()

Defined at line 375 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionClient.h

bool IsEstablished ()

Defined at line 377 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionClient.h

bool IsEstablishedIdle ()

Defined at line 378 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionClient.h

bool IsFree ()

Defined at line 379 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionClient.h

bool IsCanceling ()

Defined at line 380 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionClient.h

bool IsTerminated ()

Defined at line 381 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionClient.h

bool IsInResubscribeHoldoff ()

Defined at line 382 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionClient.h

Enumerations

enum (unnamed)
Name Value Comments
kNoTimeOut 0 --
kMaxTimeoutSec 3600000

Note the WDM spec says 0x7FFFFFFF, but Weave implementation can only hold timeout of much shorter
32-bit in milliseconds, which is about 1200 hours

Defined at line 66 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionClient.h

enum EventID
Name Value Comments
kEvent_OnSubscriptionTerminated 1

Marks the end of this subscription. The parameters sent to the
::nl::Weave::Profiles::DataManagement_Current::SubscriptionClient::EventCallback
will indicate whether a resubscribe will be automatically attempted.

During the event handler call, the state of the client will be `Terminated`.
If no retry will be attempted, the state of the client will transition to
`Initialized` when the event handler returns. Otherwise, the state will
transition to `ResubscribeHoldoff` and an attempt will be made to re-establish
the subscription after the hold-off time.

The application may call AbortSubscription() or Free() in this state.

The parameters sent will also include an error code indicating the
reason for ending the subscription.

The subscription could have been terminated for a number of reasons
(WRM ACK missing, ExchangeContext allocation failure, response
timeout,...) Some possible error codes generated by the client:

|Error code | Meaning |
|-----------|---------|
| #WEAVE_ERROR_INVALID_MESSAGE_TYPE | An unrecognized message is received. |
| #WEAVE_ERROR_TIMEOUT | An ack is not received or a liveness check fails.|
| #WEAVE_ERROR_INCORRECT_STATE | Messages are received in an unexpected state. |
| #WEAVE_ERROR_STATUS_REPORT_RECEIVED | A status report is received. |
| #WEAVE_ERROR_INVALID_ARGUMENT | Subscribe request fields are invalid. |

kEvent_OnExchangeStart 2

Generated after the binding has been prepared and ExchangeContext has
been set up but prior to any messages being sent. This is the last
chance for an application to adjust ExchangeContext settings, `mEC`
is valid and can be tuned for timeout settings. The application must
not touch other fields in the client and must not close the
ExchangeContext.

kEvent_OnSubscribeRequestPrepareNeeded 3

Sent when the engine is ready to send the SubscribeRequest. The
application is expected to fill in the paths that it wants to
subscribe to.

kEvent_OnSubscriptionEstablished 4

Generated upon a successful establishment of the subscription. The
application may call EndSubscription(), AbortSubscription(), or
Free() at this point.

kEvent_OnNotificationRequest 5

Generated on a receit of a NotificationRequest. The application may
call EndSubscription(), AbortSubscription(), or Free() at this point.

kEvent_OnNotificationProcessed 6

Generated when the SubscriptionEngine finishes proceesing a
NotificationRequest message. The application may call
EndSubscription(), AbortSubscription(), or Free() at this point.

kEvent_OnEventStreamReceived 7

Generated when the SubscriptionEngine encountes an event stream
within the NotificationRequest message. The application may call
EndSubscription(), AbortSubscription(), or Free() at this point.

kEvent_OnSubscriptionActivity 8

An event indicating subscription activity. It is generated whenever
the client receives an indication on subscription activity; this
includes successful subscription establishment, a reception of a
NotificationRequest or a receipt of a status report in response to
the SubscribeConfirm message.

Defined at line 75 of file gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/SubscriptionClient.h

Records

Friends

class UpdateEncoder
class UpdateDictionaryDirtyPathCut
class UpdateDirtyPathFilter
class TraitSchemaEngine
class TraitDataSink
class MockWdmSubscriptionInitiatorImpl
class WdmUpdateServerTest
class WdmUpdateEncoderTest
class TestWdm
class TestTdm
class SubscriptionEngine