nl::Weave::Profiles::DataManagement_Legacy

This namespace includes all interfaces within Weave for the Weave Data Management (WDM) profile that are about to be deprecated.

Summary

Enumerations

@103{
  kStatus_CancelSuccess = 0x0001,
  kStatus_InvalidPath = 0x0013,
  kStatus_UnknownTopic = 0x0014,
  kStatus_IllegalReadRequest = 0x0015,
  kStatus_IllegalWriteRequest = 0x0016,
  kStatus_InvalidVersion = 0x0017,
  kStatus_UnsupportedSubscriptionMode = 0x0018
}
enum
@166{
  kViewPoolSize = WEAVE_CONFIG_WDM_VIEW_POOL_SIZE,
  kSubscribePoolSize = WEAVE_CONFIG_WDM_SUBSCRIBE_POOL_SIZE,
  kCancelSubscriptionPoolSize = WEAVE_CONFIG_WDM_CANCEL_SUBSCRIPTION_POOL_SIZE,
  kUpdatePoolSize = WEAVE_CONFIG_WDM_UPDATE_POOL_SIZE,
  kNotifyPoolSize = WEAVE_CONFIG_WDM_NOTIFY_POOL_SIZE,
  kTransactionTableSize = WEAVE_CONFIG_WDM_TRANSACTION_TABLE_SIZE,
  kBindingTableSize = WEAVE_CONFIG_WDM_BINDING_TABLE_SIZE,
  kNotifierTableSize = WEAVE_CONFIG_WDM_NOTIFIER_TABLE_SIZE,
  kSubscriptionMgrTableSize = WEAVE_CONFIG_WDM_SUBSCRIPTION_MGR_TABLE_SIZE
}
enum
WDM pool and table sizes.
@167{
  kMsgType_ViewRequest = 0x10,
  kMsgType_ViewResponse = 0x11,
  kMsgType_SubscribeRequest = 0x12,
  kMsgType_SubscribeResponse = 0x13,
  kMsgType_CancelSubscriptionRequest = 0x14,
  kMsgType_UpdateRequest = 0x15,
  kMsgType_NotifyRequest = 0x16,
  kMsgType_ViewRequest_Deprecated = 0x00,
  kMsgType_ViewResponse_Deprecated = 0x01,
  kMsgType_SubscribeRequest_Deprecated = 0x02,
  kMsgType_SubscribeResponse_Deprecated = 0x03,
  kMsgType_CancelSubscriptionRequest_Deprecated = 0x04,
  kMsgType_UpdateRequest_Deprecated = 0x05,
  kMsgType_NotifyRequest_Deprecated = 0x06
}
enum
The WDM profile message types.
@168{
  kTransactionIdNotSpecified = 0,
  kResponseTimeoutNotSpecified = 0,
  kVersionNotSpecified = 0xFFFFFFFFFFFFFFFFULL,
  kInstanceIdNotSpecified = 0,
  kDefaultBindingTableIndex = 0,
  kWeaveTLVTagLen = 8,
  kWeaveTLVControlByteLen = 1
}
enum
Miscellaneous WDM-specific constants.
@169{
  kStatus_CancelSuccess = 0x0001,
  kStatus_InvalidPath = 0x0013,
  kStatus_UnknownTopic = 0x0014,
  kStatus_IllegalReadRequest = 0x0015,
  kStatus_IllegalWriteRequest = 0x0016,
  kStatus_InvalidVersion = 0x0017,
  kStatus_UnsupportedSubscriptionMode = 0x0018
}
enum
WDM-specific status codes.
@170{
  kTag_WDMPathList = 100,
  kTag_WDMPathProfile = 101,
  kTag_WDMPathProfileId = 1,
  kTag_WDMPathProfileInstance = 2,
  kTag_WDMPathProfileId_Deprecated = 102,
  kTag_WDMPathProfileInstance_Deprecated = 103,
  kTag_WDMPathArrayIndexSelector = 104,
  kTag_WDMPathArrayValueSelector = 105,
  kTag_WDMDataList = 200,
  kTag_WDMDataListElementPath = 3,
  kTag_WDMDataListElementVersion = 4,
  kTag_WDMDataListElementData = 5,
  kTag_WDMDataListElementPath_Deprecated = 201,
  kTag_WDMDataListElementVersion_Deprecated = 202,
  kTag_WDMDataListElementData_Deprecated = 203
}
enum
Data Management Protocol Tags.
@171{
  kTopicIdPublisherSpecificMask = 0xFFFF000000000000ULL,
  kTopicIdNotSpecified = 0x0000000000000000ULL,
  kAnyTopicId = 0xFFFFFFFFFFFFFFFFULL
}
enum
Distinguished topic IDs.
WeaveTransportOption{
  kTransport_TCP = 1,
  kTransport_WRMP = 2,
  kTransport_UDP = 3
}
enum
WDM transport options.

