extern OCResource *headResource;
static cJSON *savedDeviceInfo = NULL;
-static const char * VIRTUAL_RSRCS[] = {
+static const char * VIRTUAL_RSRCS[] =
+{
"/oc/core",
"/oc/core/d",
"/oc/core/types/d",
// Default resource entity handler function
//-----------------------------------------------------------------------------
OCEntityHandlerResult defaultResourceEHandler(OCEntityHandlerFlag flag,
- OCEntityHandlerRequest * request) {
+ OCEntityHandlerRequest * request)
+{
//TODO ("Implement me!!!!");
// TODO: remove silence unused param warnings
(void) flag;
}
OCResource * pointer = headResource;
- while (pointer) {
- if (strcmp(resourceUri, pointer->uri) == 0) {
+ while (pointer)
+ {
+ if (strcmp(resourceUri, pointer->uri) == 0)
+ {
return pointer;
}
pointer = pointer->next;
//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------
-typedef enum {
- OC_STACK_UNINITIALIZED = 0, OC_STACK_INITIALIZED, OC_STACK_UNINIT_IN_PROGRESS
+typedef enum
+{
+ OC_STACK_UNINITIALIZED = 0,
+ OC_STACK_INITIALIZED,
+ OC_STACK_UNINIT_IN_PROGRESS
} OCStackState;
+
#ifdef WITH_PRESENCE
-typedef enum {
- OC_PRESENCE_UNINITIALIZED = 0, OC_PRESENCE_INITIALIZED
+typedef enum
+{
+ OC_PRESENCE_UNINITIALIZED = 0,
+ OC_PRESENCE_INITIALIZED
} OCPresenceState;
#endif
}
ipAddrStr = itr;
- while (*ipAddrStr) {
+ while (*ipAddrStr)
+ {
if (isdigit(*ipAddrStr))
{
ipAddr[index] *= 10;
// Make sure resourceProperties bitmask has allowed properties specified
if (resourceProperties
- > (OC_ACTIVE | OC_DISCOVERABLE | OC_OBSERVABLE | OC_SLOW | OC_SECURE)) {
+ > (OC_ACTIVE | OC_DISCOVERABLE | OC_OBSERVABLE | OC_SLOW | OC_SECURE))
+ {
OC_LOG(ERROR, TAG, PCF("Invalid property"));
return OC_STACK_INVALID_PARAM;
}
void insertResource(OCResource *resource)
{
- if (!headResource) {
+ if (!headResource)
+ {
headResource = resource;
tailResource = resource;
}
CAResult_t retResult = CA_STATUS_FAILED;
CAResult_t caResult = CA_STATUS_OK;
- CAConnectivityType_t connTypes[] = {
- CA_ETHERNET,
- CA_WIFI,
- CA_EDR,
- CA_LE};
+ CAConnectivityType_t connTypes[] = {CA_ETHERNET, CA_WIFI, CA_EDR, CA_LE};
+
int numConnTypes = sizeof(connTypes)/sizeof(connTypes[0]);
for(int i = 0; i<numConnTypes; i++)