realigned some preprocess to the left.
authorjihwan.seo <jihwan.seo@samsung.com>
Thu, 3 Sep 2015 14:08:00 +0000 (23:08 +0900)
committerJon A. Cruz <jonc@osg.samsung.com>
Fri, 4 Sep 2015 19:30:19 +0000 (19:30 +0000)
it can be gaven some confusion.

Change-Id: If3b228b404e830fad23ce793334723d0e0f92e89
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2366
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
resource/csdk/connectivity/api/cacommon.h
resource/csdk/connectivity/src/caconnectivitymanager.c
resource/csdk/connectivity/src/cainterfacecontroller.c
resource/csdk/stack/include/octypes.h
resource/csdk/stack/samples/linux/SimpleClientServer/ocserver.cpp
resource/csdk/stack/src/ocserverrequest.c
resource/csdk/stack/src/ocstack.c

index 83fa96d..720720f 100644 (file)
@@ -137,9 +137,9 @@ typedef enum
     CA_ADAPTER_GATT_BTLE     = (1 << 1),   // GATT over Bluetooth LE
     CA_ADAPTER_RFCOMM_BTEDR  = (1 << 2),   // RFCOMM over Bluetooth EDR
 
-    #ifdef RA_ADAPTER
+#ifdef RA_ADAPTER
     CA_ADAPTER_REMOTE_ACCESS = (1 << 3),   // Remote Access over XMPP.
-    #endif
+#endif
 
     CA_ALL_ADAPTERS          = 0xffffffff
 } CATransportAdapter_t;
index 7f77d6b..ab9f35a 100644 (file)
@@ -248,14 +248,14 @@ CAResult_t CASelectNetwork(CATransportAdapter_t interestedNetwork)
         OIC_LOG_V(ERROR, TAG, "CAAddNetworkType(CA_GATT_ADAPTER) function returns error : %d", res);
     }
 
-    #ifdef RA_ADAPTER
+#ifdef RA_ADAPTER
     else if (interestedNetwork & CA_ADAPTER_REMOTE_ACCESS)
     {
         res = CAAddNetworkType(CA_ADAPTER_REMOTE_ACCESS);
         OIC_LOG_V(ERROR, TAG, "CAAddNetworkType(CA_ADAPTER_REMOTE_ACCESS) function returns error : %d",
                                                                     res);
     }
-    #endif
+#endif
     else
     {
         res = CA_NOT_SUPPORTED;
@@ -289,14 +289,14 @@ CAResult_t CAUnSelectNetwork(CATransportAdapter_t nonInterestedNetwork)
         res = CARemoveNetworkType(CA_ADAPTER_GATT_BTLE);
         OIC_LOG_V(ERROR, TAG, "CARemoveNetworkType(CA_GATT_ADAPTER) function returns error : %d", res);
     }
-    #ifdef RA_ADAPTER
+#ifdef RA_ADAPTER
     else if (nonInterestedNetwork & CA_ADAPTER_REMOTE_ACCESS)
     {
         res = CARemoveNetworkType(CA_ADAPTER_REMOTE_ACCESS);
         OIC_LOG_V(ERROR, TAG, "CARemoveNetworkType(CA_ADAPTER_REMOTE_ACCESS) function returns error : %d",
                                                 res);
     }
-    #endif
+#endif
     else
     {
         res = CA_STATUS_FAILED;
index 9b1f8d4..8f3c88c 100644 (file)
@@ -73,10 +73,10 @@ static int CAGetAdapterIndex(CATransportAdapter_t cType)
         case CA_ADAPTER_RFCOMM_BTEDR:
             return 2;
 
-        #ifdef RA_ADAPTER
+#ifdef RA_ADAPTER
         case CA_ADAPTER_REMOTE_ACCESS:
             return 3;
-        #endif
+#endif
 
         default:
             break;
index 839fd73..ea0df8d 100644 (file)
@@ -410,10 +410,10 @@ typedef enum
     /** RFCOMM over Bluetooth EDR.*/
     CT_ADAPTER_RFCOMM_BTEDR = (1 << 18),
 
-    #ifdef RA_ADAPTER
+#ifdef RA_ADAPTER
     /** Remote Access over XMPP.*/
     CT_ADAPTER_REMOTE_ACCESS = (1 << 19),
-    #endif
+#endif
 
     /** Insecure transport is the default (subject to change).*/
 
index e389280..66441a0 100644 (file)
@@ -952,7 +952,7 @@ int main(int argc, char* argv[])
         PrintUsage();
         return -1;
     }