Typedefs

TopicIdentifier typedef
uint64_t
The topic identifier.

Functions

CheckTLVType(nl::Weave::TLV::TLVType aType, nl::Weave::TLV::TLVReader & aReader)
bool
Check that a TLV element being read has the expected TLV type.
CheckWDMTag(uint32_t aTagNum, nl::Weave::TLV::TLVReader & aReader)
bool
Check a WDM-specific tag.
CloseDataListElement(nl::Weave::TLV::TLVReader & aReader)
Stop reading a WDM data list element.
CloseList(nl::Weave::TLV::TLVReader & aReader)
Stop reading a WDM path or data list.
EncodeDeprecatedPath(TLVWriter & aWriter, const uint64_t & aTag, uint32_t aProfileId, const uint64_t & aInstanceId, uint32_t aPathLen, ...)
Encode a WDM path with deprecated tags and an integer instance ID.
EncodeDeprecatedPath(TLVWriter & aWriter, const uint64_t & aTag, uint32_t aProfileId, const char *aInstanceId, uint32_t aPathLen, ...)
Encode a WDM path with deprecated tags and a string instance ID.
EncodePath(TLVWriter & aWriter, const uint64_t & aTag, uint32_t aProfileId, const uint64_t & aInstanceId, uint32_t aPathLen, ...)
Encode a WDM path with an integer profile instance ID.
EncodePath(TLVWriter & aWriter, const uint64_t & aTag, uint32_t aProfileId, const uint32_t aInstanceIdLen, const uint8_t *aInstanceId, uint32_t aPathLen, ...)
Encode a WDM path with a byte array instance ID.
EncodePath(TLVWriter & aWriter, const uint64_t & aTag, uint32_t aProfileId, const char *aInstanceId, uint32_t aPathLen, ...)
Encode a WDM path with a string instance ID.
EndDataListElement(nl::Weave::TLV::TLVWriter & aWriter)
Finish writing a data list element.
EndEncodePath(TLVWriter & aWriter, TLVType & mOuterContainer, WEAVE_ERROR mError)
EndList(nl::Weave::TLV::TLVWriter & aWriter)
Finish writing a path list or data list.
EndList(ReferencedTLVData & aList, nl::Weave::TLV::TLVWriter & aWriter)
Finish writing a path list or data list.
IsPublisherSpecific(const TopicIdentifier & aTopicId)
bool
Check if a topic ID is publisher-specific.
OpenDataList(ReferencedTLVData & aDataList, nl::Weave::TLV::TLVReader & aReader)
Start reading a data list.
OpenDataListElement(nl::Weave::TLV::TLVReader & aReader, nl::Weave::TLV::TLVReader & aPathReader, uint64_t & aVersion)
Start reading a data list element.
OpenPathList(ReferencedTLVData & aPathList, nl::Weave::TLV::TLVReader & aReader)
Start reading a path list.
PublisherSpecificTopicId(void)
Generate a publisher-specific topic ID from scratch.
SendStatusReport(ExchangeContext *aExchangeCtx, StatusReport & aStatus)
StartDataList(nl::Weave::TLV::TLVWriter & aWriter)
Start writing a data list.
StartDataList(ReferencedTLVData & aDataList, nl::Weave::TLV::TLVWriter & aWriter)
Start writing a data list to a given ReferencedTLVData object.
StartDataListElement(nl::Weave::TLV::TLVWriter & aWriter)
Start writing a data list element.
StartEncodePath(TLVWriter & aWriter, const uint64_t & aTag, uint32_t aProfileId, TLVType & mOuterContainer, TLVType & mPath)
StartPathList(nl::Weave::TLV::TLVWriter & aWriter)
Start writing a path list.
TxnResponseHandler(ExchangeContext *anExchangeCtx, const IPPacketInfo *anAddrInfo, const WeaveMessageInfo *aMsgInfo, uint32_t aProfileId, uint8_t aMsgType, PacketBuffer *aMsg)
void
TxnTimeoutHandler(ExchangeContext *anExchangeCtx)
void
ValidateTLVType(nl::Weave::TLV::TLVType aType, nl::Weave::TLV::TLVReader & aReader)
Validate that a TLV element being read has the expected TLV type.
ValidateWDMTag(uint32_t aTagNum, nl::Weave::TLV::TLVReader & aReader)
Validate that a TLV element being read has the expected WDM tag.

Classes

nl::Weave::Profiles::DataManagement_Legacy::Binding

The Binding class manages communications state on behalf of an application entity using Weave.

nl::Weave::Profiles::DataManagement_Legacy::ClientDataManager

An abstract class containing confirm and indication method definitions required by the WDM client.

nl::Weave::Profiles::DataManagement_Legacy::ClientNotifier

