Addressed endpoint pointer type mismatches in LE adapter.
authorOssama Othman <ossama.othman@intel.com>
Fri, 11 Sep 2015 22:53:46 +0000 (15:53 -0700)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Tue, 15 Sep 2015 14:50:37 +0000 (14:50 +0000)
Corrected a pointer type mismatch in the BLE adapter implementation
introduced by commit 6c0321f5 where the endpoint parameter of the
network packet received callback was changed from CAEndpoint_t* to
CASecureEndpoint_t*.

Change-Id: Id7413f2085fe7e230be811723ff0392bb11efd33
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2488
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c

index 2a198db25c5c32821359d5d64a7337d3c03d321b..d4ced58e3ce05dbb49cabaa5187828517d672d8b 100644 (file)
@@ -844,9 +844,17 @@ static void CALEDataReceiverHandler(void *threadData)
                 ca_mutex_unlock(g_bleReceiveDataMutex);
                 return;
             }
+
             OIC_LOG(DEBUG, CALEADAPTER_TAG, "Sending data up !");
-            g_networkPacketReceivedCallback(senderInfo->remoteEndpoint,
-                                                senderInfo->defragData, senderInfo->recvDataLen);
+
+            const CASecureEndpoint_t tmp =
+                {
+                    .endpoint = *senderInfo->remoteEndpoint
+                };
+
+            g_networkPacketReceivedCallback(&tmp,
+                                            senderInfo->defragData,
+                                            senderInfo->recvDataLen);
             ca_mutex_unlock(g_bleAdapterReqRespCbMutex);
             u_arraylist_remove(g_senderInfo, senderIndex);
             senderInfo->remoteEndpoint = NULL;
@@ -2180,11 +2188,12 @@ static CAResult_t CALEAdapterServerReceivedData(const char *remoteAddress,
 #ifdef SINGLE_THREAD
     if(g_networkPacketReceivedCallback)
     {
-        CAEndpoint_t endPoint =
-            { .adapter = CA_ADAPTER_GATT_BTLE };  // will be filled by
-                                                  // upper layer
+        // will be filled by upper layer
+        const CASecureEndpoint_t endpoint =
+            { .endpoint = { .adapter = CA_ADAPTER_GATT_BTLE } };
+
 
-        g_networkPacketReceivedCallback(&endPoint, data, dataLength);
+        g_networkPacketReceivedCallback(&endpoint, data, dataLength);
     }
 #else
     VERIFY_NON_NULL_RET(g_bleReceiverQueue,