-    #ifdef RA_ADAPTER
+#ifdef RA_ADAPTER
     OCRAInfo_t rainfo;
     rainfo.hostname = "localhost";
     rainfo.port = 5222;
@@ -963,7 +963,7 @@ int main(int argc, char* argv[])
     rainfo.user_jid = "";
 
     OCSetRAInfo(&rainfo);
-    #endif
+#endif
 
     OC_LOG(DEBUG, TAG, "OCServer is starting...");
 
index 12d0618..a3b4841 100644 (file)
@@ -541,15 +541,15 @@ OCStackResult HandleSingleResponse(OCEntityHandlerResponse * ehResponse)
         responseInfo.info.payloadSize = 0;
     }
 
-    #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
     CATransportAdapter_t CAConnTypes[] = {
                             CA_ADAPTER_IP,
                             CA_ADAPTER_GATT_BTLE,
                             CA_ADAPTER_RFCOMM_BTEDR
 
-                            #ifdef RA_ADAPTER
+#ifdef RA_ADAPTER
                             , CA_ADAPTER_REMOTE_ACCESS
-                            #endif
+#endif
                         };
 
     int size = sizeof(CAConnTypes)/ sizeof(CATransportAdapter_t);
@@ -567,9 +567,9 @@ OCStackResult HandleSingleResponse(OCEntityHandlerResponse * ehResponse)
                 CA_ADAPTER_GATT_BTLE    |
                 CA_ADAPTER_RFCOMM_BTEDR
 
-                #ifdef RA_ADAP
+#ifdef RA_ADAP
                 | CA_ADAPTER_REMOTE_ACCESS
-                #endif
+#endif
             );
     }
 
@@ -588,7 +588,7 @@ OCStackResult HandleSingleResponse(OCEntityHandlerResponse * ehResponse)
             }
         }
     }
-    #else
+#else
 
     OC_LOG(INFO, TAG, PCF("Calling CASendResponse with:"));
     OC_LOG_V(INFO, TAG, "\tEndpoint address: %s", responseEndpoint.addr);
@@ -606,7 +606,7 @@ OCStackResult HandleSingleResponse(OCEntityHandlerResponse * ehResponse)
     {
         result = OC_STACK_OK;
     }
-    #endif
+#endif
 
     OICFree(responseInfo.info.payload);
     OICFree(responseInfo.info.options);
index 7026d7d..6c46302 100644 (file)
@@ -1693,11 +1693,11 @@ OCStackResult OCStop()
 
     stackState = OC_STACK_UNINIT_IN_PROGRESS;
 
-    #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
     // Ensure that the TTL associated with ANY and ALL presence notifications originating from
     // here send with the code "OC_STACK_PRESENCE_STOPPED" result.
     presenceResource.presenceTTL = 0;
-    #endif // WITH_PRESENCE
+#endif // WITH_PRESENCE
 
     // Free memory dynamically allocated for resources
     deleteAllResources();