An auxiliary class employed when subscription and notification support are desired on a WDM client.

nl::Weave::Profiles::DataManagement_Legacy::DMClient

The abstract base class for application-specific WDM clients.

nl::Weave::Profiles::DataManagement_Legacy::DMPublisher

The abstract base class for application-specific WDM publishers.

nl::Weave::Profiles::DataManagement_Legacy::ProfileDatabase

The abstract ProfileDatabase auxiliary class.

nl::Weave::Profiles::DataManagement_Legacy::ProtocolEngine

The WDM protocol engine class.

nl::Weave::Profiles::DataManagement_Legacy::PublisherDataManager

An abstract class containing confirm and notification method definitions required by the WDM publisher.

Enumerations

@103

 @103
Properties
kStatus_CancelSuccess

This legacy status code means a subscription was successfully canceled.

This status code means a subscription was successfully canceled.

kStatus_IllegalReadRequest

This legacy status code means the node making a request to read a particular data item does not have permission to do so.

This status code means the node making a request to read a particular data item does not have permission to do so.

kStatus_IllegalWriteRequest

This legacy status code means the node making a request to write a particular data item does not have permission to do so.

This status code means the node making a request to write a particular data item does not have permission to do so.

kStatus_InvalidPath

This legacy status code means a path from the path list of a view or update request frame did not match the node-resident schema of the responder.

This status code means a path from the path list of a view or update request frame did not match the node-resident schema of the responder.

kStatus_InvalidVersion

This legacy status code means the version for data included in an update request did not match with the most recent version on the publisher and so the update could not be applied.

This status code means the version for data included in an update request did not match with the most recent version on the publisher and so the update could not be applied.

kStatus_UnknownTopic

This legacy status code means the topic identifier given in a cancel request or notification did not match any subscription extant on the receiving node.

This status code means the topic identifier given in a cancel request or notification did not match any subscription extant on the receiving node.

kStatus_UnsupportedSubscriptionMode

This legacy status code means the requested mode of subscription is not supported by the receiving device.

This status code means the requested mode of subscription is not supported by the receiving device.

@166

 @166

WDM pool and table sizes.

WDM defines various pools and tables that are needed for its operation, as follows.

Client transaction pools:

  • kViewPoolSize
  • kSubscribePoolSize
  • kCancelSubscriptionPoolSize
  • kUpdatePoolSize

Publisher transaction pools:

  • kNotifyPoolSize

Protocol engine tables:

  • kTransactionTableSize
  • kBindingTableSize

Subscription-related tables:

  • kNotifierTableSize (client only)
  • kSubscriptionMgrTableSize (publisher only)

Note that these are configurable quantities and that the per-platform values appear in the associated WeaveConfig.h.

Properties
kBindingTableSize

This is the default size of the binding table in the WDM protocol engine.

This value may be configured via WEAVE_CONFIG_WDM_BINDING_TABLE_SIZE.

kCancelSubscriptionPoolSize

This is the default size of the cancel subscription request transaction pool for a WDM client.

This value may be configured via WEAVE_CONFIG_WDM_CANCEL_SUBSCRIPTION_POOL_SIZE.

kNotifierTableSize

This is the default size of the notification table for WDM clients.

This value may be configured via WEAVE_CONFIG_WDM_NOTIFIER_TABLE_SIZE.

kNotifyPoolSize

This is the default size of the notify request transaction pool for a WDM publisher.

This value may be configured via WEAVE_CONFIG_WDM_NOTIFY_POOL_SIZE.

kSubscribePoolSize

This is the default size of the subscribe request transaction pool for a WDM client.

This value may be configured via WEAVE_CONFIG_WDM_SUBSCRIBE_POOL_SIZE.

kSubscriptionMgrTableSize

This is the default size of the subscription table for WDM publishers.

This value may be configured via WEAVE_CONFIG_WDM_SUBSCRIPTION_MGR_TABLE_SIZE.

kTransactionTableSize

This is the default size of the transaction table in the WDM protocol engine.

This value may be configured via WEAVE_CONFIG_WDM_TRANSACTION_TABLE_SIZE.

kUpdatePoolSize

This is the default size of the update request transaction pool for a WDM client.

This value may be configured via WEAVE_CONFIG_WDM_UPDATE_POOL_SIZE.

kViewPoolSize

This is the default size of the view request transaction pool for a WDM client.

This value may be configured via WEAVE_CONFIG_WDM_VIEW_POOL_SIZE.

@167

 @167

The WDM profile message types.

These values are called out in the data management specification.

NOTE!! As of Q1 2015, the message types used in previous versions of WDM have been deprecated and new message types have been defined, reflecting a sufficient shift with past packing and parsing details to justify a clean break.

Properties
kMsgType_CancelSubscriptionRequest

Cancel subscription request message.

