Update Snapshot(2018-03-07) 08/171908/1
authorAmit <amit.s12@samsung.com>
Thu, 8 Mar 2018 05:59:18 +0000 (11:29 +0530)
committerAmit <amit.s12@samsung.com>
Thu, 8 Mar 2018 05:59:18 +0000 (11:29 +0530)
Change-Id: Icc2692241f81dd8d7aa06ba779e2270d1c6ab750
Signed-off-by: Amit <amit.s12@samsung.com>
packaging/snapshot_history.txt
resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_vd.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleutil.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleutil.h
resource/csdk/stack/src/ocstack.c
service/resource-encapsulation/src/common/primitiveResource/src/RCSResourceAttributes.cpp

index a212b7f..be810ab 100755 (executable)
@@ -1,3 +1,9 @@
+http://suprem.sec.samsung.net/jira/browse/CONPRO-1247
+
+commit_info_2018-03-07.txt
+
+commit_id: 2a37bbe4849a4d147ed4a7e148b78ab40eb181aa
+----------------------------------------------------------------------------------------------------------------------------------
 http://suprem.sec.samsung.net/jira/browse/CONPRO-1243
 
 commit_info_2018-02-28.txt
index 6dd925a..0c9e88a 100644 (file)
@@ -1713,7 +1713,6 @@ static void SetupCipher(mbedtls_ssl_config * config, CATransportAdapter_t adapte
 
     // Add PSK ciphersuite
     if (true == g_caSslContext->cipherFlag[0] &&
-                SSL_CIPHER_MAX != g_caSslContext->cipher &&
                 MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 != tlsCipher[g_caSslContext->cipher][0])
     {
        g_cipherSuitesList[index] = MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256;
index 83acadc..cc6f208 100755 (executable)
@@ -121,11 +121,6 @@ static LEClientInfoList *g_LEClientList = NULL;
  */
 static oc_mutex g_LEClientListMutex = NULL;
 
-/**
- * State of connect state
- */
-static bool g_LEConnectedState = false;
-
 void CALEGattServerConnectionStateChanged(bool connected, const char *remoteAddress)
 {
     VERIFY_NON_NULL_VOID(remoteAddress, TAG, "remote address");
@@ -134,7 +129,6 @@ void CALEGattServerConnectionStateChanged(bool connected, const char *remoteAddr
     if (connected)
     {
         OIC_LOG_V(DEBUG, TAG, "Connected to [%s]", remoteAddress);
-        g_LEConnectedState = true;
         char *addr = OICStrdup(remoteAddress);
         oc_mutex_lock(g_LEClientListMutex);
         res  = CAAddLEClientInfoToList(&g_LEClientList, addr);
@@ -161,7 +155,6 @@ void CALEGattServerConnectionStateChanged(bool connected, const char *remoteAddr
     else
     {
         OIC_LOG_V(DEBUG, TAG, "Disconnected from [%s]", remoteAddress);
-        g_LEConnectedState = false;
         oc_mutex_lock(g_LEClientListMutex);
         CARemoveLEClientInfoFromList(&g_LEClientList, remoteAddress);
         oc_mutex_unlock(g_LEClientListMutex);
@@ -911,12 +904,15 @@ CAResult_t CAUpdateCharacteristicsToGattClient(const char *address, const uint8_
 
     oc_mutex_lock(g_leCharacteristicMutex);
 
-    if (!g_LEConnectedState)
+    oc_mutex_lock(g_LEClientListMutex);
+    if (CA_STATUS_FAILED == CAIsLEClientInfoInList(g_LEClientList, address))
     {
-        OIC_LOG(ERROR, TAG, "g_LEConnectedState is false");
+        OIC_LOG_V(ERROR, TAG, "%s device is not connected", address);
+        oc_mutex_unlock(g_LEClientListMutex);
         oc_mutex_unlock(g_leCharacteristicMutex);
         return CA_STATUS_FAILED;
     }
+    oc_mutex_unlock(g_LEClientListMutex);
 
     if (NULL  == g_gattReadCharPath)
     {
@@ -970,13 +966,6 @@ CAResult_t CAUpdateCharacteristicsToAllGattClients(const uint8_t *charValue, uin
 
     oc_mutex_lock(g_leCharacteristicMutex);
 
-    if (!g_LEConnectedState)
-    {
-        OIC_LOG(ERROR, TAG, "g_LEConnectedState is false");
-        oc_mutex_unlock(g_leCharacteristicMutex);
-        return CA_STATUS_FAILED;
-    }
-
     if (NULL  == g_gattReadCharPath)
     {
         OIC_LOG(ERROR, TAG, "g_gattReadCharPath is NULL");
index ae02a49..d64c925 100644 (file)
@@ -267,6 +267,25 @@ CAResult_t CAAddLEClientInfoToList(LEClientInfoList **clientList,
     return CA_STATUS_OK;
 }
 
+CAResult_t CAIsLEClientInfoInList(LEClientInfoList *clientList,
+                                        const char *clientAddress)
+{
+    OIC_LOG(DEBUG, TAG, "IN");
+
+    LEClientInfoList *temp = clientList;
+    while (temp)
+    {
+        if (!strcasecmp(temp->remoteAddress, clientAddress))
+        {
+            return CA_STATUS_OK;
+        }
+        temp = temp->next;
+    }
+
+    OIC_LOG(DEBUG, TAG, "OUT");
+    return CA_STATUS_FAILED;
+}
+
 void CARemoveLEClientInfoFromList(LEClientInfoList **clientList,
                                   const char *clientAddress)
 {
index ed51602..3b3daa0 100644 (file)
@@ -187,6 +187,17 @@ void CARemoveLEClientInfoFromList(LEClientInfoList **clientList,
                                         const char *clientAddress);
 
 /**
+ * Used to check if client address is present in the list.
+ *
+ * @param[in]    clientList     Pointer to the ble client list which holds the info of list of
+ *                              clients connected by the server.
+ * @param[in]    clientAddress  Remote address to be searched in the client list.
+ * @return ::CA_STATUS_OK if client address is found in the list, otherwise CA_STATUS_FAILED.
+ */
+CAResult_t CAIsLEClientInfoInList(LEClientInfoList *clientList,
+                                        const char *clientAddress);
+
+/**
  * Used to disconnect all the clients connected to the server.
  *
  * @param[in,out] clientList     Pointer to the ble client list which holds the info of list of
index 9ad65c2..c34b2f2 100644 (file)
@@ -3132,6 +3132,7 @@ OCStackResult OCDoRequest(OCDoHandle *handle,
         goto exit;
     }
 
+    cbData = NULL;        // Client CB list entry now owns it
     token = NULL;         // Client CB list entry now owns it
     devAddr = NULL;       // Client CB list entry now owns it
     resourceUri = NULL;   // Client CB list entry now owns it
@@ -3167,6 +3168,10 @@ exit:
     if (result != OC_STACK_OK)
     {
         OIC_LOG(ERROR, TAG, "OCDoResource error");
+        if (NULL != cbData && NULL != cbData->cd)
+        {
+            cbData->cd(cbData->context);
+        }
         FindAndDeleteClientCB(clientCB);
         CADestroyToken(token);
         if (handle)
index 75e9d56..1b2d876 100644 (file)
@@ -629,7 +629,7 @@ namespace OIC
 
         void RCSResourceAttributes::clear() noexcept
         {
-            return m_values.clear();
+           m_values.clear();
         }
 
         bool RCSResourceAttributes::erase(const std::string& key)