-static CborError OCTagsPayloadToCbor(OCTagsPayload *tags, CborEncoder *setMap);
-static CborError OCLinksPayloadToCbor(OCLinksPayload *rtPtr, CborEncoder *setMap);
+static int64_t OCTagsPayloadToCbor(OCTagsPayload *tags, CborEncoder *setMap);
+static int64_t OCLinksPayloadToCbor(OCLinksPayload *rtPtr, CborEncoder *setMap);
+static int64_t ConditionalAddTextStringToMap(CborEncoder* map, const char* key, const char *value);
+static int64_t ConditionalAddIntToMap(CborEncoder *map, const char *tags, const uint64_t *value);
+static int64_t AddStringLLToMap(CborEncoder *map, const char *tag, const OCStringLL *value);
static CborError OCTagsCborToPayload(CborValue *tagsMap, OCTagsPayload **tagsPayload);
static CborError OCLinksCborToPayload(CborValue *linksArray, OCLinksPayload **linksPayload);
static CborError FindStringInMap(const CborValue *map, const char *tags, char **value);
static CborError FindIntInMap(const CborValue *map, const char *tags, uint64_t *value);
static CborError FindStringLLInMap(const CborValue *linksMap, const char *tag, OCStringLL **links);
static CborError OCTagsCborToPayload(CborValue *tagsMap, OCTagsPayload **tagsPayload);
static CborError OCLinksCborToPayload(CborValue *linksArray, OCLinksPayload **linksPayload);
static CborError FindStringInMap(const CborValue *map, const char *tags, char **value);
static CborError FindIntInMap(const CborValue *map, const char *tags, uint64_t *value);
static CborError FindStringLLInMap(const CborValue *linksMap, const char *tag, OCStringLL **links);
-static CborError ConditionalAddTextStringToMap(CborEncoder* map, const char* key, const char *value);
-static CborError ConditionalAddIntToMap(CborEncoder *map, const char *tags, const uint64_t *value);
-static CborError AddStringLLToMap(CborEncoder *map, const char *tag, const OCStringLL *value);
rdPayload->rdDiscovery->n.deviceName);
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed to add OC_RSRVD_DEVICE_NAME in map");
rdPayload->rdDiscovery->n.deviceName);
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed to add OC_RSRVD_DEVICE_NAME in map");
(char *)rdPayload->rdDiscovery->di.id);
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed to add OC_RSRVD_DEVICE_ID in map");
{
uint64_t value = rdPayload->rdDiscovery->sel;
(char *)rdPayload->rdDiscovery->di.id);
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed to add OC_RSRVD_DEVICE_ID in map");
{
uint64_t value = rdPayload->rdDiscovery->sel;
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed closing discovery map");
}
else if (rdPayload->rdPublish)
{
CborEncoder colArray;
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed closing discovery map");
}
else if (rdPayload->rdPublish)
{
CborEncoder colArray;
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed to create collection array");
OCResourceCollectionPayload *rdPublish = rdPayload->rdPublish;
while (rdPublish)
{
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed to create collection array");
OCResourceCollectionPayload *rdPublish = rdPayload->rdPublish;
while (rdPublish)
{
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed adding setLinks payload");
rdPublish = rdPublish->next;
}
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed adding setLinks payload");
rdPublish = rdPublish->next;
}
- CborError cborEncoderResult = cbor_encoder_create_map(setMap, &tagsMap, CborIndefiniteLength);
+ int64_t cborEncoderResult = CborNoError;
+ cborEncoderResult |= cbor_encoder_create_map(setMap, &tagsMap, CborIndefiniteLength);
- cborEncoderResult = ConditionalAddTextStringToMap(&tagsMap, OC_RSRVD_DEVICE_NAME, tags->n.deviceName);
+ cborEncoderResult |= ConditionalAddTextStringToMap(&tagsMap, OC_RSRVD_DEVICE_NAME, tags->n.deviceName);
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed to add OC_RSRVD_BASE_URI in tags map");
{
uint64_t value = tags->bitmap;
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed to add OC_RSRVD_BASE_URI in tags map");
{
uint64_t value = tags->bitmap;
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed to close container");
exit:
return cborEncoderResult;
}
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed to close container");
exit:
return cborEncoderResult;
}
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed to add OC_RSRVD_MT in Links map");
{
uint64_t value = rtPtr->ins;
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed to add OC_RSRVD_MT in Links map");
{
uint64_t value = rtPtr->ins;
-static CborError ConditionalAddTextStringToMap(CborEncoder* map, const char* key, const char* value)
+static int64_t ConditionalAddTextStringToMap(CborEncoder* map, const char* key, const char* value)
- CborError cborEncoderResult;
- cborEncoderResult = cbor_encode_text_string(map, tag, strlen(tag));
+ int64_t cborEncoderResult = CborNoError;
+ cborEncoderResult |= cbor_encode_text_string(map, tag, strlen(tag));
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed closing string array");
exit:
return cborEncoderResult;
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed closing string array");
exit:
return cborEncoderResult;