kMsgType_CancelSubscriptionRequest_Deprecated

deprecated

kMsgType_NotifyRequest

Notify request message.

kMsgType_NotifyRequest_Deprecated

deprecated

kMsgType_SubscribeRequest

Subscribe request message.

kMsgType_SubscribeRequest_Deprecated

deprecated

kMsgType_SubscribeResponse

Subscribe response message.

kMsgType_SubscribeResponse_Deprecated

deprecated

kMsgType_UpdateRequest

Update request message.

kMsgType_UpdateRequest_Deprecated

deprecated

kMsgType_ViewRequest

View request message.

kMsgType_ViewRequest_Deprecated

deprecated

kMsgType_ViewResponse

View response message.

kMsgType_ViewResponse_Deprecated

deprecated

@168

 @168

Miscellaneous WDM-specific constants.

Properties
kDefaultBindingTableIndex

The index of the default binding in a protocol engine binding table with more than one entry.

kInstanceIdNotSpecified

In calls requiring a profile instance specification, indicates "none'.

Most often this means that only one instance of the profile is present on the entity in question.

kResponseTimeoutNotSpecified

In methods requesting a transaction, indicates that the caller has declined to specify a timeout.

Generally this means a default should be used.

kTransactionIdNotSpecified

In methods and data structures that take a transaction ID, indicates "none" or a wild-card value.

kVersionNotSpecified

In calls requiring the specification of a data version, indicates "no particular version".

kWeaveTLVControlByteLen

The length of a TLV control byte, used in support methods that encode WDM structures in TLV.

kWeaveTLVTagLen

The standard length in bytes of a full-qualified TLV tag, used in support methods that encode WDM structures in TLV.

@169

 @169

WDM-specific status codes.

Properties
kStatus_CancelSuccess

This legacy status code means a subscription was successfully canceled.

This status code means a subscription was successfully canceled.

kStatus_IllegalReadRequest

This legacy status code means the node making a request to read a particular data item does not have permission to do so.

This status code means the node making a request to read a particular data item does not have permission to do so.

kStatus_IllegalWriteRequest

This legacy status code means the node making a request to write a particular data item does not have permission to do so.

This status code means the node making a request to write a particular data item does not have permission to do so.

kStatus_InvalidPath

This legacy status code means a path from the path list of a view or update request frame did not match the node-resident schema of the responder.

This status code means a path from the path list of a view or update request frame did not match the node-resident schema of the responder.

kStatus_InvalidVersion

This legacy status code means the version for data included in an update request did not match with the most recent version on the publisher and so the update could not be applied.

This status code means the version for data included in an update request did not match with the most recent version on the publisher and so the update could not be applied.

kStatus_UnknownTopic

This legacy status code means the topic identifier given in a cancel request or notification did not match any subscription extant on the receiving node.

This status code means the topic identifier given in a cancel request or notification did not match any subscription extant on the receiving node.

kStatus_UnsupportedSubscriptionMode

This legacy status code means the requested mode of subscription is not supported by the receiving device.

This status code means the requested mode of subscription is not supported by the receiving device.

@170

 @170

Data Management Protocol Tags.

The data management protocol defines a number of tags to be used in the TLV representation of profile data.

As usual there are compatibility issues between new WDM and old. in the bad old days, all of these tags were applied as profile-specific, which was a waste of space. now we are using context tags where possible but we need to keep the old ones around (and have a mechanism for encoding paths with them in place) where appropriate.

The kTag_WDMDataListElementData tag was not used in in previous releases and was completely ignored by the code, so we don't have to provide a deprecated version.

Properties
kTag_WDMDataList

The element is a list of structures containing path, optional version and data elements.

Tag Type: Profile-specific Element Type: Array Disposition: Top-level

kTag_WDMDataListElementData

The element represents the data pointed at by given path and having the given version.

Tag Type: Context-specific Element Type: Any Disposition: Required

kTag_WDMDataListElementData_Deprecated

Deprecated.

Tag Type: Context-specific Element Type: Any Disposition: Required

kTag_WDMDataListElementPath

The element is the path component of a data list element.

Tag Type: Context-specific Element Type: Path Disposition: Required

kTag_WDMDataListElementPath_Deprecated

Deprecated.

Tag Type: Profile-specific Element Type: Path Disposition: Required

kTag_WDMDataListElementVersion

The element is the version component of a data list element.

Tag Type: Context-specific Element Type: Integer Disposition: Required

kTag_WDMDataListElementVersion_Deprecated

Deprecated.

Tag Type: Profile-specific Element Type: Integer Disposition: Required

kTag_WDMPathArrayIndexSelector

The path element corresponds to an array in the schema and the contained integer element is to be used as an index into that array.

Tag Type: Profile-specific Element Type: Integer Disposition: Optional

