* @param[in] selectedOperationMode selected operation mode
* @return OC_STACK_OK on success
*/
-static OCStackResult PutOwnerCredential(OTMContext_t* otmCtx);
+static OCStackResult PostOwnerCredential(OTMContext_t* otmCtx);
/**
* Function to send ownerShip info.
OTMContext_t* otmCtx = (OTMContext_t*)ctx;
(void)UNUSED;
- if(clientResponse->result == OC_STACK_OK)
+ if(OC_STACK_RESOURCE_CHANGED == clientResponse->result)
{
OIC_LOG(INFO, TAG, "OwnerTransferModeHandler : response result = OC_STACK_OK");
//Send request : GET /oic/sec/pstat
OCStackResult res = OC_STACK_OK;
OTMContext_t* otmCtx = (OTMContext_t*)ctx;
- if(OC_STACK_OK == clientResponse->result)
+ if(OC_STACK_RESOURCE_CHANGED == clientResponse->result)
{
if(otmCtx && otmCtx->selectedDeviceInfo)
{
return OC_STACK_DELETE_TRANSACTION;
}
- //PUT owner credential to new device according to security spec B.
- res = PutOwnerCredential(otmCtx);
+ //POST owner credential to new device according to security spec B.
+ res = PostOwnerCredential(otmCtx);
if(OC_STACK_OK != res)
{
OIC_LOG(ERROR, TAG,
- "OwnerUuidUpdateHandler:Failed to send PUT request for onwer credential");
+ "OwnerUuidUpdateHandler:Failed to send PosT request for onwer credential");
SetResult(otmCtx, res);
return OC_STACK_DELETE_TRANSACTION;
}
OTMContext_t* otmCtx = (OTMContext_t*)ctx;
(void) UNUSED;
- if (OC_STACK_OK == clientResponse->result)
+ if (OC_STACK_RESOURCE_CHANGED == clientResponse->result)
{
OCStackResult res = OC_STACK_ERROR;
OicSecOxm_t selOxm = otmCtx->selectedDeviceInfo->doxm->oxmSel;
OCStackResult res = OC_STACK_OK;
OTMContext_t* otmCtx = (OTMContext_t*)ctx;
- if(OC_STACK_OK == clientResponse->result)
+ if(OC_STACK_RESOURCE_CHANGED == clientResponse->result)
{
if(otmCtx && otmCtx->selectedDeviceInfo)
{
(void)UNUSED;
OCStackResult res = OC_STACK_OK;
- if(OC_STACK_OK == clientResponse->result)
+ if(OC_STACK_RESOURCE_CHANGED == clientResponse->result)
{
if(otmCtx && otmCtx->selectedDeviceInfo)
{
OTMContext_t* otmCtx = (OTMContext_t*) ctx;
(void)UNUSED;
- if (OC_STACK_OK == clientResponse->result)
+ if (OC_STACK_RESOURCE_CHANGED == clientResponse->result)
{
OIC_LOG(INFO, TAG, "Device state is in Ready for Normal Operation.");
OCStackResult res = PDMAddDevice(&otmCtx->selectedDeviceInfo->doxm->deviceID);
return OC_STACK_DELETE_TRANSACTION;
}
-static OCStackResult PutOwnerCredential(OTMContext_t* otmCtx)
+static OCStackResult PostOwnerCredential(OTMContext_t* otmCtx)
{
- OIC_LOG(DEBUG, TAG, "IN PutOwnerCredential");
+ OIC_LOG(DEBUG, TAG, "IN PostOwnerCredential");
if(!otmCtx || !otmCtx->selectedDeviceInfo)
{
deviceInfo->connType,
query, sizeof(query), OIC_RSRC_CRED_URI))
{
- OIC_LOG(ERROR, TAG, "PutOwnerCredential : Failed to generate query");
+ OIC_LOG(ERROR, TAG, "PostOwnerCredential : Failed to generate query");
return OC_STACK_ERROR;
}
OIC_LOG_V(DEBUG, TAG, "Query=%s", query);
newCredential.publicData.len = 0;
#endif
int secureFlag = 0;
- //Send owner credential to new device : PUT /oic/sec/cred [ owner credential ]
+ //Send owner credential to new device : POST /oic/sec/cred [ owner credential ]
if (OC_STACK_OK != CredToCBORPayload(&newCredential, &secPayload->securityData,
&secPayload->payloadSize, secureFlag))
{
cbData.cb = &OwnerCredentialHandler;
cbData.context = (void *)otmCtx;
cbData.cd = NULL;
- OCStackResult res = OCDoResource(NULL, OC_REST_PUT, query,
+ OCStackResult res = OCDoResource(NULL, OC_REST_POST, query,
&deviceInfo->endpoint, (OCPayload*)secPayload,
deviceInfo->connType, OC_HIGH_QOS, &cbData, NULL, 0);
if (res != OC_STACK_OK)
return OC_STACK_NO_RESOURCE;
}
- OIC_LOG(DEBUG, TAG, "OUT PutOwnerCredential");
+ OIC_LOG(DEBUG, TAG, "OUT PostOwnerCredential");
return OC_STACK_OK;
}