summaryrefslogtreecommitdiff
path: root/resource/csdk/resource-directory
diff options
context:
space:
mode:
authorHongkuk, Son <hongkuk.son@samsung.com>2017-09-29 16:24:47 +0900
committerHongkuk, Son <hongkuk.son@samsung.com>2017-10-10 10:49:42 +0900
commit3c093548382bb2542c87a67e6e5fa32552c29cb3 (patch)
treeff077bd6c562f4fd41ed2fa54c627323e359f9fa /resource/csdk/resource-directory
parentedcfc3d2329da7b914771c0dcff5f42c9b74fd93 (diff)
downloadiotivity-3c093548382bb2542c87a67e6e5fa32552c29cb3.tar.gz
iotivity-3c093548382bb2542c87a67e6e5fa32552c29cb3.tar.bz2
iotivity-3c093548382bb2542c87a67e6e5fa32552c29cb3.zip
Signed-off-by: Hongkuk, Son <hongkuk.son@samsung.com> Change-Id: I5096b7e6faeadd98d5ee48279b24cb9fbdb1f24f
Diffstat (limited to 'resource/csdk/resource-directory')
-rwxr-xr-xresource/csdk/resource-directory/SConscript6
-rw-r--r--resource/csdk/resource-directory/include/rd_client.h127
-rw-r--r--resource/csdk/resource-directory/samples/rd_publishingClient.cpp4
-rw-r--r--resource/csdk/resource-directory/src/RDClient.cpp4
-rw-r--r--resource/csdk/resource-directory/src/rd_client.c55
-rw-r--r--resource/csdk/resource-directory/src/rd_server.c2
-rw-r--r--resource/csdk/resource-directory/unittests/rdtests.cpp18
7 files changed, 138 insertions, 78 deletions
diff --git a/resource/csdk/resource-directory/SConscript b/resource/csdk/resource-directory/SConscript
index 4c30d4f37..24a0aa083 100755
--- a/resource/csdk/resource-directory/SConscript
+++ b/resource/csdk/resource-directory/SConscript
@@ -83,15 +83,15 @@ if 'SERVER' in rd_mode:
RD_SRC_DIR + 'internal/rd_database.c',
RD_SRC_DIR + 'rd_server.c',
]
- if target_os not in ['linux', 'tizen'] :
+ if target_os not in ['linux', 'tizen', 'tizenrt'] :
rd_src += [ '../../../extlibs/sqlite3/sqlite3.c' ]
if 'CLIENT' in rd_mode:
rd_src += [RD_SRC_DIR + 'rd_client.c',]
- if target_os not in ['arduino','darwin','ios', 'windows', 'winrt']:
+ if target_os not in ['arduino','darwin','ios', 'windows', 'winrt','tizenrt']:
rd_src += [ RD_SRC_DIR + 'RDClient.cpp',]
-if target_os not in ['arduino', 'darwin', 'ios', 'windows', 'winrt']:
+if target_os not in ['arduino', 'darwin', 'ios', 'windows', 'winrt', 'tizenrt']:
rdsdk_shared = rd_env.SharedLibrary('resource_directory', rd_src)
rdsdk_static = rd_env.StaticLibrary('resource_directory', rd_src)
rdsdk = Flatten([rdsdk_static, rdsdk_shared])
diff --git a/resource/csdk/resource-directory/include/rd_client.h b/resource/csdk/resource-directory/include/rd_client.h
index 2b4a582ee..7f97ff468 100644
--- a/resource/csdk/resource-directory/include/rd_client.h
+++ b/resource/csdk/resource-directory/include/rd_client.h
@@ -36,54 +36,77 @@ extern "C" {
#define DEFAULT_MESSAGE_TYPE "application/json"
+/** Platform Model Number.*/
+#define OC_DATA_MODEL_NUMBER "x.model"
+
/**
* Discover Local RD across the network.
*
- * @param connectivityType Type of connectivity indicating the interface.
- * @param cbBiasFactor Asynchronous callback function that is invoked by the stack when
- * response is received. The callback is generated for each response
- * received.
- * @param qos Quality of service.
+ * @param handle To refer to the request sent out on behalf of
+ * calling this API. This handle can be used to cancel this operation
+ * via the OCCancel API.
+ * @note: This reference is handled internally, and should not be free'd by
+ * the consumer. A NULL handle is permitted in the event where the caller
+ * has no use for the return value.
+ * @param connectivityType Type of connectivity indicating the interface.
+ * @param cbBiasFactor Asynchronous callback function that is invoked by the stack when
+ * response is received. The callback is generated for each response
+ * received.
+ * @param qos Quality of service.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCRDDiscover(OCConnectivityType connectivityType, OCCallbackData *cbBiasFactor,
- OCQualityOfService qos);
+OCStackResult OCRDDiscover(OCDoHandle *handle, OCConnectivityType connectivityType,
+ OCCallbackData *cbBiasFactor, OCQualityOfService qos);
/**
* Publish RD resource to Resource Directory.
*
- * @param host The address of the RD.
- * @param connectivityType Type of connectivity indicating the interface.
- * @param resourceHandles This is the resource handle which we need to register to RD.
- * @param nHandles The counts of resource handle.
- * @param cbData Asynchronous callback function that is invoked by the stack when
- * response is received. The callback is generated for each response
- * received.
- * @param qos Quality of service.
+ * @param handle To refer to the request sent out on behalf of
+ * calling this API. This handle can be used to cancel this operation
+ * via the OCCancel API.
+ * @note: This reference is handled internally, and should not be free'd by
+ * the consumer. A NULL handle is permitted in the event where the caller
+ * has no use for the return value.
+ * @param host The address of the RD.
+ * @param connectivityType Type of connectivity indicating the interface.
+ * @param resourceHandles This is the resource handle which we need to register to RD.
+ * @param nHandles The counts of resource handle.
+ * @param cbData Asynchronous callback function that is invoked by the stack when
+ * response is received. The callback is generated for each response
+ * received.
+ * @param qos Quality of service.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCRDPublish(const char *host, OCConnectivityType connectivityType,
+OCStackResult OCRDPublish(OCDoHandle *handle, const char *host,
+ OCConnectivityType connectivityType,
OCResourceHandle *resourceHandles, uint8_t nHandles,
OCCallbackData *cbData, OCQualityOfService qos);
/**
* Publish RD resource to Resource Directory with a specific id.
*
- * @param host The address of the RD.
- * @param id An unique identifier of publishing device.
- * @param connectivityType Type of connectivity indicating the interface.
- * @param resourceHandles This is the resource handle which we need to register to RD.
- * @param nHandles The counts of resource handle.
- * @param cbData Asynchronous callback function that is invoked by the stack when
- * response is received. The callback is generated for each response
- * received.
- * @param qos Quality of service.
+ * @param handle To refer to the request sent out on behalf of
+ * calling this API. This handle can be used to cancel this operation
+ * via the OCCancel API.
+ * @note: This reference is handled internally, and should not be free'd by
+ * the consumer. A NULL handle is permitted in the event where the caller
+ * has no use for the return value.
+ * @param host The address of the RD.
+ * @param id An unique identifier of publishing device.
+ * @param connectivityType Type of connectivity indicating the interface.
+ * @param resourceHandles This is the resource handle which we need to register to RD.
+ * @param nHandles The counts of resource handle.
+ * @param cbData Asynchronous callback function that is invoked by the stack when
+ * response is received. The callback is generated for each response
+ * received.
+ * @param qos Quality of service.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCRDPublishWithDeviceId(const char *host, const unsigned char *id,
+OCStackResult OCRDPublishWithDeviceId(OCDoHandle *handle, const char *host,
+ const unsigned char *id,
OCConnectivityType connectivityType,
OCResourceHandle *resourceHandles, uint8_t nHandles,
OCCallbackData *cbData, OCQualityOfService qos);
@@ -91,37 +114,51 @@ OCStackResult OCRDPublishWithDeviceId(const char *host, const unsigned char *id,
/**
* Delete RD resource from Resource Directory.
*
- * @param host The address of the RD.
- * @param connectivityType Type of connectivity indicating the interface.
- * @param resourceHandles This is the resource handle which we need to delete to RD.
- * @param nHandles The counts of resource handle.
- * @param cbData Asynchronous callback function that is invoked by the stack when
- * response is received. The callback is generated for each response
- * received.
- * @param qos Quality of service.
+ * @param handle To refer to the request sent out on behalf of
+ * calling this API. This handle can be used to cancel this operation
+ * via the OCCancel API.
+ * @note: This reference is handled internally, and should not be free'd by
+ * the consumer. A NULL handle is permitted in the event where the caller
+ * has no use for the return value.
+ * @param host The address of the RD.
+ * @param connectivityType Type of connectivity indicating the interface.
+ * @param resourceHandles This is the resource handle which we need to delete to RD.
+ * @param nHandles The counts of resource handle.
+ * @param cbData Asynchronous callback function that is invoked by the stack when
+ * response is received. The callback is generated for each response
+ * received.
+ * @param qos Quality of service.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCRDDelete(const char *host, OCConnectivityType connectivityType,
+OCStackResult OCRDDelete(OCDoHandle *handle, const char *host,
+ OCConnectivityType connectivityType,
OCResourceHandle *resourceHandles, uint8_t nHandles,
OCCallbackData *cbData, OCQualityOfService qos);
/**
* Delete RD resource from Resource Directory.
*
- * @param host The address of the RD.
- * @param id An unique identifier of publishing device.
- * @param connectivityType Type of connectivity indicating the interface.
- * @param resourceHandles This is the resource handle which we need to delete to RD.
- * @param nHandles The counts of resource handle.
- * @param cbData Asynchronous callback function that is invoked by the stack when
- * response is received. The callback is generated for each response
- * received.
- * @param qos Quality of service.
+ * @param handle To refer to the request sent out on behalf of
+ * calling this API. This handle can be used to cancel this operation
+ * via the OCCancel API.
+ * @note: This reference is handled internally, and should not be free'd by
+ * the consumer. A NULL handle is permitted in the event where the caller
+ * has no use for the return value.
+ * @param host The address of the RD.
+ * @param id An unique identifier of publishing device.
+ * @param connectivityType Type of connectivity indicating the interface.
+ * @param resourceHandles This is the resource handle which we need to delete to RD.
+ * @param nHandles The counts of resource handle.
+ * @param cbData Asynchronous callback function that is invoked by the stack when
+ * response is received. The callback is generated for each response
+ * received.
+ * @param qos Quality of service.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCRDDeleteWithDeviceId(const char *host, const unsigned char *id,
+OCStackResult OCRDDeleteWithDeviceId(OCDoHandle *handle, const char *host,
+ const unsigned char *id,
OCConnectivityType connectivityType,
OCResourceHandle *resourceHandles, uint8_t nHandles,
OCCallbackData *cbData, OCQualityOfService qos);
diff --git a/resource/csdk/resource-directory/samples/rd_publishingClient.cpp b/resource/csdk/resource-directory/samples/rd_publishingClient.cpp
index df9d41891..851bcd582 100644
--- a/resource/csdk/resource-directory/samples/rd_publishingClient.cpp
+++ b/resource/csdk/resource-directory/samples/rd_publishingClient.cpp
@@ -143,7 +143,7 @@ int main()
cbData.cb = &handleDiscoveryCB;;
cbData.cd = NULL;
cbData.context = (void*) DEFAULT_CONTEXT_VALUE;
- OCRDDiscover(CT_ADAPTER_IP, &cbData, OC_LOW_QOS);
+ OCRDDiscover(nullptr, CT_ADAPTER_IP, &cbData, OC_LOW_QOS);
break;
}
case 2:
@@ -153,7 +153,7 @@ int main()
cbData.cd = NULL;
cbData.context = (void*) DEFAULT_CONTEXT_VALUE;
std::string address = rdAddress.str();
- OCRDPublish(address.c_str(), CT_ADAPTER_IP, handles,
+ OCRDPublish(nullptr, address.c_str(), CT_ADAPTER_IP, handles,
2, &cbData, OC_LOW_QOS);
break;
}
diff --git a/resource/csdk/resource-directory/src/RDClient.cpp b/resource/csdk/resource-directory/src/RDClient.cpp
index 115c45159..36140bdeb 100644
--- a/resource/csdk/resource-directory/src/RDClient.cpp
+++ b/resource/csdk/resource-directory/src/RDClient.cpp
@@ -144,7 +144,7 @@ OCStackResult RDClient::publishResourceToRD(const std::string& host,
if (cLock)
{
std::lock_guard<std::recursive_mutex> lock(*cLock);
- result = OCRDPublish(host.c_str(), connectivityType, &resourceHandles[0],
+ result = OCRDPublish(nullptr, host.c_str(), connectivityType, &resourceHandles[0],
resourceHandles.size(), &cbdata, static_cast<OCQualityOfService>(qos));
}
@@ -204,7 +204,7 @@ OCStackResult RDClient::deleteResourceFromRD(const std::string& host,
if (cLock)
{
std::lock_guard<std::recursive_mutex> lock(*cLock);
- result = OCRDDelete(host.c_str(), connectivityType, &resourceHandles[0],
+ result = OCRDDelete(nullptr, host.c_str(), connectivityType, &resourceHandles[0],
resourceHandles.size(), &cbdata, static_cast<OCQualityOfService>(qos));
}
diff --git a/resource/csdk/resource-directory/src/rd_client.c b/resource/csdk/resource-directory/src/rd_client.c
index 2206a7dd5..fd65aeb62 100644
--- a/resource/csdk/resource-directory/src/rd_client.c
+++ b/resource/csdk/resource-directory/src/rd_client.c
@@ -33,8 +33,8 @@
#ifdef RD_CLIENT
-OCStackResult OCRDDiscover(OCConnectivityType connectivityType, OCCallbackData *cbBiasFactor,
- OCQualityOfService qos)
+OCStackResult OCRDDiscover(OCDoHandle *handle, OCConnectivityType connectivityType,
+ OCCallbackData *cbBiasFactor, OCQualityOfService qos)
{
if (!cbBiasFactor || !cbBiasFactor->cb)
{
@@ -47,11 +47,12 @@ OCStackResult OCRDDiscover(OCConnectivityType connectivityType, OCCallbackData *
snprintf(queryUri, MAX_URI_LENGTH, "coap://%s%s", OC_MULTICAST_PREFIX, OC_RSRVD_RD_URI);
OIC_LOG_V(DEBUG, TAG, "Querying RD: %s\n", queryUri);
- return OCDoResource(NULL, OC_REST_DISCOVER, queryUri, NULL, NULL, connectivityType, qos,
+ return OCDoResource(handle, OC_REST_DISCOVER, queryUri, NULL, NULL, connectivityType, qos,
cbBiasFactor, NULL, 0);
}
-OCStackResult OCRDPublish(const char *host, OCConnectivityType connectivityType,
+OCStackResult OCRDPublish(OCDoHandle *handle, const char *host,
+ OCConnectivityType connectivityType,
OCResourceHandle *resourceHandles, uint8_t nHandles,
OCCallbackData *cbData, OCQualityOfService qos)
{
@@ -69,11 +70,12 @@ OCStackResult OCRDPublish(const char *host, OCConnectivityType connectivityType,
// Get Device ID from stack.
const unsigned char *id = (const unsigned char *) OCGetServerInstanceIDString();
- return OCRDPublishWithDeviceId(host, id, connectivityType, resourceHandles, nHandles,
- cbData, qos);
+ return OCRDPublishWithDeviceId(handle, host, id, connectivityType, resourceHandles,
+ nHandles, cbData, qos);
}
-OCStackResult OCRDPublishWithDeviceId(const char *host, const unsigned char *id,
+OCStackResult OCRDPublishWithDeviceId(OCDoHandle *handle, const char *host,
+ const unsigned char *id,
OCConnectivityType connectivityType,
OCResourceHandle *resourceHandles, uint8_t nHandles,
OCCallbackData *cbData, OCQualityOfService qos)
@@ -121,7 +123,24 @@ OCStackResult OCRDPublishWithDeviceId(const char *host, const unsigned char *id,
return OC_STACK_NO_MEMORY;
}
- OCRepPayloadSetPropString(rdPayload, OC_RSRVD_DEVICE_ID, id);
+ OCRepPayloadSetPropString(rdPayload, OC_RSRVD_DEVICE_ID, (const char *) id);
+
+ char *deviceName = NULL;
+ OCGetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DEVICE_NAME, (void **) &deviceName);
+ if (deviceName)
+ {
+ OCRepPayloadSetPropString(rdPayload, OC_RSRVD_DEVICE_NAME, deviceName);
+ OICFree(deviceName);
+ }
+
+ char *platformModelName = NULL;
+ OCGetPropertyValue(PAYLOAD_TYPE_PLATFORM, OC_RSRVD_MODEL_NUM, (void **) &platformModelName);
+ if (platformModelName)
+ {
+ OCRepPayloadSetPropString(rdPayload, OC_DATA_MODEL_NUMBER, platformModelName);
+ OICFree(platformModelName);
+ }
+
OCRepPayloadSetPropInt(rdPayload, OC_RSRVD_DEVICE_TTL, OIC_RD_PUBLISH_TTL);
OCRepPayload **linkArr = OICCalloc(nPubResHandles, sizeof(OCRepPayload *));
@@ -173,7 +192,7 @@ OCStackResult OCRDPublishWithDeviceId(const char *host, const unsigned char *id,
OCRepPayloadSetStringArrayAsOwner(link, OC_RSRVD_INTERFACE, itf, ifDim);
}
- uint8_t ins = 0;
+ int64_t ins = 0;
if (OC_STACK_OK == OCGetResourceIns(handle, &ins))
{
OCRepPayloadSetPropInt(link, OC_RSRVD_INS, ins);
@@ -216,11 +235,12 @@ OCStackResult OCRDPublishWithDeviceId(const char *host, const unsigned char *id,
}
OICFree(linkArr);
- return OCDoResource(NULL, OC_REST_POST, targetUri, NULL, (OCPayload *)rdPayload,
+ return OCDoResource(handle, OC_REST_POST, targetUri, NULL, (OCPayload *)rdPayload,
connectivityType, qos, cbData, NULL, 0);
}
-OCStackResult OCRDDelete(const char *host, OCConnectivityType connectivityType,
+OCStackResult OCRDDelete(OCDoHandle *handle, const char *host,
+ OCConnectivityType connectivityType,
OCResourceHandle *resourceHandles, uint8_t nHandles,
OCCallbackData *cbData, OCQualityOfService qos)
{
@@ -237,11 +257,12 @@ OCStackResult OCRDDelete(const char *host, OCConnectivityType connectivityType,
const unsigned char *id = (const unsigned char *) OCGetServerInstanceIDString();
- return OCRDDeleteWithDeviceId(host, id, connectivityType, resourceHandles, nHandles,
- cbData, qos);
+ return OCRDDeleteWithDeviceId(handle, host, id, connectivityType, resourceHandles,
+ nHandles, cbData, qos);
}
-OCStackResult OCRDDeleteWithDeviceId(const char *host, const unsigned char *id,
+OCStackResult OCRDDeleteWithDeviceId(OCDoHandle *handle, const char *host,
+ const unsigned char *id,
OCConnectivityType connectivityType,
OCResourceHandle *resourceHandles, uint8_t nHandles,
OCCallbackData *cbData, OCQualityOfService qos)
@@ -262,16 +283,16 @@ OCStackResult OCRDDeleteWithDeviceId(const char *host, const unsigned char *id,
for (uint8_t j = 0; j < nHandles; j++)
{
OCResource *handle = (OCResource *) resourceHandles[j];
- uint8_t ins = 0;
+ int64_t ins = 0;
OCGetResourceIns(handle, &ins);
- len += snprintf(queryParam + len, MAX_URI_LENGTH, "&ins=%d", ins);
+ len += snprintf(queryParam + len, MAX_URI_LENGTH, "&ins=%" PRId64, ins);
OIC_LOG_V(DEBUG, TAG, "queryParam [%s]", queryParam);
}
OICStrcatPartial(targetUri, sizeof(targetUri), queryParam, strlen(queryParam));
OIC_LOG_V(DEBUG, TAG, "Target URI: %s", targetUri);
- return OCDoResource(NULL, OC_REST_DELETE, targetUri, NULL, NULL, connectivityType,
+ return OCDoResource(handle, OC_REST_DELETE, targetUri, NULL, NULL, connectivityType,
qos, cbData, NULL, 0);
}
diff --git a/resource/csdk/resource-directory/src/rd_server.c b/resource/csdk/resource-directory/src/rd_server.c
index fb7a11c20..799ac6efb 100644
--- a/resource/csdk/resource-directory/src/rd_server.c
+++ b/resource/csdk/resource-directory/src/rd_server.c
@@ -177,7 +177,9 @@ static OCEntityHandlerResult rdEntityHandler(OCEntityHandlerFlag flag,
case OC_REST_PUT:
case OC_REST_OBSERVE:
case OC_REST_OBSERVE_ALL:
+#ifdef WITH_PRESENCE
case OC_REST_PRESENCE:
+#endif
case OC_REST_NOMETHOD:
break;
}
diff --git a/resource/csdk/resource-directory/unittests/rdtests.cpp b/resource/csdk/resource-directory/unittests/rdtests.cpp
index 50909ade4..f8f49ef80 100644
--- a/resource/csdk/resource-directory/unittests/rdtests.cpp
+++ b/resource/csdk/resource-directory/unittests/rdtests.cpp
@@ -134,7 +134,7 @@ TEST_F(RDTests, CreateRDResource)
cbData.cb = &handleDiscoveryCB;;
cbData.cd = NULL;
cbData.context = (void*) DEFAULT_CONTEXT_VALUE;
- EXPECT_EQ(OC_STACK_OK, OCRDDiscover(CT_ADAPTER_IP, &cbData, OC_LOW_QOS));
+ EXPECT_EQ(OC_STACK_OK, OCRDDiscover(NULL, CT_ADAPTER_IP, &cbData, OC_LOW_QOS));
EXPECT_EQ(OC_STACK_OK, OCRDStop());
}
@@ -195,13 +195,13 @@ TEST_F(RDTests, CreateRDResource)
TEST_F(RDTests, RDPublishResourceNullAddr)
{
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
- EXPECT_EQ(OC_STACK_INVALID_IP, OCRDPublish(0, CT_ADAPTER_IP, nullptr, 0, 0, OC_LOW_QOS));
+ EXPECT_EQ(OC_STACK_INVALID_IP, OCRDPublish(NULL, 0, CT_ADAPTER_IP, nullptr, 0, 0, OC_LOW_QOS));
}
TEST_F(RDTests, RDPublishResourceNullCB)
{
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
- EXPECT_EQ(OC_STACK_INVALID_CALLBACK, OCRDPublish("127.0.0.1", CT_ADAPTER_IP, nullptr,
+ EXPECT_EQ(OC_STACK_INVALID_CALLBACK, OCRDPublish(NULL, "127.0.0.1", CT_ADAPTER_IP, nullptr,
0, 0, OC_LOW_QOS));
}
@@ -220,7 +220,7 @@ TEST_F(RDTests, RDPublishResource)
"oic.if.baseline", "/a/light", rdEntityHandler,
NULL, (OC_DISCOVERABLE | OC_OBSERVABLE)));
- EXPECT_EQ(OC_STACK_OK, OCRDPublish("127.0.0.1", CT_ADAPTER_IP, &handle,
+ EXPECT_EQ(OC_STACK_OK, OCRDPublish(NULL, "127.0.0.1", CT_ADAPTER_IP, &handle,
1, &cbData, OC_LOW_QOS));
}
@@ -242,20 +242,20 @@ TEST_F(RDTests, RDPublishMultipleResources)
"oic.if.baseline", "/a/light2", rdEntityHandler,
NULL, (OC_DISCOVERABLE | OC_OBSERVABLE)));
- EXPECT_EQ(OC_STACK_OK, OCRDPublish("127.0.0.1", CT_ADAPTER_IP, handles,
+ EXPECT_EQ(OC_STACK_OK, OCRDPublish(NULL, "127.0.0.1", CT_ADAPTER_IP, handles,
2, &cbData, OC_LOW_QOS));
}
TEST_F(RDTests, RDDeleteResourceNullAddr)
{
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
- EXPECT_EQ(OC_STACK_INVALID_IP, OCRDDelete(0, CT_ADAPTER_IP, nullptr, 0, 0, OC_LOW_QOS));
+ EXPECT_EQ(OC_STACK_INVALID_IP, OCRDDelete(NULL, 0, CT_ADAPTER_IP, nullptr, 0, 0, OC_LOW_QOS));
}
TEST_F(RDTests, RDDeleteResourceNullCB)
{
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
- EXPECT_EQ(OC_STACK_INVALID_CALLBACK, OCRDDelete("127.0.0.1", CT_ADAPTER_IP, nullptr,
+ EXPECT_EQ(OC_STACK_INVALID_CALLBACK, OCRDDelete(NULL, "127.0.0.1", CT_ADAPTER_IP, nullptr,
0, 0, OC_LOW_QOS));
}
@@ -268,7 +268,7 @@ TEST_F(RDTests, RDDeleteAllResource)
cbData.cd = NULL;
cbData.context = (void*) DEFAULT_CONTEXT_VALUE;
- EXPECT_EQ(OC_STACK_OK, OCRDDelete("127.0.0.1", CT_ADAPTER_IP, nullptr, 0, &cbData,
+ EXPECT_EQ(OC_STACK_OK, OCRDDelete(NULL, "127.0.0.1", CT_ADAPTER_IP, nullptr, 0, &cbData,
OC_LOW_QOS));
}
@@ -287,7 +287,7 @@ TEST_F(RDTests, RDDeleteSpecificResource)
"oic.if.baseline", "/a/light", rdEntityHandler,
NULL, OC_DISCOVERABLE | OC_OBSERVABLE));
- EXPECT_EQ(OC_STACK_OK, OCRDDelete("127.0.0.1", CT_ADAPTER_IP, &handle,
+ EXPECT_EQ(OC_STACK_OK, OCRDDelete(NULL, "127.0.0.1", CT_ADAPTER_IP, &handle,
1, &cbData, OC_LOW_QOS));
}
#endif