kTag_WDMPathArrayValueSelector

The path element corresponds to an array in the schema and the encapsulated element is to be used as a record selector.

Tag Type: Profile-specific Element Type: Structure Disposition: Optional

kTag_WDMPathList

The element is a list of TLV paths.

Tag Type: Profile-specific Element Type: Array Disposition: Top-level

kTag_WDMPathProfile

The element is a structure that is used to start a path and contains the profile information in light of which the tags in the path are to be interpreted.

Tag Type: Profile-specific Element Type: Structure Disposition: Required

kTag_WDMPathProfileId

The element is a profile ID component of the path profile element that begins a TLV path.

Tag Type: Context-specific Element Type: Integer Disposition: Required

kTag_WDMPathProfileId_Deprecated

Deprecated.

Tag Type: Profile-specific Element Type: Integer Disposition: Required

kTag_WDMPathProfileInstance

The element is a profile instance, which may follow the profile ID in a TLV path.

Note that a node may or may not have multiple instances of a particular profile and, in the case where there is only one, this element may be omitted.

Tag Type: Context-specific Element Type: Any Disposition: Optional

kTag_WDMPathProfileInstance_Deprecated

Deprecated.

Tag Type: Profile-specific Element Type: Any Disposition: Optional

@171

 @171

Distinguished topic IDs.

There are three distinguished topic IDs of interest, all three of which are formatted as "publisher-specific".

Properties
kAnyTopicId

This is reserved as a wild-card topic ID.

kTopicIdNotSpecified

This is a special value reserved to express either an invalid or a wild-card topic ID.

kTopicIdPublisherSpecificMask

This is used as a mask to create or decompose a topci ID.

WeaveTransportOption

 WeaveTransportOption

WDM transport options.

These are mutually exclusive transport options for WDM.

Properties
kTransport_TCP

The underlying transport is TCP.

The binding may be completed either using the service manager or directly using the message layer.

kTransport_UDP

The underlying transport is exclusively UDP.

kTransport_WRMP

The underlying transport is exclusively UDP but with "application support layer" reliability enhancements.

Typedefs

TopicIdentifier

uint64_t TopicIdentifier

The topic identifier.

Topic identifiers are 64-bit quantities with two related uses/semantics. First of all, they may be used as a conventional shorthand for a well-known set of paths, e.g. "the Nest smoke detector". Topic IDs that are used in this way shall, like profile identifiers, contain a vendor code that prevents topic IDs chosen autonomously by disparate vendors from conflicting, as follows:

bit 48 - 63 bit 0 - 47
Vendor ID Topic number
The second use/semantics for topic identifiers arises in that case of a dynamic subscription between a WDM client and a publisher. in this case, the publisher shall always supply an unique topic ID that stands for the specific subscription and it shall do this whether the subscription was requested using a well-known topic ID or an arbitrary path list. topic identifiers of this form are distinguished by having a vendor code of 0xFFFF.

See also:
WeaveVendorIdentifiers.hpp

Functions

CheckTLVType

bool CheckTLVType(
  nl::Weave::TLV::TLVType aType,
  nl::Weave::TLV::TLVReader & aReader
)

Check that a TLV element being read has the expected TLV type.

Check a given TLV type against the element type at the head of a TLV reader.

Details
Parameters
[in] aType
The TLVType to be checked against a specific element
[in] aReader
A reference to a TLV reader positioned at the element to be checked
Returns
true iff the TLVType of the element and aType match.
See also:
WeaveTLVTypes.h

CheckWDMTag

bool CheckWDMTag(
  uint32_t aTagNum,
  nl::Weave::TLV::TLVReader & aReader
)

Check a WDM-specific tag.

Check the number of a WDM-specific tag, from .../data-management/DMConstants.h, against the actual tag at the head of a TLV reader.

Details
Parameters
[in] aTagNum
The tag number to be checked against a specific TLV element.
[in] aReader
A reference to a TLV reader pointing to the element to be checked.
Returns
true iff aReader.GetTag() produces a tag that matches one of the expected tag forms for the given tag number.

CloseDataListElement

WEAVE_ERROR CloseDataListElement(
  nl::Weave::TLV::TLVReader & aReader
)

Stop reading a WDM data list element.

This method assumes that the element in question is part of a WDM data list and so passes kTLVType_Array to ExitContainer().

Details
Parameters
[in,out] aReader
A TLV reader positioned in a WDM data list element.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to exit a container.

CloseList

WEAVE_ERROR CloseList(
  nl::Weave::TLV::TLVReader & aReader
)

Stop reading a WDM path or data list.

This method assumes that the list in question is the topmost TLV element and so passes kTLVType_Sructure to ExitContainer().

Details
Parameters
[in,out] aReader
A TLV reader positioned in a WDM path or data list.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to exit a container.

EncodeDeprecatedPath

