char const * signal_name,
GVariant * parameters)
{
+ (void)sender_name;
+ (void)object_path;
+ (void)interface_name;
+ (void)signal_name;
+ (void)parameters;
#ifdef TB_LOG
gchar * const param_dump =
g_variant_print(parameters, TRUE);
gchar const * const * invalidated_properties,
gpointer user_data)
{
+ (void)manager;
+ (void)object_proxy;
+ (void)invalidated_properties;
OIC_LOG_V(DEBUG,
TAG,
"Properties Changed on %s:\n",
GVariant * parameters,
gpointer user_data)
{
+ (void)connection;
+ (void)user_data;
CALEDumpDBusSignalParameters(sender_name,
object_path,
interface_name,
GVariant * parameters,
gpointer user_data)
{
+ (void)connection;
+ (void)user_data;
CALEDumpDBusSignalParameters(sender_name,
object_path,
interface_name,
GVariant * parameters,
gpointer user_data)
{
+ (void)connection;
+ (void)user_data;
CALEDumpDBusSignalParameters(sender_name,
object_path,
interface_name,
GVariant * parameters,
gpointer user_data)
{
+ (void)connection;
+ (void)user_data;
CALEDumpDBusSignalParameters(sender_name,
object_path,
interface_name,
char const * charValue,
uint32_t charValueLen)
{
+ (void)address;
+ (void)charValue;
+ (void)charValueLen;
/**
* @todo To be implemented shortly as part of the effort to
* address a critical code review that stated this BLE
CAResult_t CAUpdateCharacteristicsToAllGattClients(char const * charValue,
uint32_t charValueLen)
{
+ (void)charValue;
+ (void)charValueLen;
/**
* @todo To be implemented shortly as part of the effort to
* address a critical code review that stated this BLE
CALETransferType_t type,
int32_t position)
{
+ (void)remoteAddress;
+ (void)data;
+ (void)dataLen;
+ (void)type;
+ (void)position;
/**
* @todo To be implemented shortly as part of the effort to
* address a critical code review that stated this BLE
bool CAGattClientsDestroy(CALEContext * context)
{
+ (void)context;
/* g_hash_table_destroy(...); */ // FIXME
return false;
}
GVariant * parameters,
gpointer user_data)
{
+ (void)connection;
+ (void)sender_name;
+ (void)object_path;
+ (void)interface_name;
+ (void)signal_name;
/*
This handler is only trigged in a GATT client when receiving
data sent by a GATT server through a notification, e.g. such as
GDBusMethodInvocation * invocation,
gpointer user_data)
{
+ (void)user_data;
/**
* @todo The @c GattDescriptor1 object still owns the returned
* variant when using the below call. Should be we use
char const * descriptor_path,
char const * value)
{
+ (void)s;
CAGattDescriptor * const d = &c->descriptor;
// Path of the form /org/iotivity/gatt/hci0/service0/char0/desc0.
-/******************************************************************
+/* ****************************************************************
*
* Copyright 2015 Intel Corporation All Rights Reserved.
*
gchar const * name,
gpointer user_data)
{
+ (void)connection;
+ (void)name; // needed when logging is a noop
+ (void)user_data;
OIC_LOG_V(DEBUG,
TAG,
"Name \"%s\" acquired on D-Bus.", name);
gchar const * name,
gpointer user_data)
{
+ (void)connection;
+ (void)name; // needed when logging is a noop
+ (void)user_data;
/*
This can happen if the appropriate D-Bus policy is not
installed, for example.
CAResult_t checkGetNetworkInfo();
CAResult_t checkSelectNetwork();
-void request_handler(const CAEndpoint_t *object, const CARequestInfo_t *requestInfo)
+void request_handler(const CAEndpoint_t * /*object*/,
+ const CARequestInfo_t * /*requestInfo*/)
{
}
-void response_handler(const CAEndpoint_t *object, const CAResponseInfo_t *responseInfo)
+void response_handler(const CAEndpoint_t * /*object*/,
+ const CAResponseInfo_t * /*responseInfo*/)
{
}
EXPECT_EQ(CA_STATUS_OK, ca_thread_pool_init(3, &mythreadpool));
- _func1_struct pData = {};
+ _func1_struct pData = {0, false, false};
pData.mutex = ca_mutex_new();
if (min && sec && ms)
{
#if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0
- struct timespec when = {};
+ struct timespec when = {0};
clockid_t clk = CLOCK_REALTIME;
#ifdef CLOCK_REALTIME_COARSE
clk = CLOCK_REALTIME_COARSE;
{
if (acl)
{
- OicSecAcl_t *aclTmp1 = NULL, *aclTmp2 = NULL;
+ OicSecAcl_t *aclTmp1 = NULL;
+ OicSecAcl_t *aclTmp2 = NULL;
LL_FOREACH_SAFE(acl, aclTmp1, aclTmp2)
{
- int i = 0;
-
LL_DELETE(acl, aclTmp1);
// Clean Resources
- for (i = 0; i < aclTmp1->resourcesLen; i++)
+ for (size_t i = 0; i < aclTmp1->resourcesLen; i++)
{
OICFree(aclTmp1->resources[i]);
}
cJSON *jsonRsrcArray = NULL;
cJSON_AddItemToObject (jsonAcl, OIC_JSON_RESOURCES_NAME, jsonRsrcArray = cJSON_CreateArray());
VERIFY_NON_NULL(TAG, jsonRsrcArray, ERROR);
- for (int i = 0; i < acl->resourcesLen; i++)
+ for (size_t i = 0; i < acl->resourcesLen; i++)
{
cJSON_AddItemToArray (jsonRsrcArray, cJSON_CreateString(acl->resources[i]));
}
cJSON *jsonOwnrArray = NULL;
cJSON_AddItemToObject (jsonAcl, OIC_JSON_OWNERS_NAME, jsonOwnrArray = cJSON_CreateArray());
VERIFY_NON_NULL(TAG, jsonOwnrArray, ERROR);
- for (int i = 0; i < acl->ownersLen; i++)
+ for (size_t i = 0; i < acl->ownersLen; i++)
{
outLen = 0;
acl->resources = (char**)OICCalloc(acl->resourcesLen, sizeof(char*));
VERIFY_NON_NULL(TAG, (acl->resources), ERROR);
- int idxx = 0;
+ size_t idxx = 0;
do
{
cJSON *jsonRsrc = cJSON_GetArrayItem(jsonObj, idxx);
OCEntityHandlerRequest * ehRequest,
void* callbackParameter)
{
+ (void)callbackParameter;
OCEntityHandlerResult ehRet = OC_EH_ERROR;
if (!ehRequest)
{
OCStackResult ret = OC_STACK_ERROR;
- OicUuid_t ownerId = {};
+ OicUuid_t ownerId = {.id = {0}};
/*
* TODO In future, when new virtual resources will be added in OIC
acl->resources = (char**)OICCalloc(acl->resourcesLen, sizeof(char*));
VERIFY_NON_NULL(TAG, (acl->resources), ERROR);
- for (int i = 0; i < acl->resourcesLen; i++)
+ for (size_t i = 0; i < acl->resourcesLen; i++)
{
size_t len = strlen(rsrcs[i]) + 1;
acl->resources[i] = (char*)OICMalloc(len * sizeof(char));
const char * publicData, const char * privateData,
size_t ownersLen, const OicUuid_t * owners)
{
+ (void)publicData;
OCStackResult ret = OC_STACK_ERROR;
OicSecCred_t *cred = (OicSecCred_t*)OICCalloc(1, sizeof(OicSecCred_t));
OCEntityHandlerRequest * ehRequest,
void* callbackParameter)
{
+ (void)callbackParameter;
OCEntityHandlerResult ret = OC_EH_ERROR;
if(!ehRequest)
1, /* size_t oxmLen */
OIC_JUST_WORKS, /* uint16_t oxmSel */
false, /* bool owned */
- {}, /* OicUuid_t deviceID */
- {}, /* OicUuid_t owner */
+ {.id = {0}}, /* OicUuid_t deviceID */
+ {.id = {0}}, /* OicUuid_t owner */
};
void DeleteDoxmBinData(OicSecDoxm_t* doxm)
if (doxm)
{
//Clean oxmType
- for(int i = 0; i < doxm->oxmTypeLen; i++)
+ for (size_t i = 0; i < doxm->oxmTypeLen; i++)
{
OICFree(doxm->oxmType[i]);
}
doxm->oxmType = (OicUrn_t *)OICCalloc(doxm->oxmTypeLen, sizeof(char *));
VERIFY_NON_NULL(TAG, (doxm->oxmType), ERROR);
- for(int i = 0; i < doxm->oxmTypeLen ; i++)
+ for (size_t i = 0; i < doxm->oxmTypeLen ; i++)
{
cJSON *jsonOxmTy = cJSON_GetArrayItem(jsonObj, i);
VERIFY_NON_NULL(TAG, jsonOxmTy, ERROR);
doxm->oxm = (OicSecOxm_t*)OICCalloc(doxm->oxmLen, sizeof(OicSecOxm_t));
VERIFY_NON_NULL(TAG, doxm->oxm, ERROR);
- for(int i = 0; i < doxm->oxmLen ; i++)
+ for (size_t i = 0; i < doxm->oxmLen ; i++)
{
cJSON *jsonOxm = cJSON_GetArrayItem(jsonObj, i);
VERIFY_NON_NULL(TAG, jsonOxm, ERROR);
return false;
}
- OicParseQueryIter_t parseIter = {};
+ OicParseQueryIter_t parseIter = {0};
ParseQueryIterInit(query, &parseIter);
{
OC_LOG (INFO, TAG, PCF("Doxm EntityHandle processing PUT request"));
OCEntityHandlerResult ehRet = OC_EH_ERROR;
- OicUuid_t emptyOwner = {};
+ OicUuid_t emptyOwner = {.id = {0}};
/*
* Convert JSON Doxm data into binary. This will also validate
OCEntityHandlerRequest * ehRequest,
void* callbackParam)
{
+ (void)callbackParam;
OCEntityHandlerResult ehRet = OC_EH_ERROR;
if(NULL == ehRequest)
PROVISION_CREDENTIALS | PROVISION_ACLS), // OicSecDpm_t cm
(OicSecDpm_t)(TAKE_OWNER | BOOTSTRAP_SERVICE | SECURITY_MANAGEMENT_SERVICES |
PROVISION_CREDENTIALS | PROVISION_ACLS), // OicSecDpm_t tm
- {}, // OicUuid_t deviceID
+ {.id = {0}}, // OicUuid_t deviceID
SINGLE_SERVICE_CLIENT_DRIVEN, // OicSecDpom_t om */
1, // the number of elts in Sms
&gSm, // OicSecDpom_t *sm
cJSON_AddItemToObject(jsonPstat, OIC_JSON_SM_NAME, jsonSmArray = cJSON_CreateArray());
VERIFY_NON_NULL(TAG, jsonSmArray, INFO);
- for (int i = 0; i < pstat->smLen; i++)
+ for (size_t i = 0; i < pstat->smLen; i++)
{
cJSON_AddItemToArray(jsonSmArray, cJSON_CreateNumber((int )pstat->sm[i]));
}
if (cJSON_Array == jsonObj->type)
{
pstat->smLen = cJSON_GetArraySize(jsonObj);
- int idxx = 0;
+ size_t idxx = 0;
VERIFY_SUCCESS(TAG, pstat->smLen != 0, ERROR);
pstat->sm = (OicSecDpom_t*)OICCalloc(pstat->smLen, sizeof(OicSecDpom_t));
VERIFY_NON_NULL(TAG, pstat->sm, ERROR);
OCEntityHandlerRequest * ehRequest,
void *callbackParam)
{
+ (void)callbackParam;
OCEntityHandlerResult ehRet = OC_EH_ERROR;
// This method will handle REST request (GET/POST) for /oic/sec/pstat
if (flag & OC_REQUEST_FLAG)
OCEntityHandlerResult ehRet, const char *rspPayload)
{
OC_LOG (INFO, TAG, PCF("SRM sending SRM response"));
- OCEntityHandlerResponse response = {};
+ OCEntityHandlerResponse response = {0};
if (ehRequest)
{
- OCSecurityPayload ocPayload = {};
+ OCSecurityPayload ocPayload = {.base = {.type = PAYLOAD_TYPE_INVALID}};
response.requestHandle = ehRequest->requestHandle;
response.resourceHandle = ehRequest->resource;
}
// Copy the subjectID
- OicUuid_t subjectId = {};
+ OicUuid_t subjectId = {.id = {0}};
memcpy(subjectId.id, endPoint->identity.id, sizeof(subjectId.id));
//Check the URI has the query and skip it before checking the permission
}
// Form a 'access deny' or 'Error' response and send to peer
- CAResponseInfo_t responseInfo = {};
+ CAResponseInfo_t responseInfo = {.result = CA_EMPTY};
memcpy(&responseInfo.info, &(requestInfo->info), sizeof(responseInfo.info));
responseInfo.info.payload = NULL;
if (!gRequestHandler)
OicUuid_t owners[1];
OICStrcpy((char *)owners[0].id, sizeof(owners[0].id), "ownersId21");
- OicUuid_t subject = {};
+ OicUuid_t subject = {0};
OICStrcpy((char *)subject.id, sizeof(subject.id), "subject11");
char privateKey[] = "My private Key11";
OicUuid_t owners[1];
OICStrcpy((char *)owners[0].id, sizeof(owners[0].id), "ownersId11");
- OicUuid_t subject = {};
+ OicUuid_t subject = {0};
OICStrcpy((char *)subject.id, sizeof(subject.id), "subject11");
char privateKey[] = "My private Key11";
{
EXPECT_EQ(OC_STACK_INVALID_PARAM, InitDoxmResource());
char query[] = "oxm=0&owned=false&owner=owner1";
- OCEntityHandlerRequest req = {};
+ OCEntityHandlerRequest req = {0};
req.method = OC_REST_GET;
req.query = OICStrdup(query);
EXPECT_EQ(OC_EH_ERROR, DoxmEntityHandler(OCEntityHandlerFlag::OC_REQUEST_FLAG, &req));
using namespace std;
// Helper Methods
-void UTRequestHandler(const CAEndpoint_t *endPoint, const CARequestInfo_t *requestInfo)
+void UTRequestHandler(const CAEndpoint_t * /*endPoint*/,
+ const CARequestInfo_t * /*requestInfo*/)
{
EXPECT_TRUE(true) << "UTRequestHandler\n";
}
-void UTResponseHandler(const CAEndpoint_t *endPoint, const CAResponseInfo_t *responseInfo)
+void UTResponseHandler(const CAEndpoint_t * /*endPoint*/,
+ const CAResponseInfo_t * /*responseInfo*/)
{
EXPECT_TRUE(true) << "UTResponseHandler\n";
}
-void UTErrorHandler(const CAEndpoint_t *endPoint, const CAErrorInfo_t *errorInfo)
+void UTErrorHandler(const CAEndpoint_t * /*endPoint*/,
+ const CAErrorInfo_t * /*errorInfo*/)
{
EXPECT_TRUE(true) << "UTErrorHandler\n";
}
TEST(ParseRestQueryTest, ParseRestQueryEmpty)
{
unsigned char query[] = "";
- OicParseQueryIter_t parseIter = {};
+ OicParseQueryIter_t parseIter = {0};
ParseQueryIterInit(query, &parseIter);
EXPECT_EQ(NULL, GetNextQuery(&parseIter));
}
char attr[10], val[10];
unsigned char query[] = "owned=false";
- OicParseQueryIter_t parseIter = {};
+ OicParseQueryIter_t parseIter = {0};
ParseQueryIterInit(query, &parseIter);
EXPECT_NE((OicParseQueryIter_t *)NULL, GetNextQuery(&parseIter));
char attr[10], val[10];
unsigned char query[] = "oxm=0&owned=true&owner=owner1";
- OicParseQueryIter_t parseIter = {};
+ OicParseQueryIter_t parseIter = {0};
ParseQueryIterInit(query, &parseIter);
printf("\n");
while(GetNextQuery(&parseIter))
}
printf("\n");
}
-
return ret;
}
-OCStackApplicationResult putReqCB(void* ctx, OCDoHandle handle, OCClientResponse * clientResponse)
+OCStackApplicationResult putReqCB(void* ctx, OCDoHandle /*handle*/,
+ OCClientResponse * clientResponse)
{
if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
{
return OC_STACK_DELETE_TRANSACTION;
}
-OCStackApplicationResult postReqCB(void *ctx, OCDoHandle handle, OCClientResponse *clientResponse)
+OCStackApplicationResult postReqCB(void *ctx, OCDoHandle /*handle*/,
+ OCClientResponse *clientResponse)
{
if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
{
}
OCStackApplicationResult deleteReqCB(void *ctx,
- OCDoHandle handle, OCClientResponse *clientResponse)
+ OCDoHandle /*handle*/,
+ OCClientResponse *clientResponse)
{
if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
{
return OC_STACK_DELETE_TRANSACTION;
}
-OCStackApplicationResult getReqCB(void* ctx, OCDoHandle handle, OCClientResponse * clientResponse)
+OCStackApplicationResult getReqCB(void* ctx, OCDoHandle /*handle*/,
+ OCClientResponse * clientResponse)
{
if(clientResponse == NULL)
{
return OC_STACK_DELETE_TRANSACTION;
}
-OCStackApplicationResult obsReqCB(void* ctx, OCDoHandle handle, OCClientResponse * clientResponse)
+OCStackApplicationResult obsReqCB(void* ctx, OCDoHandle /*handle*/,
+ OCClientResponse * clientResponse)
{
if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
{
return OC_STACK_KEEP_TRANSACTION;
}
#ifdef WITH_PRESENCE
-OCStackApplicationResult presenceCB(void* ctx, OCDoHandle handle, OCClientResponse * clientResponse)
+OCStackApplicationResult presenceCB(void* ctx, OCDoHandle /*handle*/,
+ OCClientResponse * clientResponse)
{
if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
{
#endif
// This is a function called back when a device is discovered
-OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle handle,
+OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle /*handle*/,
OCClientResponse * clientResponse)
{
if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
return OC_STACK_KEEP_TRANSACTION;
}
-OCStackApplicationResult PlatformDiscoveryReqCB (void* ctx, OCDoHandle handle,
+OCStackApplicationResult PlatformDiscoveryReqCB (void* ctx,
+ OCDoHandle /*handle*/,
OCClientResponse * clientResponse)
{
if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
return (UNICAST_DISCOVERY) ? OC_STACK_DELETE_TRANSACTION : OC_STACK_KEEP_TRANSACTION;
}
-OCStackApplicationResult DeviceDiscoveryReqCB (void* ctx, OCDoHandle handle,
+OCStackApplicationResult DeviceDiscoveryReqCB (void* ctx, OCDoHandle /*handle*/,
OCClientResponse * clientResponse)
{
if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
}
}
-std::string getQueryStrForGetPut(OCClientResponse * clientResponse)
+std::string getQueryStrForGetPut(OCClientResponse * /*clientResponse*/)
{
return "/a/light";
coapServerPort = getPortTBServer(clientResponse);
coapServerResource = getQueryStrForGetPut(clientResponse);
}
-
return ret;
}
-OCStackApplicationResult putReqCB(void* ctx, OCDoHandle handle,
+OCStackApplicationResult putReqCB(void* ctx, OCDoHandle /*handle*/,
OCClientResponse * clientResponse)
{
if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
return OC_STACK_DELETE_TRANSACTION;
}
-OCStackApplicationResult postReqCB(void *ctx, OCDoHandle handle,
+OCStackApplicationResult postReqCB(void *ctx, OCDoHandle /*handle*/,
OCClientResponse *clientResponse)
{
if(ctx == (void*)DEFAULT_CONTEXT_VALUE)
return OC_STACK_DELETE_TRANSACTION;
}
-OCStackApplicationResult getReqCB(void* ctx, OCDoHandle handle,
+OCStackApplicationResult getReqCB(void* ctx, OCDoHandle /*handle*/,
OCClientResponse * clientResponse)
{
if (ctx == (void*) DEFAULT_CONTEXT_VALUE)
/*
* This is a function called back when a device is discovered
*/
-OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle handle,
+OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle /*handle*/,
OCClientResponse * clientResponse)
{
if (ctx == (void*)DEFAULT_CONTEXT_VALUE)
"unavailable resource using link list interface.");
}
-OCStackApplicationResult putReqCB(void* ctx, OCDoHandle handle, OCClientResponse * clientResponse)
+OCStackApplicationResult putReqCB(void* ctx, OCDoHandle /*handle*/,
+ OCClientResponse * clientResponse)
{
if(clientResponse == NULL)
{
return OC_STACK_KEEP_TRANSACTION;
}
-OCStackApplicationResult getReqCB(void* ctx, OCDoHandle handle, OCClientResponse * clientResponse)
+OCStackApplicationResult getReqCB(void* ctx, OCDoHandle /*handle*/,
+ OCClientResponse * clientResponse)
{
OC_LOG_V(INFO, TAG, "StackResult: %s",
getResult(clientResponse->result));
// This is a function called back when a device is discovered
-OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle handle,
+OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle /*handle*/,
OCClientResponse * clientResponse)
{
OC_LOG(INFO, TAG,
return ehResult;
}
-OCEntityHandlerResult ProcessNonExistingResourceRequest(OCEntityHandlerRequest *ehRequest)
+OCEntityHandlerResult ProcessNonExistingResourceRequest(OCEntityHandlerRequest * /*ehRequest*/)
{
OC_LOG_V(INFO, TAG, "\n\nExecuting %s ", __func__);
OCEntityHandlerResult
OCDeviceEntityHandlerCb (OCEntityHandlerFlag flag,
- OCEntityHandlerRequest *entityHandlerRequest, char* uri, void* callbackParam)
+ OCEntityHandlerRequest *entityHandlerRequest,
+ char* uri,
+ void* /*callbackParam*/)
{
OC_LOG_V (INFO, TAG, "Inside device default entity handler - flags: 0x%x, uri: %s", flag, uri);
}
OCEntityHandlerResult
-OCNOPEntityHandlerCb (OCEntityHandlerFlag flag,
- OCEntityHandlerRequest *entityHandlerRequest, void* callbackParam)
+OCNOPEntityHandlerCb (OCEntityHandlerFlag /*flag*/,
+ OCEntityHandlerRequest * /*entityHandlerRequest*/,
+ void* /*callbackParam*/)
{
// This is callback is associated with the 2 presence notification
// resources. They are non-operational.
OCEntityHandlerResult
OCEntityHandlerCb (OCEntityHandlerFlag flag,
- OCEntityHandlerRequest *entityHandlerRequest,void* callbackParam)
+ OCEntityHandlerRequest *entityHandlerRequest,
+ void* /*callbackParam*/)
{
OC_LOG_V (INFO, TAG, "Inside entity handler - flags: 0x%x", flag);
OCEntityHandlerResult ehResult = OC_EH_ERROR;
- OCEntityHandlerResponse response = {};
+ OCEntityHandlerResponse response = {0};
// Validate pointer
if (!entityHandlerRequest)
}
}
-int main(int argc, char* argv[])
+int main(int /*argc*/, char* /*argv*/[])
{
OC_LOG(DEBUG, TAG, "OCServer is starting...");
if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK)
}
static OCStackResult
-HandleLinkedListInterface(OCEntityHandlerRequest *ehRequest, uint8_t filterOn, char *filterValue)
+HandleLinkedListInterface(OCEntityHandlerRequest *ehRequest,
+ uint8_t filterOn,
+ char *filterValue)
{
+ (void)filterOn;
+ (void)filterValue;
if(!ehRequest)
{
return OC_STACK_INVALID_PARAM;
if(ret == OC_STACK_OK)
{
- OCEntityHandlerResponse response = {};
+ OCEntityHandlerResponse response = {0};
response.ehResult = OC_EH_OK;
response.payload = (OCPayload*)payload;
response.persistentBufferFlag = 0;
if(stackRet == OC_STACK_OK)
{
- OCEntityHandlerResponse response = {};
+ OCEntityHandlerResponse response = {0};
response.ehResult = OC_EH_OK;
response.payload = (OCPayload*)payload;
response.persistentBufferFlag = 0;
ResourceObserver * resourceObserver = serverObsList;
uint8_t numObs = 0;
OCServerRequest * request = NULL;
- OCEntityHandlerRequest ehRequest = {};
+ OCEntityHandlerRequest ehRequest = {0};
OCEntityHandlerResult ehResult = OC_EH_ERROR;
bool observeErrorFlag = false;
}
else
{
- OCEntityHandlerResponse ehResponse = {};
+ OCEntityHandlerResponse ehResponse = {0};
//This is effectively the implementation for the presence entity handler.
OC_LOG(DEBUG, TAG, PCF("This notification is for Presence"));
uint32_t maxAge,
OCQualityOfService qos)
{
+ (void)maxAge;
if(!resource || !obsIdList || !payload)
{
return OC_STACK_INVALID_PARAM;
request->observeResult = OC_STACK_OK;
if(result == OC_STACK_OK)
{
- OCEntityHandlerResponse ehResponse = {};
+ OCEntityHandlerResponse ehResponse = {0};
ehResponse.ehResult = OC_EH_OK;
ehResponse.payload = (OCPayload*)OCRepPayloadCreate();
if(!ehResponse.payload)
return OC_STACK_NO_MEMORY;
}
- CborEncoder encoder = {};
+ CborEncoder encoder = {0};
bool err = false;
size_t resourceCount = OCDiscoveryPayloadGetResourceCount(payload);
return OC_STACK_NO_MEMORY;
}
- CborEncoder encoder = {};
+ CborEncoder encoder = {0};
bool err = false;
cbor_encoder_init(&encoder, *outPayload, *size, 0);
return OC_STACK_NO_MEMORY;
}
- CborEncoder encoder = {};
+ CborEncoder encoder = {0};
bool err = false;
cbor_encoder_init(&encoder, *outPayload, *size, 0);
return OC_STACK_NO_MEMORY;
}
- CborEncoder encoder = {};
+ CborEncoder encoder = {0};
bool err = false;
cbor_encoder_init(&encoder, *outPayload, *size, 0);
return OC_STACK_NO_MEMORY;
}
- CborEncoder encoder = {};
+ CborEncoder encoder = {0};
bool err = false;
cbor_encoder_init(&encoder, *outPayload, *size, 0);
if(cbor_value_is_map(arrayVal))
{
char* uri = NULL;
- OCPlatformInfo info = {};
+ OCPlatformInfo info = {0};
CborValue curVal;
err = err || cbor_value_map_find_value(arrayVal, OC_RSRVD_HREF, &curVal);
size_t len;
err = err || cbor_value_map_find_value(repParent, OC_RSRVD_PROPERTY, &curVal);
if(cbor_value_is_valid(&curVal))
{
- CborValue insidePropArray = {};
+ CborValue insidePropArray = {0};
err = err || cbor_value_map_find_value(&curVal, OC_RSRVD_RESOURCE_TYPE,
&insidePropArray);
TAG, PCF(#arg " is NULL")); return (retVal); } }
extern OCResource *headResource;
-static OCPlatformInfo savedPlatformInfo = {};
-static OCDeviceInfo savedDeviceInfo = {};
+static OCPlatformInfo savedPlatformInfo = {0};
+static OCDeviceInfo savedDeviceInfo = {0};
//-----------------------------------------------------------------------------
// Default resource entity handler function
OCStackResult SendNonPersistantDiscoveryResponse(OCServerRequest *request, OCResource *resource,
OCPayload *discoveryPayload, OCEntityHandlerResult ehResult)
{
- OCEntityHandlerResponse response = {};
+ OCEntityHandlerResponse response = {0};
response.ehResult = ehResult;
response.payload = discoveryPayload;
OCStackResult result = OC_STACK_OK;
OCEntityHandlerResult ehResult = OC_EH_ERROR;
- OCEntityHandlerRequest ehRequest = {};
+ OCEntityHandlerRequest ehRequest = {0};
OC_LOG(INFO, TAG, PCF("Entering HandleResourceWithDefaultDeviceEntityHandler"));
result = FormOCEntityHandlerRequest(&ehRequest,
OCEntityHandlerFlag ehFlag = OC_REQUEST_FLAG;
ResourceObserver *resObs = NULL;
- OCEntityHandlerRequest ehRequest = {};
+ OCEntityHandlerRequest ehRequest = {0};
OC_LOG(INFO, TAG, PCF("Entering HandleResourceWithEntityHandler"));
}
OCStackResult result = OC_STACK_ERROR;
- OCEntityHandlerRequest ehRequest = {};
+ OCEntityHandlerRequest ehRequest = {0};
result = FormOCEntityHandlerRequest(&ehRequest,
(OCRequestHandle)request,
OCStackResult HandleSingleResponse(OCEntityHandlerResponse * ehResponse)
{
OCStackResult result = OC_STACK_ERROR;
- CAEndpoint_t responseEndpoint = {};
- CAResponseInfo_t responseInfo = {};
+ CAEndpoint_t responseEndpoint = {.adapter = CA_DEFAULT_ADAPTER};
+ CAResponseInfo_t responseInfo = {.result = CA_EMPTY};
CAHeaderOption_t* optionsPointer = NULL;
if(!ehResponse || !ehResponse->requestHandle)
{
OCStackResult result = OC_STACK_ERROR;
ResourceObserver * observer = NULL;
- OCEntityHandlerRequest ehRequest = {};
+ OCEntityHandlerRequest ehRequest = {0};
switch(status)
{
OCStackApplicationResult cbResult = OC_STACK_DELETE_TRANSACTION;
ClientCB * cbNode = NULL;
char *resourceTypeName = NULL;
- OCClientResponse response = {};
+ OCClientResponse response = {.devAddr = {.adapter = OC_DEFAULT_ADAPTER}};
OCStackResult result = OC_STACK_ERROR;
uint32_t maxAge = 0;
int uriLen;
else
{
// check for multiicast presence
- CAEndpoint_t ep = { endpoint->adapter, endpoint->flags };
+ CAEndpoint_t ep = { .adapter = endpoint->adapter,
+ .flags = endpoint->flags };
OICStrcpy(ep.addr, sizeof(ep.addr), OC_MULTICAST_IP);
ep.port = OC_MULTICAST_PORT;
OC_LOG(INFO, TAG, PCF("Receiving A Timeout for this token"));
OC_LOG(INFO, TAG, PCF("Calling into application address space"));
- OCClientResponse response = {};
+ OCClientResponse response =
+ {.devAddr = {.adapter = OC_DEFAULT_ADAPTER}};
CopyEndpointToDevAddr(endPoint, &response.devAddr);
FixUpClientResponse(&response);
response.resourceUri = responseInfo->info.resourceUri;
OC_LOG(INFO, TAG, PCF("This is a regular response, A client call back is found"));
OC_LOG(INFO, TAG, PCF("Calling into application address space"));
- OCClientResponse response = {};
+ OCClientResponse response =
+ {.devAddr = {.adapter = OC_DEFAULT_ADAPTER}};
response.sequenceNumber = OC_OBSERVE_NO_OPTION;
CopyEndpointToDevAddr(endPoint, &response.devAddr);
FixUpClientResponse(&response);
const uint8_t numOptions, const CAHeaderOption_t *options,
CAToken_t token, uint8_t tokenLength)
{
- CAResponseInfo_t respInfo = {};
- respInfo.result = responseResult;
+ CAResponseInfo_t respInfo = {
+ .result = responseResult
+ };
respInfo.info.messageId = coapID;
respInfo.info.numOptions = numOptions;
respInfo.info.options = (CAHeaderOption_t*)options;
return;
}
- OCServerProtocolRequest serverRequest = {};
+ OCServerProtocolRequest serverRequest = {0};
OC_LOG_V(INFO, TAG, PCF("Endpoint URI : %s"), requestInfo->info.resourceUri);
OCTransportAdapter adapter;
OCTransportFlags flags;
// the request contents are put here
- CARequestInfo_t requestInfo = { CA_GET };
+ CARequestInfo_t requestInfo = {.method = CA_GET};
// requestUri will be parsed into the following three variables
OCDevAddr *devAddr = NULL;
char *resourceUri = NULL;
OCStackResult ret = OC_STACK_OK;
CAEndpoint_t* endpoint = NULL;
CAResult_t caResult;
- CAInfo_t requestData = {};
- CARequestInfo_t requestInfo = {};
+ CAInfo_t requestData = {.type = CA_MSG_CONFIRM};
+ CARequestInfo_t requestInfo = {.method = CA_GET};
if(!handle)
{
CAResult_t caResult = CA_STATUS_OK;
CAEndpoint_t* endpoint = NULL;
- CAInfo_t requestData ={};
- CARequestInfo_t requestInfo = {};
+ CAInfo_t requestData = {.type = CA_MSG_CONFIRM};
+ CARequestInfo_t requestInfo = {.method = CA_GET};
OC_LOG(DEBUG, TAG, PCF("time to test server presence"));
OCStackApplicationResult ActionSetCB(void* context, OCDoHandle handle,
OCClientResponse* clientResponse)
{
+ (void)context;
+ (void)clientResponse;
OC_LOG(INFO, TAG, PCF("Entering BuildActionJSON"));
ClientRequestInfo *info = GetClientRequestInfo(clientRequstList, handle);
void ActionSetCD(void *context)
{
+ (void)context;
}
OCStackResult BuildActionJSON(OCAction* action, unsigned char* bufferPtr,
OCStackResult SendAction(OCDoHandle *handle, const char *targetUri,
const unsigned char *action)
{
+ (void)handle;
+ (void)targetUri;
+ (void)action;
// TODO: disabled since this is no longer compatible
return OC_STACK_NOTIMPL;
}
int oc_console_logger_init(oc_log_ctx_t *ctx, void *world)
{
+ (void)world;
oc_console_logger_ctx *my_ctx;
my_ctx = (oc_console_logger_ctx *)malloc(sizeof(oc_console_logger_ctx));
void oc_console_logger_set_level(oc_log_ctx_t *ctx, const int level)
{
+ (void)ctx;
+ (void)level;
/* We don't have any special thing we need to do when a log level changes. */
return;
}
int oc_console_logger_set_module(oc_log_ctx_t *ctx, const char *module_name)
{
+ (void)ctx;
+ (void)module_name;
/* We don't do anything special when the module name changes: */
return 1;
}
{
}
-void oc_ostream_log_set_level(oc_log_ctx_t *ctx, const int level)
+void oc_ostream_log_set_level(oc_log_ctx_t * /*ctx*/, const int /*level*/)
try
{
/* We don't have any special thing we need to do when a log level changes. */
return 0;
}
-int oc_ostream_log_set_module(oc_log_ctx_t *ctx, const char *module_name)
+int oc_ostream_log_set_module(oc_log_ctx_t * /*ctx*/,
+ const char * /*module_name*/)
try
{
// Nothing special needs to happen for a module name change:
}
- OCStackApplicationResult listenCallback(void* ctx, OCDoHandle handle,
+ OCStackApplicationResult listenCallback(void* ctx, OCDoHandle /*handle*/,
OCClientResponse* clientResponse)
{
ClientCallbackContext::ListenContext* context =
return result;
}
- OCStackApplicationResult listenDeviceCallback(void* ctx, OCDoHandle handle,
+ OCStackApplicationResult listenDeviceCallback(void* ctx,
+ OCDoHandle /*handle*/,
OCClientResponse* clientResponse)
{
ClientCallbackContext::DeviceListenContext* context =
}
}
- OCStackApplicationResult getResourceCallback(void* ctx, OCDoHandle handle,
+ OCStackApplicationResult getResourceCallback(void* ctx,
+ OCDoHandle /*handle*/,
OCClientResponse* clientResponse)
{
ClientCallbackContext::GetContext* context =
}
- OCStackApplicationResult setResourceCallback(void* ctx, OCDoHandle handle,
+ OCStackApplicationResult setResourceCallback(void* ctx,
+ OCDoHandle /*handle*/,
OCClientResponse* clientResponse)
{
ClientCallbackContext::SetContext* context =
return result;
}
- OCStackApplicationResult deleteResourceCallback(void* ctx, OCDoHandle handle,
+ OCStackApplicationResult deleteResourceCallback(void* ctx,
+ OCDoHandle /*handle*/,
OCClientResponse* clientResponse)
{
ClientCallbackContext::DeleteContext* context =
OCStackResult InProcClientWrapper::DeleteResource(
const OCDevAddr& devAddr,
const std::string& uri,
- const HeaderOptions& headerOptions, DeleteCallback& callback, QualityOfService QoS)
+ const HeaderOptions& headerOptions,
+ DeleteCallback& callback,
+ QualityOfService /*QoS*/)
{
if(!callback)
{
return result;
}
- OCStackApplicationResult observeResourceCallback(void* ctx, OCDoHandle handle,
+ OCStackApplicationResult observeResourceCallback(void* ctx,
+ OCDoHandle /*handle*/,
OCClientResponse* clientResponse)
{
ClientCallbackContext::ObserveContext* context =
OCStackResult InProcClientWrapper::CancelObserveResource(
OCDoHandle handle,
- const std::string& host, // unused
- const std::string& uri, // unused
+ const std::string& /*host*/,
+ const std::string& /*uri*/,
const HeaderOptions& headerOptions,
QualityOfService QoS)
{
return result;
}
- OCStackApplicationResult subscribePresenceCallback(void* ctx, OCDoHandle handle,
+ OCStackApplicationResult subscribePresenceCallback(void* ctx,
+ OCDoHandle /*handle*/,
OCClientResponse* clientResponse)
{
ClientCallbackContext::SubscribePresenceContext* context =