@@ -2058,13 +2058,13 @@ OCStackResult OCDoResource(OCDoHandle *handle,
         // CA_DISCOVER will become GET and isMulticast
         requestInfo.method = CA_GET;
         break;
-    #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
     case OC_REST_PRESENCE:
         // Replacing method type with GET because "presence"
         // is a stack layer only implementation.
         requestInfo.method = CA_GET;
         break;
-    #endif
+#endif
     default:
         result = OC_STACK_INVALID_METHOD;
         goto exit;
@@ -2152,7 +2152,7 @@ OCStackResult OCDoResource(OCDoHandle *handle,
     }
 
     // prepare for response
-    #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
     if (method == OC_REST_PRESENCE)
     {
         char *presenceUri = NULL;
@@ -2167,7 +2167,7 @@ OCStackResult OCDoResource(OCDoHandle *handle,
         // look for callbacks into the application.
         resourceUri = presenceUri;
     }
-    #endif
+#endif
 
     ttl = GetTicks(MAX_CB_TIMEOUT_SECONDS * MILLISECONDS_PER_SECOND);
     result = AddClientCB(&clientCB, cbData, token, tokenLength, &resHandle,
@@ -2301,11 +2301,11 @@ OCStackResult OCCancel(OCDoHandle handle, OCQualityOfService qos, OCHeaderOption
             ret = CAResultToOCResult (caResult);
             break;
 
-        #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
         case OC_REST_PRESENCE:
             FindAndDeleteClientCB(clientCB);
             break;
-        #endif
+#endif
 
         default:
             ret = OC_STACK_INVALID_METHOD;
@@ -2456,9 +2456,9 @@ exit:
 
 OCStackResult OCProcess()
 {
-    #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
     OCProcessPresence();
-    #endif
+#endif
     CAHandleRequestResponse();
 
     return OC_STACK_OK;
@@ -2701,13 +2701,13 @@ OCStackResult OCCreateResource(OCResourceHandle *handle,
     *handle = pointer;
     result = OC_STACK_OK;
 
-    #ifdef WITH_PRESENCE
-    if(presenceResource.handle)
+#ifdef WITH_PRESENCE
+    if (presenceResource.handle)
     {
         ((OCResource *)presenceResource.handle)->sequenceNum = OCGetRandom();
         SendPresenceNotification(pointer->rsrcType, OC_PRESENCE_TRIGGER_CREATE);
     }
-    #endif
+#endif
 exit:
     if (result != OC_STACK_OK)
     {
@@ -2754,14 +2754,14 @@ OCStackResult OCBindResource(
             resource->rsrcResources[i] = (OCResource *) resourceHandle;
             OC_LOG(INFO, TAG, PCF("resource bound"));
 
-            #ifdef WITH_PRESENCE
-            if(presenceResource.handle)
+#ifdef WITH_PRESENCE
+            if (presenceResource.handle)
             {
                 ((OCResource *)presenceResource.handle)->sequenceNum = OCGetRandom();
                 SendPresenceNotification(((OCResource *) resourceHandle)->rsrcType,
                         OC_PRESENCE_TRIGGER_CHANGE);
             }
-            #endif
+#endif
             return OC_STACK_OK;
 
         }
@@ -2807,14 +2807,14 @@ OCStackResult OCUnBindResource(
             OC_LOG(INFO, TAG, PCF("resource unbound"));
 
             // Send notification when resource is unbounded successfully.
-            #ifdef WITH_PRESENCE
-            if(presenceResource.handle)
+#ifdef WITH_PRESENCE
+            if (presenceResource.handle)
             {
                 ((OCResource *)presenceResource.handle)->sequenceNum = OCGetRandom();
                 SendPresenceNotification(((OCResource *) resourceHandle)->rsrcType,
                         OC_PRESENCE_TRIGGER_CHANGE);
             }
-            #endif
+#endif
             return OC_STACK_OK;
         }
     }
@@ -2919,13 +2919,13 @@ OCStackResult OCBindResourceTypeToResource(OCResourceHandle handle,
 
     result = BindResourceTypeToResource(resource, resourceTypeName);
 
-    #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
     if(presenceResource.handle)
     {
         ((OCResource *)presenceResource.handle)->sequenceNum = OCGetRandom();
         SendPresenceNotification(resource->rsrcType, OC_PRESENCE_TRIGGER_CHANGE);
     }
-    #endif
+#endif
 
     return result;
 }
@@ -2946,13 +2946,13 @@ OCStackResult OCBindResourceInterfaceToResource(OCResourceHandle handle,
 
     result = BindResourceInterfaceToResource(resource, resourceInterfaceName);
 
-    #ifdef WITH_PRESENCE
-    if(presenceResource.handle)
+#ifdef WITH_PRESENCE
+    if (presenceResource.handle)
     {
         ((OCResource *)presenceResource.handle)->sequenceNum = OCGetRandom();
         SendPresenceNotification(resource->rsrcType, OC_PRESENCE_TRIGGER_CHANGE);
     }
-    #endif
+#endif
 
     return result;
 }
@@ -3141,13 +3141,13 @@ OCStackResult OCBindResourceHandler(OCResourceHandle handle,
     resource->entityHandler = entityHandler;
     resource->entityHandlerCallbackParam = callbackParam;
 
-    #ifdef WITH_PRESENCE
-    if(presenceResource.handle)
+#ifdef WITH_PRESENCE
+    if (presenceResource.handle)
     {
         ((OCResource *)presenceResource.handle)->sequenceNum = OCGetRandom();
         SendPresenceNotification(resource->rsrcType, OC_PRESENCE_TRIGGER_CHANGE);
     }
-    #endif
+#endif
 
     return OC_STACK_OK;
 }
@@ -3230,12 +3230,12 @@ OCStackResult OCNotifyAllObservers(OCResourceHandle handle, OCQualityOfService q
     uint32_t maxAge = 0;
 
     OC_LOG(INFO, TAG, PCF("Notifying all observers"));
-    #ifdef WITH_PRESENCE
-    if(handle == presenceResource.handle)
+#ifdef WITH_PRESENCE
+    if (handle == presenceResource.handle)
     {
         return OC_STACK_OK;
     }
-    #endif // WITH_PRESENCE
+#endif // WITH_PRESENCE
     VERIFY_NON_NULL(handle, ERROR, OC_STACK_ERROR);
 
     // Verify that the resource exists
@@ -3250,12 +3250,12 @@ OCStackResult OCNotifyAllObservers(OCResourceHandle handle, OCQualityOfService q
         incrementSequenceNumber(resPtr);
         method = OC_REST_OBSERVE;
         maxAge = MAX_OBSERVE_AGE;
-        #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
         result = SendAllObserverNotification (method, resPtr, maxAge,
                 OC_PRESENCE_TRIGGER_DELETE, NULL, qos);
-        #else
+#else
         result = SendAllObserverNotification (method, resPtr, maxAge, qos);
-        #endif
+#endif
         return result;
     }
 }
@@ -3362,7 +3362,7 @@ OCStackResult initResources()
     headResource = NULL;
     tailResource = NULL;
     // Init Virtual Resources
-    #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
     presenceResource.presenceTTL = OC_DEFAULT_PRESENCE_TTL_SECONDS;
 
     result = OCCreateResource(&presenceResource.handle,
@@ -3376,7 +3376,7 @@ OCStackResult initResources()
     result = OCChangeResourceProperty(
             &(((OCResource *) presenceResource.handle)->resourceProperties),
             OC_ACTIVE, 0);
-    #endif
+#endif
 
     if (result == OC_STACK_OK)
     {
@@ -3424,24 +3424,24 @@ void deleteAllResources()
     while (pointer)
     {
         temp = pointer->next;
-        #ifdef WITH_PRESENCE
-        if(pointer != (OCResource *) presenceResource.handle)
+#ifdef WITH_PRESENCE
+        if (pointer != (OCResource *) presenceResource.handle)
         {
-        #endif // WITH_PRESENCE
+#endif // WITH_PRESENCE
             deleteResource(pointer);
-        #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
         }
-        #endif // WITH_PRESENCE
+#endif // WITH_PRESENCE
         pointer = temp;
     }
 
     SRMDeInitSecureResources();
 
-    #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
     // Ensure that the last resource to be deleted is the presence resource. This allows for all
     // presence notification attributed to their deletion to be processed.
     deleteResource((OCResource *) presenceResource.handle);
-    #endif // WITH_PRESENCE
+#endif // WITH_PRESENCE
 }
 
 OCStackResult deleteResource(OCResource *resource)
@@ -3463,12 +3463,12 @@ OCStackResult deleteResource(OCResource *resource)
         {
             // Invalidate all Resource Properties.
             resource->resourceProperties = (OCResourceProperty) 0;
-            #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
             if(resource != (OCResource *) presenceResource.handle)
             {
-            #endif // WITH_PRESENCE
+#endif // WITH_PRESENCE
                 OCNotifyAllObservers((OCResourceHandle)resource, OC_HIGH_QOS);
-            #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
             }
 
             if(presenceResource.handle)
@@ -3476,7 +3476,7 @@ OCStackResult deleteResource(OCResource *resource)
                 ((OCResource *)presenceResource.handle)->sequenceNum = OCGetRandom();
                 SendPresenceNotification(resource->rsrcType, OC_PRESENCE_TRIGGER_DELETE);
             }
-            #endif
+#endif
             // Only resource in list.
             if (temp == headResource && temp == tailResource)
             {
@@ -3828,9 +3828,9 @@ CAResult_t OCSelectNetwork()
             CA_ADAPTER_RFCOMM_BTEDR,
             CA_ADAPTER_GATT_BTLE
 
-            #ifdef RA_ADAPTER
+#ifdef RA_ADAPTER
             ,CA_ADAPTER_REMOTE_ACCESS
-            #endif
+#endif
         };
     int numConnTypes = sizeof(connTypes)/sizeof(connTypes[0]);