WEAVE_ERROR EncodeDeprecatedPath(
  TLVWriter & aWriter,
  const uint64_t & aTag,
  uint32_t aProfileId,
  const uint64_t & aInstanceId,
  uint32_t aPathLen,
  ...
)

Encode a WDM path with deprecated tags and an integer instance ID.

Note:Encode a path using the deprecated tag set accepted by the service before Weave release 2.0. This version of the method takes a numerical instance identifier. This method starts a container with ProfileTag(kWeaveProfile_WDM, kTag_WDMPathProfile) and then inserts the profile ID with ProfileTag(kWeaveProfile_WDM, kTag_WDMPathProfileId_Deprecated). It then inserts the instance ID with ProfileTag(kWeaveProfile_WDM, kTag_WDMPathProfileInstance_Deprecated). This is one of the deprecated versions for encoding a path, and new designs shall avoid using this format.

Details
Parameters
[in] aWriter
A reference to the TLV writer used to write out the path.
[in] aTag
A reference to the fully-qualified TLV tag that applies to this path.
[in] aProfileId
The profile ID under which elements of the path are to be interpreted.
[in] aInstanceId
A reference to the optional instance ID of the profile to be used.
[in] aPathLen
The, possibly 0, length of the list of path elements beyond the initial profile specifier.
[in] ...
The optional variable-length list of additional path tags.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to format the given path.

EncodeDeprecatedPath

WEAVE_ERROR EncodeDeprecatedPath(
  TLVWriter & aWriter,
  const uint64_t & aTag,
  uint32_t aProfileId,
  const char *aInstanceId,
  uint32_t aPathLen,
  ...
)

Encode a WDM path with deprecated tags and a string instance ID.

Note:Encode a path using the deprecated tag set (see DMConstants.h). This version of the method takes an instance ID string. This method starts a container with ProfileTag(kWeaveProfile_WDM, kTag_WDMPathProfile) and then inserts the profile ID with ProfileTag(kWeaveProfile_WDM, kTag_WDMPathProfileId_Deprecated). It then inserts the instance ID with ProfileTag(kWeaveProfile_WDM, kTag_WDMPathProfileInstance_Deprecated). This is one of the deprecated versions for encoding a path, and new designs shall avoid using this format.

Details
Parameters
[in] aWriter
A reference to the TLV writer used to write out the path.
[in] aTag
A reference to the fully-qualified TLV tag that applies to this path.
[in] aProfileId
The profile ID under which elements of the path are to be interpreted.
[in] aInstanceId
The optional string used as a profile instance identifier. This argument may be NULL if no instance ID is specified.
[in] aPathLen
The, possibly 0, length of the list of path elements beyond the initial profile specifier.
[in] ...
The optional, variable-length list of additional path tags.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to format the given path.

EncodePath

WEAVE_ERROR EncodePath(
  TLVWriter & aWriter,
  const uint64_t & aTag,
  uint32_t aProfileId,
  const uint64_t & aInstanceId,
  uint32_t aPathLen,
  ...
)

Encode a WDM path with an integer profile instance ID.

Note:Write a TLV path of the kind used in data management where, in particular, there is a profile designation placed at the beginning in order to allow interpretation of subsequent path elements. This version of the method takes an integer profile instance ID.

This method inserts instance ID using ContextTag(kTag_WDMPathProfileInstance), which is the latest version for encoding a path.

Details
Parameters
[in] aWriter
A reference to the TLV writer used to write out the path.
[in] aTag
A reference to the fully-qualified TLV tag that applies to this path.
[in] aProfileId
The profile ID under which elements of the path are to be interpreted.
[in] aInstanceId
A reference to the optional instance identifier of the profile to be used. If no instance ID is to be used then this parameter should have a value of kInstanceIdNotSpecified.
[in] aPathLen
The, possibly 0, length of the list of path elements beyond the initial profile specifier.
[in] ...
The optional variable-length list of additional path tags.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to format the given path.

EncodePath

WEAVE_ERROR EncodePath(
  TLVWriter & aWriter,
  const uint64_t & aTag,
  uint32_t aProfileId,
  const uint32_t aInstanceIdLen,
  const uint8_t *aInstanceId,
  uint32_t aPathLen,
  ...
)

Encode a WDM path with a byte array instance ID.

Note:Write a TLV path of the kind used in data management where, in particular, there is a profile designation placed at the beginning in order to allow interpretation of subsequent path elements. This version of the method takes a byte-array profile instance ID along with a length.

This method inserts instance ID using ContextTag(kTag_WDMPathProfileInstance), which is the latest version for encoding a path.

