Commit e6c82276 authored by Charlie Lenahan's avatar Charlie Lenahan Committed by Erich Keane

Remove unused OC_INIT_FLAG.

The stack/samples doesn't send it or rely on it.

Change-Id: I2809ab9fc48b2f8cf45f4ba4bc88d68f3c66b988
Signed-off-by: default avatarCharlie Lenahan <charlie.lenahan@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1016Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarErich Keane <erich.keane@intel.com>
parent fc527448
......@@ -45,10 +45,6 @@ OCEntityHandlerResult MiddleServer::entityHandler(const std::shared_ptr<OCResour
int requestFlag = request->getRequestHandlerFlag();
bool responseNeeded = false;
if (requestFlag && RequestHandlerFlag::InitFlag) {
return OC_EH_OK;
}
if (requestFlag && RequestHandlerFlag::RequestFlag) {
if (requestType == "PUT") {
responseNeeded = true;
......
......@@ -440,7 +440,6 @@ typedef struct
typedef enum
{
OC_INIT_FLAG = (1 << 0),
OC_REQUEST_FLAG = (1 << 1),
OC_OBSERVE_FLAG = (1 << 2)
} OCEntityHandlerFlag; //entity_handler_flag_t ;
......
......@@ -509,10 +509,6 @@ OCDeviceEntityHandlerCb (OCEntityHandlerFlag flag,
memset(response.resourceUri, 0, sizeof response.resourceUri);
if (flag & OC_INIT_FLAG)
{
OC_LOG (INFO, TAG, "Flag includes OC_INIT_FLAG");
}
if (flag & OC_REQUEST_FLAG)
{
OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
......@@ -612,10 +608,6 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
0, sizeof response.sendVendorSpecificHeaderOptions);
memset(response.resourceUri, 0, sizeof response.resourceUri);
if (flag & OC_INIT_FLAG)
{
OC_LOG (INFO, TAG, "Flag includes OC_INIT_FLAG");
}
if (flag & OC_REQUEST_FLAG)
{
OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
......
......@@ -272,11 +272,6 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
OCEntityHandlerResponse response;
char payload[MAX_RESPONSE_LENGTH] = {0};
if (flag & OC_INIT_FLAG)
{
OC_LOG (INFO, TAG, "Flag includes OC_INIT_FLAG");
ehResult = OC_EH_OK;
}
if (flag & OC_REQUEST_FLAG)
{
OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
......
......@@ -125,9 +125,6 @@ PrintReceivedMsgInfo(OCEntityHandlerFlag flag, OCEntityHandlerRequest * ehReques
switch (flag)
{
case OC_INIT_FLAG:
typeOfMessage = "OC_INIT_FLAG";
break;
case OC_REQUEST_FLAG:
typeOfMessage = "OC_REQUEST_FLAG";
break;
......
......@@ -212,11 +212,6 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
OCEntityHandlerRequest *request = NULL;
OC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
if (flag & OC_INIT_FLAG)
{
OC_LOG(INFO, TAG, "Flag includes OC_INIT_FLAG");
result = OC_EH_OK;
}
if (flag & OC_REQUEST_FLAG)
{
OC_LOG(INFO, TAG, "Flag includes OC_REQUEST_FLAG");
......
......@@ -248,11 +248,6 @@ OCEntityHandlerCb (OCEntityHandlerFlag flag,
OCEntityHandlerResponse response;
char payload[MAX_RESPONSE_LENGTH] = {0};
if (flag & OC_INIT_FLAG)
{
OC_LOG (INFO, TAG, "Flag includes OC_INIT_FLAG");
ehResult = OC_EH_OK;
}
if (flag & OC_REQUEST_FLAG)
{
OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
......
......@@ -195,12 +195,6 @@ OCEntityHandlerResult entityHandler(std::shared_ptr<OCResourceRequest> request)
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if(requestFlag & RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
if(requestFlag & RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......
......@@ -176,12 +176,6 @@ OCEntityHandlerResult entityHandler(std::shared_ptr<OCResourceRequest> request)
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if(requestFlag & RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
if(requestFlag & RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......
......@@ -290,13 +290,7 @@ bool prepareLightResponse(std::shared_ptr<OCResourceRequest> request)
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if(requestFlag == RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
else if(requestFlag == RequestHandlerFlag::RequestFlag)
if(requestFlag == RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......@@ -351,13 +345,7 @@ bool prepareFanResponse(std::shared_ptr<OCResourceRequest> request)
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if(requestFlag == RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
else if(requestFlag == RequestHandlerFlag::RequestFlag)
if(requestFlag == RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......@@ -412,13 +400,7 @@ OCEntityHandlerResult entityHandlerRoom(std::shared_ptr<OCResourceRequest> reque
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if(requestFlag == RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
else if(requestFlag == RequestHandlerFlag::RequestFlag)
if(requestFlag == RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......
......@@ -278,11 +278,7 @@ struct FooResource
{
std::cout <<"\t\trequestFlag : UNSUPPORTED: ";
if(request->getRequestHandlerFlag()==RequestHandlerFlag::InitFlag)
{
std::cout<<"InitFlag"<<std::endl;
}
else if(request->getRequestHandlerFlag()== RequestHandlerFlag::ObserverFlag)
if(request->getRequestHandlerFlag()== RequestHandlerFlag::ObserverFlag)
{
std::cout<<"ObserverFlag"<<std::endl;
}
......
......@@ -262,11 +262,6 @@ OCEntityHandlerResult entityHandler(std::shared_ptr<OCResourceRequest> request)
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if(requestFlag & RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
if(requestFlag & RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......
......@@ -266,11 +266,6 @@ OCEntityHandlerResult entityHandler(std::shared_ptr<OCResourceRequest> request)
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if(requestFlag & RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
if(requestFlag & RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......
......@@ -141,11 +141,7 @@ struct FooResource
{
std::cout <<"\t\trequestFlag : UNSUPPORTED: ";
if(request->getRequestHandlerFlag()==RequestHandlerFlag::InitFlag)
{
std::cout<<"InitFlag"<<std::endl;
}
else if(request->getRequestHandlerFlag()== RequestHandlerFlag::ObserverFlag)
if(request->getRequestHandlerFlag()== RequestHandlerFlag::ObserverFlag)
{
std::cout<<"ObserverFlag"<<std::endl;
}
......
......@@ -148,7 +148,6 @@ namespace OC
enum RequestHandlerFlag
{
InitFlag = 1 << 0,
RequestFlag = 1 << 1,
ObserverFlag = 1 << 2
};
......
......@@ -61,11 +61,6 @@ void formResourceRequest(OCEntityHandlerFlag flag,
pRequest->setResourceHandle(entityHandlerRequest->resource);
}
if(flag & OC_INIT_FLAG)
{
pRequest->setRequestHandlerFlag(OC::RequestHandlerFlag::InitFlag);
}
if(flag & OC_REQUEST_FLAG)
{
pRequest->setRequestHandlerFlag(OC::RequestHandlerFlag::RequestFlag);
......
......@@ -1046,10 +1046,6 @@ resourceEntityHandlerCB (OCEntityHandlerFlag entifyHandlerFlag,
sizeof entityHandlerResponse.sendVendorSpecificHeaderOptions);
memset(entityHandlerResponse.resourceUri, 0, sizeof entityHandlerResponse.resourceUri);
if (entifyHandlerFlag & OC_INIT_FLAG)
{
OC_LOG_V(DEBUG, HOSTING_TAG, "Flag includes OC_INIT_FLAG");
}
if (entifyHandlerFlag & OC_REQUEST_FLAG)
{
OC_LOG_V(DEBUG, HOSTING_TAG, "Flag includes OC_REQUEST_FLAG");
......
......@@ -228,11 +228,6 @@ OCEntityHandlerResult entityHandler(std::shared_ptr< OCResourceRequest > request
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if (requestFlag == RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
}
if (requestFlag == RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......
......@@ -268,12 +268,6 @@ class FanResource
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if (requestFlag & RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
if (requestFlag & RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request === Handle by FanServer\n";
......
......@@ -268,12 +268,6 @@ class LightResource
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if (requestFlag & RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
if (requestFlag & RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request === Handle by FanServer\n";
......
......@@ -195,11 +195,6 @@ OCEntityHandlerResult SSMResourceServer::entityHandler(std::shared_ptr< OCResour
response->setRequestHandle(request->getRequestHandle());
response->setResourceHandle(request->getResourceHandle());
if (requestFlag & RequestHandlerFlag::InitFlag)
{
// entity handler to perform resource initialization operations
}
if (requestFlag & RequestHandlerFlag::RequestFlag)
{
// If the request type is GET
......
......@@ -156,13 +156,6 @@ OCEntityHandlerResult entityHandler(std::shared_ptr< OCResourceRequest > request
response->setRequestHandle(request->getRequestHandle());
response->setResourceHandle(request->getResourceHandle());
if (requestFlag & RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
if (requestFlag & RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......
......@@ -127,13 +127,6 @@ OCEntityHandlerResult entityHandler(std::shared_ptr< OCResourceRequest > request
response->setRequestHandle(request->getRequestHandle());
response->setResourceHandle(request->getResourceHandle());
if (requestFlag & RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
if (requestFlag & RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......
......@@ -127,13 +127,6 @@ OCEntityHandlerResult entityHandler(std::shared_ptr< OCResourceRequest > request
response->setRequestHandle(request->getRequestHandle());
response->setResourceHandle(request->getResourceHandle());
if (requestFlag & RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
if (requestFlag & RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......
......@@ -154,13 +154,6 @@ OCEntityHandlerResult entityHandler(std::shared_ptr< OCResourceRequest > request
response->setRequestHandle(request->getRequestHandle());
response->setResourceHandle(request->getResourceHandle());
if (requestFlag & RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
if (requestFlag & RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......
......@@ -111,13 +111,7 @@ bool prepareResponse(std::shared_ptr< OCResourceRequest > request)
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if (requestFlag == RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
else if (requestFlag == RequestHandlerFlag::RequestFlag)
if (requestFlag == RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......
......@@ -108,13 +108,7 @@ bool prepareResponseForResource(std::shared_ptr< OCResourceRequest > request)
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if (requestFlag == RequestHandlerFlag::InitFlag)
{
std::cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
else if (requestFlag == RequestHandlerFlag::RequestFlag)
if (requestFlag == RequestHandlerFlag::RequestFlag)
{
std::cout << "\t\trequestFlag : Request\n";
......
......@@ -49,13 +49,7 @@ private:
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if (requestFlag & RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
else if (requestFlag & RequestHandlerFlag::RequestFlag)
if (requestFlag & RequestHandlerFlag::RequestFlag)
{
auto pResponse = std::make_shared< OC::OCResourceResponse >();
pResponse->setRequestHandle(request->getRequestHandle());
......
......@@ -184,12 +184,6 @@ private:
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if (requestFlag & RequestHandlerFlag::InitFlag)
{
cout << "\t\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
if (requestFlag & RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
......
......@@ -38,13 +38,7 @@ OCEntityHandlerResult mpEntityHandler(const std::shared_ptr< OCResourceRequest >
int requestFlag = request->getRequestHandlerFlag();
std::string action;
if (requestFlag == RequestHandlerFlag::InitFlag)
{
cout << "\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
else if (requestFlag == RequestHandlerFlag::RequestFlag)
if (requestFlag == RequestHandlerFlag::RequestFlag)
{
cout << "\trequestFlag : Request\n";
......
......@@ -38,13 +38,7 @@ OCEntityHandlerResult speakerEntityHandler(const std::shared_ptr< OCResourceRequ
int requestFlag = request->getRequestHandlerFlag();
std::string action;
if (requestFlag == RequestHandlerFlag::InitFlag)
{
cout << "\trequestFlag : Init\n";
// entity handler to perform resource initialization operations
}
else if (requestFlag == RequestHandlerFlag::RequestFlag)
if (requestFlag == RequestHandlerFlag::RequestFlag)
{
cout << "\trequestFlag : Request\n";
......
......@@ -121,11 +121,7 @@ bool prepareResponseForResource(std::shared_ptr< OCResourceRequest > request)
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if (requestFlag == RequestHandlerFlag::InitFlag)
{
dlog_print(DLOG_INFO, LOG_TAG, "#### requestFlag : Init");
}
else if (requestFlag == RequestHandlerFlag::RequestFlag)
if (requestFlag == RequestHandlerFlag::RequestFlag)
{
dlog_print(DLOG_INFO, LOG_TAG, "#### requestFlag : Request");
......
......@@ -660,13 +660,7 @@ OCStackResult GroupSynchronization::leaveGroup(
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
if (requestFlag == RequestHandlerFlag::InitFlag)
{
OC_LOG(DEBUG, TAG, "\trequestFlag : Init");
// entity handler to perform resource initialization operations
}
else if (requestFlag == RequestHandlerFlag::RequestFlag)
if (requestFlag == RequestHandlerFlag::RequestFlag)
{
OC_LOG(DEBUG, TAG, "\trequestFlag : Request");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment