Fix for Jira issues [IOT-1157, IOT-1194]
authorVeeraj Khokale <veeraj.sk@samsung.com>
Wed, 14 Sep 2016 09:45:34 +0000 (15:15 +0530)
committerAshok Babu Channa <ashok.channa@samsung.com>
Thu, 15 Sep 2016 12:24:01 +0000 (12:24 +0000)
[IOT-1157]: Added default case for mentioned switch statements.
[IOT-1194]: Removed unused structures and made
g_GatewayID in routingmanager.c as static.

Change-Id: I03ff080867d28e3d32a18bb74fa7a9a26e465774
Signed-off-by: Veeraj Khokale <veeraj.sk@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11775
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Abhishek Sharma <ce.abhishek@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/connectivity/src/bt_edr_adapter/android/caedrclient.c
resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrclient.c
resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c
resource/csdk/connectivity/src/cablockwisetransfer.c
resource/csdk/routing/src/routingmanager.c
resource/csdk/security/provisioning/ck_manager/include/ckm_info.h
resource/csdk/stack/include/internal/ocstackinternal.h

index 6a674ae..5ff9200 100644 (file)
@@ -71,27 +71,6 @@ static ca_mutex g_mutexObjectList = NULL;
  */
 static CAEDRErrorHandleCallback g_edrErrorHandler = NULL;
 
-typedef struct send_data
-{
-    char* address;
-    char* data;
-    uint32_t id;
-} data_t;
-
-/**
- @brief Thread context information for unicast, multicast and secured unicast server
- */
-typedef struct
-{
-    bool *stopFlag;
-    CAAdapterServerType_t type;
-} CAAdapterReceiveThreadContext_t;
-
-typedef struct
-{
-    bool *stopFlag;
-} CAAdapterAcceptThreadContext_t;
-
 /**
  * implement for BT-EDR adapter common method
  */
index e24e2ae..55bffcc 100644 (file)
@@ -237,6 +237,9 @@ void CAEDRSocketConnectionStateCallback(int result, bt_socket_connection_state_e
                 ca_mutex_unlock(g_edrDeviceListMutex);
             }
             break;
+
+        default:
+            OIC_LOG(ERROR, EDR_ADAPTER_TAG, "Unknown Bluetooth Socket connection state");
     }
 
     OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "OUT");
@@ -357,6 +360,9 @@ void CAEDRDeviceDiscoveryCallback(int result, bt_adapter_device_discovery_state_
                 }
             }
             break;
+
+        default:
+            OIC_LOG(ERROR, EDR_ADAPTER_TAG, "Unknown Bluetooth Adapter device discovery state");
     }
 
     OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "OUT");
index 94d4f8a..e7d0b68 100644 (file)
@@ -130,8 +130,9 @@ static bool CALECheckConnectionStateValue(jint state)
         case GATT_REQUEST_NOT_SUPPORTED:
         case GATT_WRITE_NOT_PERMITTED:
             return true;
+        default:
+            return false;
     }
-    return false;
 }
 
 void CALEClientSetScanInterval(int32_t intervalTime, int32_t workingCount)
index 60882e7..ed79118 100644 (file)
@@ -693,6 +693,8 @@ CAResult_t CASendErrorMessage(const coap_pdu_t *pdu, uint8_t status,
         case CA_MSG_ACKNOWLEDGE:
             sentMsgType = CA_MSG_CONFIRM;
             break;
+        default:
+            sentMsgType = CA_MSG_NONCONFIRM;
     }
 
     CAData_t *cloneData = NULL;
index 2292fda..eb465e1 100644 (file)
@@ -46,7 +46,7 @@
 /**
  * Unique gateway ID generated before hosting a gateway resource.
  */
-uint32_t g_GatewayID = 0;
+static uint32_t g_GatewayID = 0;
 
 /**
  * Used for assigning unique ID.to endpoint's connected to this gateway
index c5b1f80..d45be77 100644 (file)
@@ -64,12 +64,6 @@ typedef struct /*CA private key, CA certificate, other CA-related info*/
     long        numberOfRevoked;
 } CKMInfo_t;
 
-typedef struct /*CA private key, CA certificate, certificate revocation/white list*/
-{
-    uint32_t    CRLsize;
-    uint8_t     *certificateRevocationList;//should be allocated dynamically
-} CRLInfo_t;
-
 //General functions
 
 /**
index a8de15f..c093284 100644 (file)
@@ -136,33 +136,6 @@ typedef struct
 } OCServerProtocolRequest;
 
 /**
- * This structure will be created in occoap and passed up the stack on the client side.
- */
-typedef struct
-{
-    /** handle is retrieved by comparing the token-handle pair in the PDU.*/
-    ClientCB * cbNode;
-
-    /** This is how long this response is valid for (in seconds).*/
-    uint32_t maxAge;
-
-    /** This is the Uri of the resource. (ex. "coap://192.168.1.1/a/led").*/
-    char * fullUri;
-
-    /** This is the relative Uri of the resource. (ex. "/a/led").*/
-    char * rcvdUri;
-
-    /** This is the received payload.*/
-    char * bufRes;
-
-    /** This is the token received OTA.*/
-    CAToken_t rcvdToken;
-
-    /** this structure will be passed to client.*/
-    OCClientResponse * clientResponse;
-} OCResponse;
-
-/**
  * This typedef is to represent our Server Instance identification.
  */
 typedef uint8_t ServerID[16];