class ResourceIdentifier

Defined at line 67 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/ResourceIdentifier.h

A structure encapsulating the ID of a resource.

The ResourceIdentifier may be either a generalized 64-bit object ID

of a particular type or a UUID. When encoded externally, the

following representations are supported:

-- an unsigned 64-bit integer corresponding to the generalized

object of type DEVICE with the ID specified in the

representation

-- a generalized representation encoded as a byte string of 10

octets. The first two octets encode the resource type as a

16-bit, little endian integer, with the remaining 8 bytes

encoding a little endian 64-bit resource ID.

ResourceIdentifiers also embody the conventions present throughout

the WDM code: an empty ResourceIdentifier corresponds to the node

ID of the DEVICE, and constructors are provided for the most common

usecases.

Public Methods

void ResourceIdentifier ()

Construct a ResourceIdentifier corresponding to an unspecified

ResourceID. The unspecified resource ID is a tuple consisting

of an RESERVED resource type with an kNodeIdNotSpeficied

resource.

Defined at line 76 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/ResourceIdentifier.h

void ResourceIdentifier (const uint64_t & aNodeId)

Construct a ResourceIdentifier of type DEVICE based on a given aNodeId

Parameters

aNodeId [in] NodeId of the given Resource ID

Defined at line 83 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/ResourceIdentifier.h

void ResourceIdentifier (uint16_t aResourceType, const uint64_t & aResourceId)

Construct the ResourceIdentifier of the specified type with the given ID

Parameters

aResourceType [in] The Type of a resource to be named
aResourceId [in] The ID of the resource to be named

Defined at line 94 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/ResourceIdentifier.h

void ResourceIdentifier (uint16_t aResourceType, const uint8_t * aResourceId, size_t aResourceIdLen)

Construct the ResourceIdentifier of the specified type with the given ID

Parameters

aResourceType [in] The Type of a resource to be named
aResourceId [in] The ID of the resource to be named represented as an array of bytes
aResourceIdLen [in] The length of the ID in bytes

Defined at line 106 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/ResourceIdentifier.h

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

Serialize the resource to a TLV representation using a context Path::ResourceID tag

Parameters

aWriter [in] A TLV writer to serialize the ResourceIdentifier into
WEAVE_ERROR ToTLV (nl::Weave::TLV::TLVWriter & aWriter, const uint64_t & aTag)

Serialize the resource to a TLV representation using a given tag

Parameters

aWriter [in] A TLV writer to serialize the ResourceIdentifier into
aTag [in] A tag naming the serialized ResourceIdentifier
WEAVE_ERROR FromTLV (nl::Weave::TLV::TLVReader & aReader)

Deserialize a ResourceIdentifier from a TLV representaion into this object

Parameters

aReader [in] A TLV reader positioned on the ResourceIdentifier element

Returns

WEAVE_NO_ERROR on success. Errors from TLVReader if the ResourceIdentifier cannot be properly read.

WEAVE_ERROR FromTLV (nl::Weave::TLV::TLVReader & aReader, const uint64_t & aSelfNodeId)

Deserialize a ResourceIdentifier from a TLV representaion into this object

Parameters

aReader [in] A TLV reader positioned on the ResourceIdentifier element
aSelfNodeId [in] a 64-bit ResourceID that will be remapped from the serialized representation onto SELF_NODE_ID

Returns

WEAVE_NO_ERROR on success. Errors from TLVReader if the ResourceIdentifier cannot be properly read.

WEAVE_ERROR ToString (char * buffer, size_t bufferLen)

Convert the ResourceIdentifier into a printable string.

Parameters

buffer [in] A buffer to print into
bufferLen [in] The length of the buffer
WEAVE_ERROR FromString (const char * inBuffer, size_t inBufferLen)

Parse a canonical string representation of a resource into a resource object.

Converts the canonical string representation of a resource into

a resource object. Note that only a subset of resources can be

represented as a string, in particular, the reference

implementation in Weave will only parse resources of canonical

types as expressed in the ResourceTypeEnum.

Parameters

inBuffer [in] A buffer containing the resource ID to be parsed
inBufferLen [in] The length (in bytes) of the string to be parsed
WEAVE_ERROR FromString (const char * inBuffer, size_t inBufferLen, const uint64_t & aSelfNodeId)

Parse a canonical string representation of a resource into a resource object.

Converts the canonical string representation of a resource into

a resource object. Note that only a subset of resources can be

represented as a string, in particular, the reference

implementation in Weave will only parse resources of canonical

types as expressed in the ResourceTypeEnum.

Parameters

inBuffer [in] A buffer containing the resource ID to be parsed
inBufferLen [in] The length (in bytes) of the string to be parsed
aSelfNodeId [in] The 64-bit ID denoting what device ID should be mapped onto a SELF_NODE_ID
uint64_t GetResourceId ()

An accessor function for fetching the ResourceId

Defined at line 251 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/ResourceIdentifier.h

uint16_t GetResourceType ()

An accessor function for fetching the ResourceType

Defined at line 257 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/ResourceIdentifier.h

const char * ResourceTypeAsString ()

Produce a string representation of the ResourceType. The resources types converted are those enumerated in

ResourceTypeEnum.h and the 0 (corresponding to the RESOURCE_TYPE_RESERVED)

const char * ResourceTypeAsString (uint16_t aResourceType)

Produce a string representation of a resource type. The resources types converted are those enumerated in

ResourceTypeEnum.h and the 0 (corresponding to the RESOURCE_TYPE_RESERVED)

Parameters

aResourceType [in] A resource type enum to be converted to a string representation.

Enumerations

enum 
Name Value
RESOURCE_TYPE_RESERVED 0

Defined at line 116 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/ResourceIdentifier.h

enum 
Name Value
SELF_NODE_ID 0xFFFFFFFFFFFFFFFEULL

Defines a special value for NodeId that refers to 'self'. In

certain WDM interactions, having a value of self for resource

allows for compressing out that information as it is redundant

to the source node id of the device expressed in the Weave.

message itself

Defined at line 136 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/ResourceIdentifier.h

enum 
Name Value
MAX_STRING_LENGTH 28

Defined at line 141 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Profiles/data-management/Current/ResourceIdentifier.h

Friends

bool ResourceIdentifier (const ResourceIdentifier & lhsconst ResourceIdentifier & rhs)