Details
Parameters
[in] aWriter
A reference to the TLV writer used to write out the path.
[in] aTag
A reference to the fully-qualified TLV tag that applies to this path.
[in] aProfileId
The profile ID under which the elements of the path are to be interpreted.
[in] aInstanceIdLen
The length of the byte array that constitutes the instance ID. If there is no ID then this parameter shall have a value of 0.
[in] aInstanceId
The optional byte array used as a profile instance identifier. This argument may be NULL in the case where no instance ID is specified.
[in] aPathLen
The, possibly 0, length of the list of path elements beyond the initial profile specifier.
[in] ...
The optional, variable-length list of additional path tags.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to format the given path.

EncodePath

WEAVE_ERROR EncodePath(
  TLVWriter & aWriter,
  const uint64_t & aTag,
  uint32_t aProfileId,
  const char *aInstanceId,
  uint32_t aPathLen,
  ...
)

Encode a WDM path with a string instance ID.

Note:Write a TLV path of the kind used in data management where, in particular, there is a profile designation placed at the beginning in order to allow interpretation of subsequent path elements. This version of the method takes a string profile instance ID.

This method inserts instance ID using ContextTag(kTag_WDMPathProfileInstance), which is the latest version for encoding a path.

Details
Parameters
[in] aWriter
A reference to the TLV writer used to write out the path.
[in] aTag
A reference to the fully-qualified TLV tag that applies to this path.
[in] aProfileId
The profile ID under which elements of the path are to be interpreted.
[in] aInstanceId
The optional string used as a profile instance identifier. This argument may be NULL if no instance ID is specified.
[in] aPathLen
The, possibly 0, length of the list of path elements beyond the initial profile specifier.
[in] ...
The optional, variable-length list of additional path tags.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to format the given path.

EndDataListElement

WEAVE_ERROR EndDataListElement(
  nl::Weave::TLV::TLVWriter & aWriter
)

Finish writing a data list element.

Write the TLV for the end of a WDM data list element. Note this this automatically passes in a type of kTLVType_Array to the EndContainer() call assuming that we are always closing a list item.

Details
Parameters
[in] aWriter
A reference to a TLV writer with which to write the end of the item.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to end a container.

EndEncodePath

WEAVE_ERROR EndEncodePath(
  TLVWriter & aWriter,
  TLVType & mOuterContainer,
  WEAVE_ERROR mError
)

EndList

WEAVE_ERROR EndList(
  nl::Weave::TLV::TLVWriter & aWriter
)

Finish writing a path list or data list.

Write the TLV for the end of a WDM path or data list. Also, finalize the writer.

Details
Parameters
[in,out] aWriter
A reference to a TLV writer with which to write the end of the list.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to end a container.

EndList

WEAVE_ERROR EndList(
  ReferencedTLVData & aList,
  nl::Weave::TLV::TLVWriter & aWriter
)

Finish writing a path list or data list.

Write the TLV for the end of a WDM path or data list. Also, finalize the writer. In this case, the ReferencedTLVData object to which the TLV is being written is passed in and modified to reflect the amount of data written.

Details
Parameters
[in,out] aList
A reference to the ReferenceTLVData object to which the list was being written.
[in] aWriter
A reference to a TLV writer with which to write the end of the list.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to end a container.

IsPublisherSpecific

bool IsPublisherSpecific(
  const TopicIdentifier & aTopicId
)

Check if a topic ID is publisher-specific.

Details
Parameters
[in] aTopicId
a topic identifier ot check
Returns
true if the topic ID is publisher-specific, false otherwise

OpenDataList

WEAVE_ERROR OpenDataList(
  ReferencedTLVData & aDataList,
  nl::Weave::TLV::TLVReader & aReader
)

Start reading a data list.

Given a fresh reader and a data list, start reading the list and validate the tags and types initially encountered in the process. If all goes well, the reader stops after the list container is entered.

Details
Parameters
[in] aDataList
A data list passed as a reference to a ReferencedTLVData object. The normal use case will be where the list is actually still in a buffer after receipt.
[out] aReader
A reference to a TLV reader used to read the data list. This reader will be left pointing just before the first item in the list.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting a failure the open the data list and/or validate the relevant tags and types.

OpenDataListElement

WEAVE_ERROR OpenDataListElement(
  nl::Weave::TLV::TLVReader & aReader,
  nl::Weave::TLV::TLVReader & aPathReader,
  uint64_t & aVersion
)

Start reading a data list element.

Given a reader positioned at a data list element, start reading the element and validate the tags and types initially encountered in the process. If all goes well, the reader ends up positioned at the data element data and the in/out path reader is positioned at the corresponding path.

Details
Parameters
[in] aReader
A reference to a TLV reader positioned at a data list element.
[out] aPathReader
A reference to a TLV reader to be pointed at the path component of the data list element.
[out] aVersion
A reference to a 64-bit integer to be set either to the data list element version if one is present or else to kVersionNotSpecified.
Returns
WEAVE_NO_ERROR on success or else a WEAVE_ERROR associated with opening and reading the data list element.

