From: hyuna0213.jo Date: Tue, 29 Nov 2016 07:49:39 +0000 (+0900) Subject: [IOT-1612] Fix OCRDPublishWithDeviceId() to publish with a specific id X-Git-Tag: 1.3.0~1049^2~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab04aa34153a83016a86caec24337dfc7f7894d2;p=platform%2Fupstream%2Fiotivity.git [IOT-1612] Fix OCRDPublishWithDeviceId() to publish with a specific id Fixed OCRDPublishWithDeviceId() to publish resource with a specific id bug: https://jira.iotivity.org/browse/IOT-1612 Change-Id: Id0242a1c4a7040c928db179a840abf1c7f85400e Signed-off-by: hyuna0213.jo Reviewed-on: https://gerrit.iotivity.org/gerrit/14893 Reviewed-by: Jaehong Jo Reviewed-by: Phil Coval Tested-by: jenkins-iotivity Reviewed-by: Habib Virji Reviewed-by: Ziran Sun (cherry picked from commit 6dbd734ef4ca54d49ae474f8e7291a54e70cbcbf) Reviewed-on: https://gerrit.iotivity.org/gerrit/15149 --- diff --git a/resource/csdk/resource-directory/src/rd_client.c b/resource/csdk/resource-directory/src/rd_client.c index 5bf0cb2..57ce40c 100644 --- a/resource/csdk/resource-directory/src/rd_client.c +++ b/resource/csdk/resource-directory/src/rd_client.c @@ -121,11 +121,7 @@ OCStackResult OCRDPublishWithDeviceId(const char *host, const unsigned char *id, return OC_STACK_NO_MEMORY; } - const char *deviceId = OCGetServerInstanceIDString(); - if (deviceId) - { - OCRepPayloadSetPropString(rdPayload, OC_RSRVD_DEVICE_ID, deviceId); - } + OCRepPayloadSetPropString(rdPayload, OC_RSRVD_DEVICE_ID, (const char *) id); OCRepPayloadSetPropInt(rdPayload, OC_RSRVD_DEVICE_TTL, OIC_RD_PUBLISH_TTL); OCRepPayload **linkArr = OICCalloc(nPubResHandles, sizeof(OCRepPayload *));