Commit 45d985aa authored by jihwan.seo's avatar jihwan.seo Committed by Uze Choi

replaced OC_LOG with OIC_LOG in service layer

Change-Id: I892b23e6087368addb63a418fac7f95794aae04d
Signed-off-by: default avatarjihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/4835Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarMadan Lanka <lanka.madan@samsung.com>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
parent 15a7711c
......@@ -136,13 +136,13 @@ void EventCallbackInApp(ESResult esResult, EnrolleeState enrolleeState)
{
if(g_OnBoardingSucceeded)
{
OC_LOG_V(ERROR, TAG, "Failure in Provisioning. \
OIC_LOG_V(ERROR, TAG, "Failure in Provisioning. \
Current Enrollee State: %d",enrolleeState);
g_OnBoardingSucceeded = false;
}
else if(g_ProvisioningSucceeded)
{
OC_LOG_V(ERROR, TAG, "Failure in connect to target network. \
OIC_LOG_V(ERROR, TAG, "Failure in connect to target network. \
Current Enrollee State: %d",enrolleeState);
g_ProvisioningSucceeded = false;
}
......@@ -163,47 +163,47 @@ void PrintArduinoMemoryStats()
extern char *__brkval;
//address of tmp gives us the current stack boundry
int tmp;
OC_LOG_V(INFO, TAG, "Stack: %u Heap: %u", (unsigned int)&tmp, (unsigned int)__brkval);
OC_LOG_V(INFO, TAG, "Unallocated Memory between heap and stack: %u",
OIC_LOG_V(INFO, TAG, "Stack: %u Heap: %u", (unsigned int)&tmp, (unsigned int)__brkval);
OIC_LOG_V(INFO, TAG, "Unallocated Memory between heap and stack: %u",
((unsigned int)&tmp - (unsigned int)__brkval));
#endif
}
void StartEasySetup()
{
OC_LOG(DEBUG, TAG, "OCServer is starting...");
OIC_LOG(DEBUG, TAG, "OCServer is starting...");
if(InitEasySetup(CT_ADAPTER_IP, ssid, passwd, EventCallbackInApp) == ES_ERROR)
{
OC_LOG(ERROR, TAG, "OnBoarding Failed");
OIC_LOG(ERROR, TAG, "OnBoarding Failed");
return;
}
g_isInitialized = true;
OC_LOG_V(ERROR, TAG, "OnBoarding succeeded. Successfully connected to ssid : %s",ssid);
OIC_LOG_V(ERROR, TAG, "OnBoarding succeeded. Successfully connected to ssid : %s",ssid);
}
void StartProvisioning()
{
OC_LOG(DEBUG, TAG, "StartProvisioning is invoked...");
OIC_LOG(DEBUG, TAG, "StartProvisioning is invoked...");
if(InitProvisioning()== ES_ERROR)
{
OC_LOG(ERROR, TAG, "Init Provisioning Failed");
OIC_LOG(ERROR, TAG, "Init Provisioning Failed");
return;
}
}
void StopEasySetup()
{
OC_LOG(DEBUG, TAG, "Stopping EasySetup is invoked...");
OIC_LOG(DEBUG, TAG, "Stopping EasySetup is invoked...");
g_isInitialized = false;
if(TerminateEasySetup()== ES_ERROR)
{
OC_LOG(ERROR, TAG, "TerminateEasySetup Failed");
OIC_LOG(ERROR, TAG, "TerminateEasySetup Failed");
return;
}
}
......@@ -214,7 +214,7 @@ void setup()
{
// Add your initialization code here
// Note : This will initialize Serial port on Arduino at 115200 bauds
OC_LOG_INIT();
OIC_LOG_INIT();
Serial.println("#########################");
Serial.println("EasySetup Enrollee SAMPLE");
......@@ -276,7 +276,7 @@ void loop()
// Give CPU cycles to OCStack to perform send/recv and other OCStack stuff
if (OCProcess() != OC_STACK_OK)
{
OC_LOG(ERROR, TAG, "OCStack process error");
OIC_LOG(ERROR, TAG, "OCStack process error");
return;
}
}
......
......@@ -77,24 +77,24 @@ ESResult ConnectToWiFiNetwork(const char *ssid, const char *pass, NetworkEventCa
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD)
{
OC_LOG(ERROR, ES_NH_TAG, "WiFi shield not present");
OIC_LOG(ERROR, ES_NH_TAG, "WiFi shield not present");
return ES_ERROR;
}
// Verify that WiFi Shield is running the firmware with all UDP fixes
fwVersion = WiFi.firmwareVersion();
OC_LOG_V(INFO, ES_NH_TAG, "WiFi Shield Firmware version %s", fwVersion);
OIC_LOG_V(INFO, ES_NH_TAG, "WiFi Shield Firmware version %s", fwVersion);
if (strncmp(fwVersion, ARDUINO_WIFI_SHIELD_UDP_FW_VER, sizeof(ARDUINO_WIFI_SHIELD_UDP_FW_VER))
!= 0)
{
OC_LOG(DEBUG, ES_NH_TAG, "!!!!! Upgrade WiFi Shield Firmware version !!!!!!");
OIC_LOG(DEBUG, ES_NH_TAG, "!!!!! Upgrade WiFi Shield Firmware version !!!!!!");
return ES_ERROR;
}
//Retry counter is reset everytime the ConnectToWiFiNetwork is invoked
g_retryCounter = 0;
OC_LOG_V(INFO, ES_NH_TAG, "Finding SSID: %s", ssid);
OIC_LOG_V(INFO, ES_NH_TAG, "Finding SSID: %s", ssid);
while ((findNetwork(ssid) == 0) && g_retryCounter < ES_MAX_NETWORK_RETRY) // found
{
......@@ -103,8 +103,8 @@ ESResult ConnectToWiFiNetwork(const char *ssid, const char *pass, NetworkEventCa
}
if(g_retryCounter == ES_MAX_NETWORK_RETRY){
OC_LOG_V(ERROR, ES_NH_TAG, "Connection to network failed after %d attempts",
g_retryCounter);
OIC_LOG_V(ERROR, ES_NH_TAG, "Connection to network failed after %d attempts",
g_retryCounter);
return ES_ERROR;
}
......@@ -173,7 +173,7 @@ int ConnectToNetwork(const char *ssid, const char *pass)
// attempt to connect to Wifi network:
while (status != WL_CONNECTED && g_retryCounter < ES_MAX_NETWORK_RETRY)
{
OC_LOG_V(INFO, ES_NH_TAG, "Attempting to connect to SSID: %s", ssid);
OIC_LOG_V(INFO, ES_NH_TAG, "Attempting to connect to SSID: %s", ssid);
status = WiFi.begin((char *) ssid, (char *) pass);
......@@ -184,16 +184,16 @@ int ConnectToNetwork(const char *ssid, const char *pass)
}
if(g_retryCounter == ES_MAX_NETWORK_RETRY){
OC_LOG_V(ERROR, ES_NH_TAG, "Connection to network failed after %d attempts",
g_retryCounter);
OIC_LOG_V(ERROR, ES_NH_TAG, "Connection to network failed after %d attempts",
g_retryCounter);
return ES_ERROR;
}
OC_LOG(DEBUG, ES_NH_TAG, "Connected to wifi");
OIC_LOG(DEBUG, ES_NH_TAG, "Connected to wifi");
enrolleeIP = WiFi.localIP();
OC_LOG_V(INFO, ES_NH_TAG, "IP Address: %d.%d.%d.%d", enrolleeIP[0], enrolleeIP[1],
enrolleeIP[2], enrolleeIP[3]);
OIC_LOG_V(INFO, ES_NH_TAG, "IP Address: %d.%d.%d.%d", enrolleeIP[0], enrolleeIP[1],
enrolleeIP[2], enrolleeIP[3]);
char buf[50];
sprintf(buf, "IP Address: %d.%d.%d.%d", enrolleeIP[0], enrolleeIP[1],
......
......@@ -68,20 +68,20 @@ void EventCallbackAfterProvisioning(ESResult esResult);
void EventCallbackInOnboarding(ESResult esResult)
{
if (g_cbForEnrolleeStatus != NULL){
OC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with esResult = %d", esResult);
OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with esResult = %d", esResult);
if(esResult == ES_OK){
OC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with enrolleestate = %d",
OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with enrolleestate = %d",
ES_ON_BOARDED_STATE);
g_cbForEnrolleeStatus(esResult, ES_ON_BOARDED_STATE);
}
else{
OC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with enrolleestate = %d",
OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with enrolleestate = %d",
ES_INIT_STATE);
g_cbForEnrolleeStatus(esResult, ES_INIT_STATE);
}
}
else{
OC_LOG(ERROR, ES_ENROLLEE_TAG, "g_cbForEnrolleeStatus is NULL");
OIC_LOG(ERROR, ES_ENROLLEE_TAG, "g_cbForEnrolleeStatus is NULL");
}
}
......@@ -96,7 +96,7 @@ void EventCallbackInProvisioning(ESResult esResult)
if(TerminateEasySetup() != OC_STACK_OK)
{
OC_LOG(ERROR, ES_ENROLLEE_TAG, "Terminating stack failed");
OIC_LOG(ERROR, ES_ENROLLEE_TAG, "Terminating stack failed");
return;
}
......@@ -107,12 +107,12 @@ void EventCallbackInProvisioning(ESResult esResult)
if (g_cbForEnrolleeStatus != NULL)
{
if(res == ES_NETWORKCONNECTED){
OC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with enrolleestate = %d",
OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with enrolleestate = %d",
ES_PROVISIONED_STATE);
g_cbForEnrolleeStatus(ES_OK, ES_PROVISIONED_STATE);
}
else{
OC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with enrolleestate = %d",
OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with enrolleestate = %d",
ES_PROVISIONING_STATE);
g_cbForEnrolleeStatus(ES_OK, ES_PROVISIONING_STATE);
}
......@@ -125,18 +125,18 @@ void EventCallbackAfterProvisioning(ESResult esResult)
{
if (g_cbForEnrolleeStatus != NULL){
if(esResult == ES_OK){
OC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with enrolleestate = %d",
OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with enrolleestate = %d",
ES_PROVISIONED_STATE);
g_cbForEnrolleeStatus(esResult, ES_PROVISIONED_STATE);
}
else{
OC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with enrolleestate = %d",
OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Calling the application with enrolleestate = %d",
ES_PROVISIONING_STATE);
g_cbForEnrolleeStatus(esResult, ES_PROVISIONING_STATE);
}
}
else{
OC_LOG(ERROR, ES_ENROLLEE_TAG, "g_cbForEnrolleeStatus is NULL");
OIC_LOG(ERROR, ES_ENROLLEE_TAG, "g_cbForEnrolleeStatus is NULL");
}
}
......@@ -159,12 +159,12 @@ ESResult FindNetworkForOnboarding(OCConnectivityType networkType,
if(ConnectToWiFiNetwork(ssid, passwd, EventCallbackInOnboarding) != ES_NETWORKCONNECTED)
{
OC_LOG(ERROR, ES_ENROLLEE_TAG, "ConnectToWiFiNetwork Failed");
OIC_LOG(ERROR, ES_ENROLLEE_TAG, "ConnectToWiFiNetwork Failed");
cb(ES_ERROR, ES_ON_BOARDING_STATE);
return ES_ERROR;
}
else{
OC_LOG(INFO, ES_ENROLLEE_TAG, "ConnectToWiFiNetwork Success");
OIC_LOG(INFO, ES_ENROLLEE_TAG, "ConnectToWiFiNetwork Success");
cb(ES_OK, ES_ON_BOARDED_STATE);
return ES_OK;
}
......@@ -178,19 +178,19 @@ ESResult InitEasySetup(OCConnectivityType networkType, const char *ssid, const c
{
if(FindNetworkForOnboarding(networkType, ssid, passwd, cb) != ES_OK)
{
OC_LOG(ERROR, ES_ENROLLEE_TAG, "OnBoarding Failed");
OIC_LOG(ERROR, ES_ENROLLEE_TAG, "OnBoarding Failed");
return ES_ERROR;
}
// Initialize the OC Stack in Server mode
if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK)
{
OC_LOG(ERROR, ES_ENROLLEE_TAG, "OCStack init error");
OIC_LOG(ERROR, ES_ENROLLEE_TAG, "OCStack init error");
return ES_ERROR;
}
else
{
OC_LOG(DEBUG, ES_ENROLLEE_TAG, "OCStack init success");
OIC_LOG(DEBUG, ES_ENROLLEE_TAG, "OCStack init success");
return ES_OK;
}
}
......@@ -199,12 +199,12 @@ ESResult TerminateEasySetup()
{
if(OCStop() != OC_STACK_OK)
{
OC_LOG(ERROR, ES_ENROLLEE_TAG, "OCStack stop failed");
OIC_LOG(ERROR, ES_ENROLLEE_TAG, "OCStack stop failed");
return ES_ERROR;
}
else
{
OC_LOG(ERROR, ES_ENROLLEE_TAG, "OCStack stop success");
OIC_LOG(ERROR, ES_ENROLLEE_TAG, "OCStack stop success");
return ES_OK;
}
}
......
......@@ -86,7 +86,7 @@ OCStackResult CreateProvisioningResource()
OCStackResult res = OCCreateResource(&g_prov.handle, "oic.r.prov", OC_RSRVD_INTERFACE_DEFAULT,
OC_RSRVD_ES_URI_PROV, OCEntityHandlerCb, NULL, OC_DISCOVERABLE | OC_OBSERVABLE);
OC_LOG_V(INFO, ES_RH_TAG, "Created Prov resource with result: %s", getResult(res));
OIC_LOG_V(INFO, ES_RH_TAG, "Created Prov resource with result: %s", getResult(res));
return res;
}
......@@ -111,12 +111,12 @@ OCStackResult CreateNetworkResource()
netInfo.ipaddr[3]);
sprintf(g_net.cnn, "%s", netInfo.ssid);
OC_LOG_V(INFO, ES_RH_TAG, "SSID: %s", g_net.cnn);
OC_LOG_V(INFO, ES_RH_TAG, "IP Address: %s", g_net.ipaddr);
OIC_LOG_V(INFO, ES_RH_TAG, "SSID: %s", g_net.cnn);
OIC_LOG_V(INFO, ES_RH_TAG, "IP Address: %s", g_net.ipaddr);
OCStackResult res = OCCreateResource(&g_net.handle, "oic.r.net", OC_RSRVD_INTERFACE_DEFAULT,
OC_RSRVD_ES_URI_NET, OCEntityHandlerCb,NULL, OC_DISCOVERABLE | OC_OBSERVABLE);
OC_LOG_V(INFO, ES_RH_TAG, "Created Net resource with result: %s", getResult(res));
OIC_LOG_V(INFO, ES_RH_TAG, "Created Net resource with result: %s", getResult(res));
return res;
}
......@@ -127,19 +127,19 @@ OCEntityHandlerResult ProcessGetRequest(OCEntityHandlerRequest *ehRequest,
OCEntityHandlerResult ehResult = OC_EH_ERROR;
if (!ehRequest)
{
OC_LOG(ERROR, ES_RH_TAG, "Request is Null");
OIC_LOG(ERROR, ES_RH_TAG, "Request is Null");
return ehResult;
}
if (ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION)
{
OC_LOG(ERROR, ES_RH_TAG, "Incoming payload not a representation");
OIC_LOG(ERROR, ES_RH_TAG, "Incoming payload not a representation");
return ehResult;
}
OCRepPayload *getResp = constructResponse(ehRequest);
if (!getResp)
{
OC_LOG(ERROR, ES_RH_TAG, "constructResponse failed");
OIC_LOG(ERROR, ES_RH_TAG, "constructResponse failed");
return OC_EH_ERROR;
}
......@@ -156,14 +156,14 @@ OCEntityHandlerResult ProcessPutRequest(OCEntityHandlerRequest *ehRequest,
OCEntityHandlerResult ehResult = OC_EH_ERROR;
if (ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION)
{
OC_LOG(ERROR, ES_RH_TAG, "Incoming payload not a representation");
OIC_LOG(ERROR, ES_RH_TAG, "Incoming payload not a representation");
return ehResult;
}
OCRepPayload* input = (OCRepPayload*) (ehRequest->payload);
if (!input)
{
OC_LOG(ERROR, ES_RH_TAG, "Failed to parse");
OIC_LOG(ERROR, ES_RH_TAG, "Failed to parse");
return ehResult;
}
......@@ -184,7 +184,7 @@ OCEntityHandlerResult ProcessPutRequest(OCEntityHandlerRequest *ehRequest,
OCRepPayload *getResp = constructResponse(ehRequest);
if (!getResp)
{
OC_LOG(ERROR, ES_RH_TAG, "constructResponse failed");
OIC_LOG(ERROR, ES_RH_TAG, "constructResponse failed");
return OC_EH_ERROR;
}
......@@ -200,19 +200,19 @@ OCEntityHandlerResult ProcessPostRequest(OCEntityHandlerRequest *ehRequest,
OCEntityHandlerResult ehResult = OC_EH_ERROR;
if (!ehRequest)
{
OC_LOG(ERROR, ES_RH_TAG, "Request is Null");
OIC_LOG(ERROR, ES_RH_TAG, "Request is Null");
return ehResult;
}
if (ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION)
{
OC_LOG(ERROR, ES_RH_TAG, "Incoming payload not a representation");
OIC_LOG(ERROR, ES_RH_TAG, "Incoming payload not a representation");
return ehResult;
}
OCRepPayload* input = (OCRepPayload*) (ehRequest->payload);
if (!input)
{
OC_LOG(ERROR, ES_RH_TAG, "Failed to parse");
OIC_LOG(ERROR, ES_RH_TAG, "Failed to parse");
return ehResult;
}
char* tr;
......@@ -233,7 +233,7 @@ OCRepPayload* constructResponse(OCEntityHandlerRequest *ehRequest)
OCRepPayload* payload = OCRepPayloadCreate();
if (!payload)
{
OC_LOG(ERROR, ES_RH_TAG, "Failed to allocate Payload");
OIC_LOG(ERROR, ES_RH_TAG, "Failed to allocate Payload");
return NULL;
}
......@@ -268,12 +268,12 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
{
if (OC_REST_GET == entityHandlerRequest->method)
{
OC_LOG(INFO, ES_RH_TAG, "Received GET request");
OIC_LOG(INFO, ES_RH_TAG, "Received GET request");
ehRet = ProcessGetRequest(entityHandlerRequest, &payload);
}
else if (OC_REST_PUT == entityHandlerRequest->method)
{
OC_LOG(INFO, ES_RH_TAG, "Received PUT request");
OIC_LOG(INFO, ES_RH_TAG, "Received PUT request");
if (g_prov.handle != NULL && entityHandlerRequest->resource == g_prov.handle)
{
......@@ -287,7 +287,7 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
else if (OC_REST_POST == entityHandlerRequest->method)
{
// TODO: As of now, POST request will be not received.
OC_LOG(INFO, ES_RH_TAG, "Received OC_REST_POST from client");
OIC_LOG(INFO, ES_RH_TAG, "Received OC_REST_POST from client");
//ehRet = ProcessPostRequest (entityHandlerRequest, payload, sizeof(payload) - 1);
}
......@@ -309,7 +309,7 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
// Send the response
if (OCDoResponse(&response) != OC_STACK_OK)
{
OC_LOG(ERROR, ES_RH_TAG, "Error sending response");
OIC_LOG(ERROR, ES_RH_TAG, "Error sending response");
ehRet = OC_EH_ERROR;
}
}
......
......@@ -64,7 +64,7 @@ namespace OIC
{
for (RCSResourceAttributes::iterator it = attrs.begin(); it != attrs.end(); ++it)
{
OC_LOG_V(INFO, CONTAINER_TAG, "set attribute \(%s)'",
OIC_LOG_V(INFO, CONTAINER_TAG, "set attribute \(%s)'",
std::string(it->key() + "\', with " + it->value().toString()).c_str());
m_resourceAttributes[it->key()] = it->value();
......@@ -74,7 +74,7 @@ namespace OIC
void BundleResource::setAttribute(const std::string &key,
RCSResourceAttributes::Value &&value, bool notify)
{
OC_LOG_V(INFO, CONTAINER_TAG, "set attribute \(%s)'", std::string(key + "\', with " +
OIC_LOG_V(INFO, CONTAINER_TAG, "set attribute \(%s)'", std::string(key + "\', with " +
value.toString()).c_str());
m_resourceAttributes[key] = value;
......@@ -89,7 +89,7 @@ namespace OIC
RCSResourceAttributes::Value BundleResource::getAttribute(const std::string &key)
{
OC_LOG_V(INFO, CONTAINER_TAG, "get attribute \'(%s)" , std::string(key + "\'").c_str());
OIC_LOG_V(INFO, CONTAINER_TAG, "get attribute \'(%s)" , std::string(key + "\'").c_str());
return m_resourceAttributes.at(key);
}
......
......@@ -113,8 +113,8 @@ namespace OIC
}
catch (rapidxml::parse_error &e)
{
OC_LOG(ERROR, CONTAINER_TAG, "xml parsing failed !!");
OC_LOG_V(ERROR, CONTAINER_TAG, "Exception : (%s)", e.what());
OIC_LOG(ERROR, CONTAINER_TAG, "xml parsing failed !!");
OIC_LOG_V(ERROR, CONTAINER_TAG, "Exception : (%s)", e.what());
}
}
}
......@@ -159,8 +159,8 @@ namespace OIC
}
catch (rapidxml::parse_error &e)
{
OC_LOG(ERROR, CONTAINER_TAG, "xml parsing failed !!");
OC_LOG_V(ERROR, CONTAINER_TAG, "Exception (%s)", e.what());
OIC_LOG(ERROR, CONTAINER_TAG, "xml parsing failed !!");
OIC_LOG_V(ERROR, CONTAINER_TAG, "Exception (%s)", e.what());
}
}
}
......@@ -248,8 +248,8 @@ namespace OIC
}
catch (rapidxml::parse_error &e)
{
OC_LOG(ERROR, CONTAINER_TAG, "xml parsing failed !!");
OC_LOG_V(ERROR, CONTAINER_TAG, "Exception (%s)", e.what());
OIC_LOG(ERROR, CONTAINER_TAG, "xml parsing failed !!");
OIC_LOG_V(ERROR, CONTAINER_TAG, "Exception (%s)", e.what());
}
}
}
......@@ -278,14 +278,14 @@ namespace OIC
}
catch (rapidxml::parse_error &e)
{
OC_LOG(ERROR, CONTAINER_TAG, "xml parsing failed !!");
OC_LOG_V(ERROR, CONTAINER_TAG, "Exception (%s)", e.what());
OIC_LOG(ERROR, CONTAINER_TAG, "xml parsing failed !!");
OIC_LOG_V(ERROR, CONTAINER_TAG, "Exception (%s)", e.what());
}
}
else
{
OC_LOG(ERROR, CONTAINER_TAG, "Configuration File load failed !!");
OIC_LOG(ERROR, CONTAINER_TAG, "Configuration File load failed !!");
}
}
}
}
\ No newline at end of file
}
......@@ -86,13 +86,13 @@ RCSResourceAttributes::Value JavaBundleResource::handleGetAttributeRequest(
{
if (vm->AttachCurrentThread((void **) &env, NULL) != 0)
{
OC_LOG_V(ERROR, CONTAINER_TAG,
OIC_LOG_V(ERROR, CONTAINER_TAG,
"[JavaBundleResource::handleGetAttributeRequest] Failed to attach ");
}
}
else if (envStat == JNI_EVERSION)
{
OC_LOG_V(ERROR, CONTAINER_TAG,
OIC_LOG_V(ERROR, CONTAINER_TAG,
"[JavaBundleResource::handleGetAttributeRequest] Env: version not supported");
}
......@@ -121,13 +121,13 @@ void JavaBundleResource::handleSetAttributeRequest(const std::string &attributeN
{
if (vm->AttachCurrentThread((void **) &env, NULL) != 0)
{
OC_LOG_V(ERROR, CONTAINER_TAG,
OIC_LOG_V(ERROR, CONTAINER_TAG,
"[JavaBundleResource::handleSetAttributeRequest] Failed to attach ");
}
}
else if (envStat == JNI_EVERSION)
{
OC_LOG_V(ERROR, CONTAINER_TAG,
OIC_LOG_V(ERROR, CONTAINER_TAG,
"[JavaBundleResource::handleSetAttributeRequest] Env: version not supported ");
}
......
......@@ -59,11 +59,11 @@ namespace OIC
void ResourceContainerImpl::startContainer(const std::string &configFile)
{
OC_LOG(INFO, CONTAINER_TAG, "Starting resource container.");
OIC_LOG(INFO, CONTAINER_TAG, "Starting resource container.");
#if (JAVA_SUPPORT)
OC_LOG(INFO, CONTAINER_TAG, "Resource container has Java support.");
OIC_LOG(INFO, CONTAINER_TAG, "Resource container has Java support.");
#else
OC_LOG(INFO, CONTAINER_TAG, "Resource container without Java support.");
OIC_LOG(INFO, CONTAINER_TAG, "Resource container without Java support.");
#endif
......@@ -92,7 +92,7 @@ namespace OIC
bundles[i][BUNDLE_LIBRARY_PATH]);
}
OC_LOG_V(INFO, CONTAINER_TAG, "Init Bundle:(%s)",
OIC_LOG_V(INFO, CONTAINER_TAG, "Init Bundle:(%s)",
std::string(bundles[i][BUNDLE_ID] + ";" +
bundles[i][BUNDLE_PATH]).c_str());
......@@ -102,12 +102,12 @@ namespace OIC
}
else
{
OC_LOG_V(ERROR, CONTAINER_TAG, "Container started with invalid configfile path.");
OIC_LOG_V(ERROR, CONTAINER_TAG, "Container started with invalid configfile path.");
}
}
else
{
OC_LOG_V(INFO, CONTAINER_TAG, "No configuration file for the container provided.");
OIC_LOG_V(INFO, CONTAINER_TAG, "No configuration file for the container provided.");
}
map<std::string, boost::thread >::iterator activatorIterator;
......@@ -124,7 +124,7 @@ namespace OIC
void ResourceContainerImpl::stopContainer()
{
OC_LOG(INFO, CONTAINER_TAG, "Stopping resource container.");
OIC_LOG(INFO, CONTAINER_TAG, "Stopping resource container.");
for (std::map< std::string, BundleInfoInternal * >::iterator it = m_bundles.begin();
it != m_bundles.end(); ++it)
......@@ -173,7 +173,7 @@ namespace OIC
void ResourceContainerImpl::activateBundle(const std::string &id)
{
OC_LOG_V(INFO, CONTAINER_TAG, "Activating bundle: (%s)",
OIC_LOG_V(INFO, CONTAINER_TAG, "Activating bundle: (%s)",
std::string(m_bundles[id]->getID()).c_str());
activationLock.lock();
auto f = std::bind(&ResourceContainerImpl::activateBundleThread, this,
......@@ -181,7 +181,7 @@ namespace OIC
boost::thread activator(f);
activator.timed_join(boost::posix_time::seconds(BUNDLE_SET_GET_WAIT_SEC));
activationLock.unlock();
OC_LOG_V(INFO, CONTAINER_TAG, "Bundle activated: (%s)",
OIC_LOG_V(INFO, CONTAINER_TAG, "Bundle activated: (%s)",
std::string(m_bundles[id]->getID()).c_str());
}
......@@ -202,7 +202,7 @@ namespace OIC
// loads the bundle
void ResourceContainerImpl::registerBundle(RCSBundleInfo *bundleInfo)
{
OC_LOG_V(INFO, CONTAINER_TAG, "Registering bundle: (%s)",
OIC_LOG_V(INFO, CONTAINER_TAG, "Registering bundle: (%s)",
std::string(bundleInfo->getPath()).c_str());
if (has_suffix(bundleInfo->getPath(), ".jar"))
......@@ -241,7 +241,7 @@ namespace OIC
{
void *bundleHandle = m_bundles[id]->getBundleHandle();
OC_LOG_V(INFO, CONTAINER_TAG, "Unregister bundle: (%s)",
OIC_LOG_V(INFO, CONTAINER_TAG, "Unregister bundle: (%s)",
std::string(m_bundles[id]->getID()).c_str());
const char *error;
......@@ -249,7 +249,7 @@ namespace OIC
if ((error = dlerror()) != NULL)