OpenPathList

WEAVE_ERROR OpenPathList(
  ReferencedTLVData & aPathList,
  nl::Weave::TLV::TLVReader & aReader
)

Start reading a path list.

Given a fresh reader and a path list, start reading the list and validate the tags and types initially encountered in the process. If all goes well, the reader stops after the list container is entered.

Details
Parameters
[in] aPathList
A path list passed as a reference to a ReferencedTLVData object. The normal use case will be where the list is actually still in a buffer after receipt.
[out] aReader
A reference to a TLV reader used to read the path list. This reader will be left pointing just before the first path in the list.
Returns
WEAVE_NO_ERROR on success; otherwise, a WEAVE_ERROR reflecting a failure the open the path list and/or validate the relevant tags and types.

PublisherSpecificTopicId

TopicIdentifier PublisherSpecificTopicId(
  void
)

Generate a publisher-specific topic ID from scratch.

Details
Returns
the new topic identifier.

SendStatusReport

WEAVE_ERROR SendStatusReport(
  ExchangeContext *aExchangeCtx,
  StatusReport & aStatus
)

StartDataList

WEAVE_ERROR StartDataList(
  nl::Weave::TLV::TLVWriter & aWriter
)

Start writing a data list.

Write the TLV for the beginning of a WDM data list, e.g. as the primary argument of an UpdateRequest().

Details
Parameters
[in] aWriter
A reference to a TLV writer with which to start writing.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to start a container.

StartDataList

WEAVE_ERROR StartDataList(
  ReferencedTLVData & aDataList,
  nl::Weave::TLV::TLVWriter & aWriter
)

Start writing a data list to a given ReferencedTLVData object.

Write the TLV for the beginning of a WDM data list. In this case, we assume that we're writing out the data list to a referenced TLV data structure. The writer is assumed to be uninitialized - or, in any case, will be initialized to point to the given object.

Details
Parameters
[out] aDataList
A reference to a ReferencedTLVData object that is to be the target of the writer and eventually contain the data of interest.
[in] aWriter
A reference to a TLV writer with which to start writing.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to start a container.

StartDataListElement

WEAVE_ERROR StartDataListElement(
  nl::Weave::TLV::TLVWriter & aWriter
)

Start writing a data list element.

Write the TLV for the beginning of a WDM data list element.

Details
Parameters
[in] aWriter
A reference to a TLV writer with which to start writing.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to start a container.

StartEncodePath

WEAVE_ERROR StartEncodePath(
  TLVWriter & aWriter,
  const uint64_t & aTag,
  uint32_t aProfileId,
  TLVType & mOuterContainer,
  TLVType & mPath
)

StartPathList

WEAVE_ERROR StartPathList(
  nl::Weave::TLV::TLVWriter & aWriter
)

Start writing a path list.

Write the TLV for the beginning of a WDM path list, e.g. as the primary argument of a ViewRequest().

Details
Parameters
[in] aWriter
A reference to a TLV writer with which to start writing.
Returns
WEAVE_NO_ERROR On success. Otherwise return a WEAVE_ERROR reflecting an inability to start a container.

TxnResponseHandler

void TxnResponseHandler(
  ExchangeContext *anExchangeCtx,
  const IPPacketInfo *anAddrInfo,
  const WeaveMessageInfo *aMsgInfo,
  uint32_t aProfileId,
  uint8_t aMsgType,
  PacketBuffer *aMsg
)

TxnTimeoutHandler

void TxnTimeoutHandler(
  ExchangeContext *anExchangeCtx
)

ValidateTLVType

WEAVE_ERROR ValidateTLVType(
  nl::Weave::TLV::TLVType aType,
  nl::Weave::TLV::TLVReader & aReader
)

Validate that a TLV element being read has the expected TLV type.

Check a given TLV type against the element type at the head of a TLV reader and return an error if there is no match.

Details
Parameters
[in] aType
The TLVType to be validated against a specific element.
[in] aReader
A reference to a TLV reader positioned at the element to be validated.
Returns
WEAVE_NO_ERROR if there is a match or WEAVE_ERROR_WRONG_TLV_TYPE if not.
See also:
WeaveTLVTypes.h

ValidateWDMTag

WEAVE_ERROR ValidateWDMTag(
  uint32_t aTagNum,
  nl::Weave::TLV::TLVReader & aReader
)

Validate that a TLV element being read has the expected WDM tag.

Details
Parameters
[in] aTagNum
The 32-bit tag number of the expected WDM tag.
[in] aReader
A TLV reader positioned at the element to be validated.
Returns
WEAVE_NO_ERROR On success. Otherwise WEAVE_ERROR_INVALID_TLV_TAG if the tag does not match the given tag number when interpreted as a WDM tag.