/**
* This function creates list of OCEndpointPayload structure,
- * which matches with endpointType from list of CAEndpoint_t.
+ * which matches with the resource's endpointType from list of
+ * CAEndpoint_t.
*
- * @param[in] colResource collection resource for endpointType and resourceProperties
+ * @param[in] resource the resource
* @param[in] devAddr devAddr Structure pointing to the address.
* @param[in] networkInfo array of CAEndpoint_t
* @param[in] infoSize size of array
*
* @return if success return pointer else NULL
*/
-OCEndpointPayload* CreateEndpointPayloadList(const OCResource* colResource,
+OCEndpointPayload* CreateEndpointPayloadList(const OCResource *resource,
const OCDevAddr *devAddr, CAEndpoint_t *networkInfo,
size_t infoSize, OCEndpointPayload **listHead, size_t* epSize, OCEndpointPayload** selfEp);
OIC_LOG_V(DEBUG, TAG, "Network Information size = %d", (int) networkSize);
OCEndpointPayload *listHead = NULL;
- CreateEndpointPayloadList((OCResource*)colResourceHandle,
+ CreateEndpointPayloadList(iterResource,
devAddr, info, networkSize, &listHead, &epSize, NULL);
OICFree(info);
OIC_LOG_V(DEBUG, TAG, "Result of CreateEndpointPayloadList() = %s",
}
}
-OCEndpointPayload* CreateEndpointPayloadList(const OCResource* colResource, const OCDevAddr *devAddr,
+OCEndpointPayload* CreateEndpointPayloadList(const OCResource *resource, const OCDevAddr *devAddr,
CAEndpoint_t *networkInfo, size_t infoSize,
OCEndpointPayload **listHead, size_t* epSize, OCEndpointPayload** selfEp)
{
OCEndpointPayload *headNode = NULL;
OCEndpointPayload *lastNode = NULL;
- VERIFY_PARAM_NON_NULL(TAG, colResource, "Invalid colResource parameter");
+ VERIFY_PARAM_NON_NULL(TAG, resource, "Invalid resource parameter");
VERIFY_PARAM_NON_NULL(TAG, devAddr, "Invalid devAddr parameter");
VERIFY_PARAM_NON_NULL(TAG, networkInfo, "Invalid networkInfo parameter");
VERIFY_PARAM_NON_NULL(TAG, listHead, "Invalid listHead parameter");
if (epSize != NULL) *epSize = 0;
- bool includeSecure = colResource->resourceProperties & OC_SECURE;
- bool includeNonsecure = colResource->resourceProperties & OC_NONSECURE;
+ bool includeSecure = resource->resourceProperties & OC_SECURE;
+ bool includeNonsecure = resource->resourceProperties & OC_NONSECURE;
if ((OC_ADAPTER_IP | OC_ADAPTER_TCP) & (devAddr->adapter))
{
}
bool isSecure = (info->flags & OC_FLAG_SECURE);
- if (((colResource->endpointType) & matchedTps) &&
+ if (((resource->endpointType) & matchedTps) &&
((isSecure && includeSecure) || (!isSecure && includeNonsecure)))
{
// create payload
InitStack(OC_SERVER);
size_t numResources = 0;
- uint8_t parentBitmap = (OC_DISCOVERABLE | OC_OBSERVABLE) | OC_SECURE;
- uint8_t inBitmap[2] = {( OC_DISCOVERABLE | OC_OBSERVABLE) | OC_SECURE,
+ uint8_t parentBitmap = OC_DISCOVERABLE | OC_OBSERVABLE;
+ uint8_t inBitmap[2] = { OC_DISCOVERABLE | OC_OBSERVABLE | OC_SECURE,
OC_DISCOVERABLE | OC_SECURE };
int64_t outBitmap[2] = { 0 };
}
#ifdef __WITH_DTLS__
- ASSERT_GE(coap_scheme_cnt[1], (size_t) 1);
+ EXPECT_EQ(coap_scheme_cnt[0], (size_t) 0);
+ EXPECT_GE(coap_scheme_cnt[1], (size_t) 1);
#ifdef TCP_ADAPTER
- ASSERT_GE(coap_scheme_cnt[3], (size_t) 1);
+ EXPECT_EQ(coap_scheme_cnt[2], (size_t) 0);
+ EXPECT_GE(coap_scheme_cnt[3], (size_t) 1);
#endif
#else
- ASSERT_GE(coap_scheme_cnt[0], (size_t) 1);
+ EXPECT_GE(coap_scheme_cnt[0], (size_t) 1);
+ EXPECT_EQ(coap_scheme_cnt[1], (size_t) 0);
#ifdef TCP_ADAPTER
- ASSERT_GE(coap_scheme_cnt[2], (size_t) 1);
+ EXPECT_GE(coap_scheme_cnt[2], (size_t) 1);
+ EXPECT_EQ(coap_scheme_cnt[3], (size_t) 0);
#endif
#endif