X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fstack%2Fsamples%2Flinux%2FSimpleClientServer%2Focserverbasicops.cpp;h=9c4aef5d73654a9ccd2eb66086d8226deb00a9f6;hb=390866079e285d2c74918432c0d597d5da52f8a0;hp=2c3cfdb8a55fceacb40e532d2d2342add66a16b8;hpb=3e9402ad71cb3e93266a77796f44d17bab9853fd;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/stack/samples/linux/SimpleClientServer/ocserverbasicops.cpp b/resource/csdk/stack/samples/linux/SimpleClientServer/ocserverbasicops.cpp index 2c3cfdb..9c4aef5 100644 --- a/resource/csdk/stack/samples/linux/SimpleClientServer/ocserverbasicops.cpp +++ b/resource/csdk/stack/samples/linux/SimpleClientServer/ocserverbasicops.cpp @@ -49,7 +49,7 @@ OCRepPayload* getPayload(const char* uri, int64_t power, bool state) OCRepPayload* payload = OCRepPayloadCreate(); if(!payload) { - OC_LOG(ERROR, TAG, PCF("Failed to allocate Payload")); + OIC_LOG(ERROR, TAG, PCF("Failed to allocate Payload")); return nullptr; } @@ -65,7 +65,7 @@ OCRepPayload* constructResponse (OCEntityHandlerRequest *ehRequest) { if(ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION) { - OC_LOG(ERROR, TAG, PCF("Incoming payload not a representation")); + OIC_LOG(ERROR, TAG, PCF("Incoming payload not a representation")); return nullptr; } @@ -172,7 +172,7 @@ OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest, if (0 == createLEDResource (newLedUri, &gLedInstance[gCurrLedInstance], false, 0)) { - OC_LOG (INFO, TAG, "Created new LED instance"); + OIC_LOG (INFO, TAG, "Created new LED instance"); gLedInstance[gCurrLedInstance].state = 0; gLedInstance[gCurrLedInstance].power = 0; gCurrLedInstance++; @@ -211,7 +211,7 @@ OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest, } else { - OC_LOG_V (INFO, TAG, "Payload was NULL"); + OIC_LOG_V (INFO, TAG, "Payload was NULL"); ehResult = OC_EH_ERROR; } @@ -223,7 +223,7 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag, OCEntityHandlerRequest *entityHandlerRequest, void* /*callbackParam*/) { - OC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag); + OIC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag); OCEntityHandlerResult ehResult = OC_EH_ERROR; OCEntityHandlerResponse response = { 0, 0, OC_EH_ERROR, 0, 0, { },{ 0 }, false }; @@ -231,7 +231,7 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag, // Validate pointer if (!entityHandlerRequest) { - OC_LOG (ERROR, TAG, "Invalid request pointer"); + OIC_LOG (ERROR, TAG, "Invalid request pointer"); return OC_EH_ERROR; } @@ -239,27 +239,27 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag, if (flag & OC_REQUEST_FLAG) { - OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG"); + OIC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG"); if (entityHandlerRequest) { if (OC_REST_GET == entityHandlerRequest->method) { - OC_LOG (INFO, TAG, "Received OC_REST_GET from client"); + OIC_LOG (INFO, TAG, "Received OC_REST_GET from client"); ehResult = ProcessGetRequest (entityHandlerRequest, &payload); } else if (OC_REST_PUT == entityHandlerRequest->method) { - OC_LOG (INFO, TAG, "Received OC_REST_PUT from client"); + OIC_LOG (INFO, TAG, "Received OC_REST_PUT from client"); ehResult = ProcessPutRequest (entityHandlerRequest, &payload); } else if (OC_REST_POST == entityHandlerRequest->method) { - OC_LOG (INFO, TAG, "Received OC_REST_POST from client"); + OIC_LOG (INFO, TAG, "Received OC_REST_POST from client"); ehResult = ProcessPostRequest (entityHandlerRequest, &response, &payload); } else { - OC_LOG_V (INFO, TAG, "Received unsupported method %d from client", + OIC_LOG_V (INFO, TAG, "Received unsupported method %d from client", entityHandlerRequest->method); } @@ -279,7 +279,7 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag, // Send the response if (OCDoResponse(&response) != OC_STACK_OK) { - OC_LOG(ERROR, TAG, "Error sending response"); + OIC_LOG(ERROR, TAG, "Error sending response"); ehResult = OC_EH_ERROR; } } @@ -301,10 +301,10 @@ void handleSigInt(int signum) int main(int /*argc*/, char* /*argv*/[]) { - OC_LOG(DEBUG, TAG, "OCServer is starting..."); + OIC_LOG(DEBUG, TAG, "OCServer is starting..."); if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK) { - OC_LOG(ERROR, TAG, "OCStack init error"); + OIC_LOG(ERROR, TAG, "OCStack init error"); return 0; } @@ -314,24 +314,24 @@ int main(int /*argc*/, char* /*argv*/[]) createLEDResource(gResourceUri, &LED, false, 0); // Break from loop with Ctrl-C - OC_LOG(INFO, TAG, "Entering ocserver main loop..."); + OIC_LOG(INFO, TAG, "Entering ocserver main loop..."); signal(SIGINT, handleSigInt); while (!gQuitFlag) { if (OCProcess() != OC_STACK_OK) { - OC_LOG(ERROR, TAG, "OCStack process error"); + OIC_LOG(ERROR, TAG, "OCStack process error"); return 0; } sleep(2); } - OC_LOG(INFO, TAG, "Exiting ocserver main loop..."); + OIC_LOG(INFO, TAG, "Exiting ocserver main loop..."); if (OCStop() != OC_STACK_OK) { - OC_LOG(ERROR, TAG, "OCStack process error"); + OIC_LOG(ERROR, TAG, "OCStack process error"); } return 0; @@ -341,7 +341,7 @@ int createLEDResource (char *uri, LEDResource *ledResource, bool resourceState, { if (!uri) { - OC_LOG(ERROR, TAG, "Resource URI cannot be NULL"); + OIC_LOG(ERROR, TAG, "Resource URI cannot be NULL"); return -1; } @@ -354,7 +354,7 @@ int createLEDResource (char *uri, LEDResource *ledResource, bool resourceState, OCEntityHandlerCb, NULL, OC_DISCOVERABLE|OC_OBSERVABLE); - OC_LOG_V(INFO, TAG, "Created LED resource with result: %s", getResult(res)); + OIC_LOG_V(INFO, TAG, "Created LED resource with result: %s", getResult(res)); return 0; }