Enable automated builds for most transports.
authorOssama Othman <ossama.othman@intel.com>
Mon, 10 Aug 2015 17:59:38 +0000 (10:59 -0700)
committerErich Keane <erich.keane@intel.com>
Wed, 12 Aug 2015 02:32:14 +0000 (02:32 +0000)
Currently only the Linux builds enables all IoTivity transports.  That
allows platform-specific implementations, e.g. BLE on non-Linux
platforms, that are not enabled in the automated builds to potentially
stagnate.

This patch adds Bluetooth related builds for Android and Arduino.
Several builds issues were addressed as a result of doing so.

Tizen BLE compile-time issues were also addressed.  However, a
separate patch will be submitted to enable ALL transports for Tizen
since unresolved symbol errors related to use of functions in the
Tizen Bluetooth currently exist in the master branch.

Change-Id: I4f4971e5a6cd8089b5c4cd16926331e24fec3181
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2163
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
auto_build.sh
resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrendpoint.c
resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrnwmonitor.c
resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/cableserver.c
resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/SConscript

index 568920e..806bf6a 100755 (executable)
@@ -69,9 +69,13 @@ function build_android()
 
        echo "*********** Build for android x86 *************"
        scons TARGET_OS=android TARGET_ARCH=x86 RELEASE=$1 TARGET_TRANSPORT=IP $2
+       scons TARGET_OS=android TARGET_ARCH=x86 RELEASE=$1 TARGET_TRANSPORT=BT $2
+       scons TARGET_OS=android TARGET_ARCH=x86 RELEASE=$1 TARGET_TRANSPORT=BLE $2
 
        echo "*********** Build for android armeabi *************"
        scons TARGET_OS=android TARGET_ARCH=armeabi RELEASE=$1 TARGET_TRANSPORT=IP $2
+       scons TARGET_OS=android TARGET_ARCH=armeabi RELEASE=$1 TARGET_TRANSPORT=BT $2
+       scons TARGET_OS=android TARGET_ARCH=armeabi RELEASE=$1 TARGET_TRANSPORT=BLE $2
 
        # enable parallel build
        export SCONSFLAGS="-Q -j 4"
@@ -82,10 +86,12 @@ function build_arduino()
        echo "*********** Build for arduino avr *************"
        scons resource TARGET_OS=arduino UPLOAD=false BOARD=mega TARGET_ARCH=avr TARGET_TRANSPORT=IP SHIELD=ETH RELEASE=$1 $2
        scons resource TARGET_OS=arduino UPLOAD=false BOARD=mega TARGET_ARCH=avr TARGET_TRANSPORT=IP SHIELD=WIFI RELEASE=$1 $2
+       scons resource TARGET_OS=arduino UPLOAD=false BOARD=mega TARGET_ARCH=avr TARGET_TRANSPORT=BLE SHIELD=RBL_NRF8001 RELEASE=$1 $2
 
        echo "*********** Build for arduino arm *************"
        scons resource TARGET_OS=arduino UPLOAD=false BOARD=arduino_due_x TARGET_ARCH=arm TARGET_TRANSPORT=IP SHIELD=ETH RELEASE=$1 $2
        scons resource TARGET_OS=arduino UPLOAD=false BOARD=arduino_due_x TARGET_ARCH=arm TARGET_TRANSPORT=IP SHIELD=WIFI RELEASE=$1 $2
+       # BLE support for the Arduino Due is currently unavailable.
 }
 
 function build_tizen()
@@ -210,5 +216,3 @@ else
 fi
 
 echo "===================== done ====================="
-
-
index 18061e7..c7156e6 100644 (file)
@@ -34,7 +34,6 @@ CAResult_t CAEDRSendData(int serverFD, const void *data, uint32_t dataLength)
     OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "IN");
 
     VERIFY_NON_NULL(data, EDR_ADAPTER_TAG, "Data is null");
-    VERIFY_NON_NULL(sentDataLen, EDR_ADAPTER_TAG, "Sent data length holder is null");
 
     if (0 > serverFD)
     {
index 20b9962..d9af8e6 100644 (file)
@@ -51,10 +51,9 @@ static CAEDRNetworkStatusCallback g_edrNetworkChangeCallback = NULL;
 static void CAEDRAdapterStateChangeCallback(int result, bt_adapter_state_e adapterState,
                                             void *userData);
 
-void *GMainLoopThread (void *param)
+void GMainLoopThread (void *param)
 {
     g_main_loop_run(g_mainloop);
-    return NULL;
 }
 
 CAResult_t CAEDRInitializeNetworkMonitor(const ca_thread_pool_t threadPool)
index 9a46051..2a198db 100644 (file)
@@ -257,193 +257,6 @@ static CAQueueingThread_t *g_bleReceiverQueue = NULL;
 static CAQueueingThread_t *g_bleServerSendQueueHandle = NULL;
 
 /**
- * Starting LE connectivity adapters.
- *
- * As its peer to peer it does not require to start any servers.
- *
- * @return ::CA_STATUS_OK or Appropriate error code.
- */
-static CAResult_t CAStartLE();
-
-/**
- * Start listening server for receiving multicast search requests.
- *
- * Transport Specific Behavior:
- *   LE  Starts GATT Server with prefixed UUID and Characteristics
- *   per OIC Specification.
- * @return  ::CA_STATUS_OK or Appropriate error code.
- */
-static CAResult_t CAStartLEListeningServer();
-
-/**
- * Sarting discovery of servers for receiving multicast
- * advertisements.
- *
- * Transport Specific Behavior:
- *   LE  Starts GATT Server with prefixed UUID and Characteristics
- *   per OIC Specification.
- *
- * @return ::CA_STATUS_OK or Appropriate error code
- */
-static CAResult_t CAStartLEDiscoveryServer();
-
-/**
- * Send data to the endpoint using the adapter connectivity.
- *
- * @param[in] endpoint Remote Endpoint information (like MAC address,
- *                     reference URI and connectivity type) to which
- *                     the unicast data has to be sent.
- * @param[in] data     Data which required to be sent.
- * @param[in] dataLen  Size of data to be sent.
- *
- * @note  dataLen must be > 0.
- *
- * @return The number of bytes sent on the network, or -1 on error.
- */
-static int32_t CASendLEUnicastData(const CAEndpoint_t *endpoint,
-                                   const void *data,
-                                   uint32_t dataLen);
-
-/**
- * Send multicast data to the endpoint using the LE connectivity.
- *
- * @param[in] endpoint Remote Endpoint information to which the
- *                     multicast data has to be sent.
- * @param[in] data     Data which required to be sent.
- * @param[in] dataLen  Size of data to be sent.
- *
- * @note  dataLen must be > 0.
- *
- * @return The number of bytes sent on the network, or -1 on error.
- */
-static int32_t CASendLEMulticastData(const CAEndpoint_t *endpoint,
-                                     const void *data,
-                                     uint32_t dataLen);
-
-/**
- * Get LE Connectivity network information.
- *
- * @param[out] info Local connectivity information structures.
- * @param[out] size Number of local connectivity structures.
- *
- * @return ::CA_STATUS_OK or Appropriate error code.
- */
-static CAResult_t CAGetLEInterfaceInformation(CAEndpoint_t **info,
-                                              uint32_t *size);
-
-/**
- * Read Synchronous API callback.
- *
- * @return  ::CA_STATUS_OK or Appropriate error code.
- */
-static CAResult_t CAReadLEData();
-
-/**
- * Stopping the adapters and close socket connections.
- *
- * LE Stops all GATT servers and GATT Clients.
- *
- * @return ::CA_STATUS_OK or Appropriate error code.
- */
-static CAResult_t CAStopLE();
-
-/**
- * Terminate the LE connectivity adapter.
- *
- * Configuration information will be deleted from further use.
- */
-static void CATerminateLE();
-
-/**
- * Set the NetworkPacket received callback to CA layer from adapter
- * layer.
- *
- * @param[in] callback Callback handle sent from the upper layer.
- */
-static void CASetLEReqRespAdapterCallback(CANetworkPacketReceivedCallback callback);
-
-/**
- * Push the data from CA layer to the Sender processor queue.
- *
- * @param[in] remoteEndpoint Remote endpoint information of the
- *                           server.
- * @param[in] data           Data to be transmitted from LE.
- * @param[in] dataLen        Length of the Data being transmitted.
- *
- * @return ::CA_STATUS_OK or Appropriate error code.
- * @retval ::CA_STATUS_OK  Successful.
- * @retval ::CA_STATUS_INVALID_PARAM  Invalid input arguments.
- * @retval ::CA_STATUS_FAILED Operation failed.
- */
-static CAResult_t CALEAdapterServerSendData(const CAEndpoint_t *remoteEndpoint,
-                                            const uint8_t *data,
-                                            uint32_t dataLen);
-
-/**
- * Push the data from CA layer to the Sender processor queue.
- *
- * @param[in] remoteEndpoint Remote endpoint information of the
- *                           server.
- * @param[in] data           Data to be transmitted from LE.
- * @param[in] dataLen        Length of the Data being transmitted.
- *
- * @return ::CA_STATUS_OK or Appropriate error code.
- * @retval ::CA_STATUS_OK  Successful.
- * @retval ::CA_STATUS_INVALID_PARAM  Invalid input arguments.
- * @retval ::CA_STATUS_FAILED Operation failed.
- */
-static CAResult_t CALEAdapterClientSendData(const CAEndpoint_t *remoteEndpoint,
-                                            const uint8_t *data,
-                                            uint32_t dataLen);
-
-/**
- * This function will receive the data from the GattServer and add the
- * data to the Server receiver queue.
- *
- * @param[in] remoteAddress Remote address of the device from where
- *                          data is received.
- * @param[in] data          Actual data recevied from the remote
- *                          device.
- * @param[in] dataLength    Length of the data received from the
- *                          remote device.
- * @param[in] sentLength    Length of the data sent from the remote
- *                          device.
- *
- * @return ::CA_STATUS_OK or Appropriate error code.
- * @retval ::CA_STATUS_OK  Successful.
- * @retval ::CA_STATUS_INVALID_PARAM  Invalid input arguments.
- * @retval ::CA_STATUS_FAILED Operation failed.
- *
- */
-static CAResult_t CALEAdapterServerReceivedData(const char *remoteAddress,
-                                                const uint8_t *data,
-                                                uint32_t dataLength,
-                                                uint32_t *sentLength);
-
-/**
- * This function will receive the data from the GattClient and add the
- * data into the Client receiver queue.
- *
- * @param[in] remoteAddress Remote address of the device from where
- *                          data is received.
- * @param[in] data          Actual data recevied from the remote
- *                          device.
- * @param[in] dataLength    Length of the data received from the
- *                          remote device.
- * @param[in] sentLength    Length of the data sent from the remote
- *                          device.
- *
- * @return ::CA_STATUS_OK or Appropriate error code.
- * @retval ::CA_STATUS_OK  Successful.
- * @retval ::CA_STATUS_INVALID_PARAM  Invalid input arguments.
- * @retval ::CA_STATUS_FAILED Operation failed.
- */
-static CAResult_t CALEAdapterClientReceivedData(const char *remoteAddress,
-                                                const uint8_t *data,
-                                                uint32_t dataLength,
-                                                uint32_t *sentLength);
-
-/**
  * This function will be associated with the sender queue for
  * GattServer.
  *
@@ -1606,6 +1419,193 @@ static void CATerminateLEAdapterMutex()
     OIC_LOG(DEBUG, CALEADAPTER_TAG, "OUT");
 }
 
+/**
+ * Starting LE connectivity adapters.
+ *
+ * As its peer to peer it does not require to start any servers.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ */
+static CAResult_t CAStartLE();
+
+/**
+ * Start listening server for receiving multicast search requests.
+ *
+ * Transport Specific Behavior:
+ *   LE  Starts GATT Server with prefixed UUID and Characteristics
+ *   per OIC Specification.
+ * @return  ::CA_STATUS_OK or Appropriate error code.
+ */
+static CAResult_t CAStartLEListeningServer();
+
+/**
+ * Sarting discovery of servers for receiving multicast
+ * advertisements.
+ *
+ * Transport Specific Behavior:
+ *   LE  Starts GATT Server with prefixed UUID and Characteristics
+ *   per OIC Specification.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code
+ */
+static CAResult_t CAStartLEDiscoveryServer();
+
+/**
+ * Send data to the endpoint using the adapter connectivity.
+ *
+ * @param[in] endpoint Remote Endpoint information (like MAC address,
+ *                     reference URI and connectivity type) to which
+ *                     the unicast data has to be sent.
+ * @param[in] data     Data which required to be sent.
+ * @param[in] dataLen  Size of data to be sent.
+ *
+ * @note  dataLen must be > 0.
+ *
+ * @return The number of bytes sent on the network, or -1 on error.
+ */
+static int32_t CASendLEUnicastData(const CAEndpoint_t *endpoint,
+                                   const void *data,
+                                   uint32_t dataLen);
+
+/**
+ * Send multicast data to the endpoint using the LE connectivity.
+ *
+ * @param[in] endpoint Remote Endpoint information to which the
+ *                     multicast data has to be sent.
+ * @param[in] data     Data which required to be sent.
+ * @param[in] dataLen  Size of data to be sent.
+ *
+ * @note  dataLen must be > 0.
+ *
+ * @return The number of bytes sent on the network, or -1 on error.
+ */
+static int32_t CASendLEMulticastData(const CAEndpoint_t *endpoint,
+                                     const void *data,
+                                     uint32_t dataLen);
+
+/**
+ * Get LE Connectivity network information.
+ *
+ * @param[out] info Local connectivity information structures.
+ * @param[out] size Number of local connectivity structures.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ */
+static CAResult_t CAGetLEInterfaceInformation(CAEndpoint_t **info,
+                                              uint32_t *size);
+
+/**
+ * Read Synchronous API callback.
+ *
+ * @return  ::CA_STATUS_OK or Appropriate error code.
+ */
+static CAResult_t CAReadLEData();
+
+/**
+ * Stopping the adapters and close socket connections.
+ *
+ * LE Stops all GATT servers and GATT Clients.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ */
+static CAResult_t CAStopLE();
+
+/**
+ * Terminate the LE connectivity adapter.
+ *
+ * Configuration information will be deleted from further use.
+ */
+static void CATerminateLE();
+
+/**
+ * This function will receive the data from the GattServer and add the
+ * data to the Server receiver queue.
+ *
+ * @param[in] remoteAddress Remote address of the device from where
+ *                          data is received.
+ * @param[in] data          Actual data recevied from the remote
+ *                          device.
+ * @param[in] dataLength    Length of the data received from the
+ *                          remote device.
+ * @param[in] sentLength    Length of the data sent from the remote
+ *                          device.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ * @retval ::CA_STATUS_OK  Successful.
+ * @retval ::CA_STATUS_INVALID_PARAM  Invalid input arguments.
+ * @retval ::CA_STATUS_FAILED Operation failed.
+ *
+ */
+static CAResult_t CALEAdapterServerReceivedData(const char *remoteAddress,
+                                                const uint8_t *data,
+                                                uint32_t dataLength,
+                                                uint32_t *sentLength);
+
+/**
+ * This function will receive the data from the GattClient and add the
+ * data into the Client receiver queue.
+ *
+ * @param[in] remoteAddress Remote address of the device from where
+ *                          data is received.
+ * @param[in] data          Actual data recevied from the remote
+ *                          device.
+ * @param[in] dataLength    Length of the data received from the
+ *                          remote device.
+ * @param[in] sentLength    Length of the data sent from the remote
+ *                          device.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ * @retval ::CA_STATUS_OK  Successful.
+ * @retval ::CA_STATUS_INVALID_PARAM  Invalid input arguments.
+ * @retval ::CA_STATUS_FAILED Operation failed.
+ */
+static CAResult_t CALEAdapterClientReceivedData(const char *remoteAddress,
+                                                const uint8_t *data,
+                                                uint32_t dataLength,
+                                                uint32_t *sentLength);
+
+/**
+ * Set the NetworkPacket received callback to CA layer from adapter
+ * layer.
+ *
+ * @param[in] callback Callback handle sent from the upper layer.
+ */
+static void CASetLEReqRespAdapterCallback(CANetworkPacketReceivedCallback callback);
+
+/**
+ * Push the data from CA layer to the Sender processor queue.
+ *
+ * @param[in] remoteEndpoint Remote endpoint information of the
+ *                           server.
+ * @param[in] data           Data to be transmitted from LE.
+ * @param[in] dataLen        Length of the Data being transmitted.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ * @retval ::CA_STATUS_OK  Successful.
+ * @retval ::CA_STATUS_INVALID_PARAM  Invalid input arguments.
+ * @retval ::CA_STATUS_FAILED Operation failed.
+ */
+static CAResult_t CALEAdapterServerSendData(const CAEndpoint_t *remoteEndpoint,
+                                            const uint8_t *data,
+                                            uint32_t dataLen);
+
+/**
+ * Push the data from CA layer to the Sender processor queue.
+ *
+ * @param[in] remoteEndpoint Remote endpoint information of the
+ *                           server.
+ * @param[in] data           Data to be transmitted from LE.
+ * @param[in] dataLen        Length of the Data being transmitted.
+ *
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ * @retval ::CA_STATUS_OK  Successful.
+ * @retval ::CA_STATUS_INVALID_PARAM  Invalid input arguments.
+ * @retval ::CA_STATUS_FAILED Operation failed.
+ */
+static CAResult_t CALEAdapterClientSendData(const CAEndpoint_t *remoteEndpoint,
+                                            const uint8_t *data,
+                                            uint32_t dataLen);
+
 CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback,
                           CANetworkPacketReceivedCallback reqRespCallback,
                           CANetworkChangeCallback netCallback,
@@ -1670,7 +1670,7 @@ CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback,
 
 static CAResult_t CAStartLE()
 {
-    OIC_LOG(DEBUG, CALEADAPTER_TAG, __func__);
+    OIC_LOG(DEBUG, CALEADAPTER_TAG, "CAStartLE");
 
     return CAStartLEAdapter();
 }
index a971465..807f1d9 100644 (file)
@@ -219,8 +219,8 @@ void CAStartBleGattServerThread(void *data)
         return;
     }
 
-    char *charReadUUID = CA_GATT_RESPONSE_CHRC_UUID;
-    char charReadValue[] = {33, 44, 55, 66}; // These are initial random values
+    static const char charReadUUID[] = CA_GATT_RESPONSE_CHRC_UUID;
+    uint8_t charReadValue[] = {33, 44, 55, 66}; // These are initial random values
 
     ret = CAAddNewCharacteristicsToGattServer(g_gattSvcPath, charReadUUID, charReadValue,
             CA_BLE_INITIAL_BUF_SIZE, true); // For Read Characteristics.
@@ -232,8 +232,8 @@ void CAStartBleGattServerThread(void *data)
         return;
     }
 
-    char *charWriteUUID = CA_GATT_REQUEST_CHRC_UUID;
-    char charWriteValue[] = {33, 44, 55, 66}; // These are initial random values
+    static const char charWriteUUID[] = CA_GATT_REQUEST_CHRC_UUID;
+    uint8_t charWriteValue[] = {33, 44, 55, 66}; // These are initial random values
 
 
     ret = CAAddNewCharacteristicsToGattServer(g_gattSvcPath, charWriteUUID, charWriteValue,
@@ -592,7 +592,7 @@ void CABleGattRemoteCharacteristicWriteCb(char *charPath,
 
     OIC_LOG_V(DEBUG,
               TZ_BLE_SERVER_TAG,
-              "charPath = [%s] charValue = [%x] len [%d]",
+              "charPath = [%s] charValue = [%p] len [%d]",
               charPath,
               charValue,
               charValueLen);
@@ -647,12 +647,12 @@ CAResult_t CARegisterBleServicewithGattServer(const char *svcPath)
 }
 
 CAResult_t CAAddNewCharacteristicsToGattServer(const char *svcPath, const char *charUUID,
-        const char *charValue, int charValueLen, bool read)
+        const uint8_t *charValue, int charValueLen, bool read)
 {
 
     OIC_LOG(DEBUG, TZ_BLE_SERVER_TAG, "IN");
 
-    char *charFlags[1];
+    const char *charFlags[1];
     if(read)
     {
         charFlags[0] = "notify";
@@ -665,8 +665,14 @@ CAResult_t CAAddNewCharacteristicsToGattServer(const char *svcPath, const char *
     size_t flagLen = sizeof(charFlags) / sizeof(charFlags[0]);
 
     char *charPath = NULL;
-    int ret = bt_gatt_add_characteristic(charUUID, charValue, charValueLen, charFlags, flagLen,
-                  svcPath, &charPath);
+    int ret =
+        bt_gatt_add_characteristic(charUUID,
+                                   (const char *) charValue,
+                                   charValueLen,
+                                   charFlags,
+                                   flagLen,
+                                   svcPath,
+                                   &charPath);
 
     if (0 != ret || NULL == charPath)
     {
@@ -713,7 +719,7 @@ CAResult_t CARemoveCharacteristicsFromGattServer(const char *charPath)
 }
 
 CAResult_t CAUpdateCharacteristicsToGattClient(const char *address,
-                                               const char *charValue,
+                                               const uint8_t *charValue,
                                                uint32_t charValueLen)
 {
     OIC_LOG(DEBUG, TZ_BLE_SERVER_TAG, "IN");
@@ -733,7 +739,7 @@ CAResult_t CAUpdateCharacteristicsToGattClient(const char *address,
         return CA_STATUS_FAILED;
     }
 
-    char *data = (char *) OICCalloc(sizeof(char), (charValueLen + 1));
+    char *data = OICCalloc(charValueLen, 1);
     if (NULL == data)
     {
         OIC_LOG(ERROR, TZ_BLE_SERVER_TAG, "malloc failed!");
@@ -741,12 +747,16 @@ CAResult_t CAUpdateCharacteristicsToGattClient(const char *address,
         return CA_STATUS_FAILED;
     }
 
-    OICStrcpy(data, charValueLen + 1, charValue);
+    memcpy(data, charValue, charValueLen);   // Binary data
 
-    OIC_LOG_V(DEBUG, TZ_BLE_SERVER_TAG, "updating characteristics char [%s] data [%s] dataLen [%d]",
+    OIC_LOG_V(DEBUG, TZ_BLE_SERVER_TAG, "updating characteristics char [%s] data [%p] dataLen [%u]",
               (const char *)g_gattReadCharPath, data, charValueLen);
 
-    int ret =  bt_gatt_update_characteristic(g_gattReadCharPath, data, charValueLen, address);
+    int ret =
+        bt_gatt_update_characteristic(g_gattReadCharPath,
+                                      data,
+                                      charValueLen,
+                                      address);
     if (0 != ret)
     {
         OIC_LOG_V(ERROR, TZ_BLE_SERVER_TAG,
@@ -763,7 +773,7 @@ CAResult_t CAUpdateCharacteristicsToGattClient(const char *address,
     return CA_STATUS_OK;
 }
 
-CAResult_t CAUpdateCharacteristicsToAllGattClients(const char *charValue, uint32_t charValueLen)
+CAResult_t CAUpdateCharacteristicsToAllGattClients(const uint8_t *charValue, uint32_t charValueLen)
 {
     OIC_LOG(DEBUG, TZ_BLE_SERVER_TAG, "IN");
 
@@ -778,7 +788,7 @@ CAResult_t CAUpdateCharacteristicsToAllGattClients(const char *charValue, uint32
         return CA_STATUS_FAILED;
     }
 
-    char *data = (char *) OICMalloc(sizeof(char) * (charValueLen + 1));
+    char *data = OICMalloc(charValueLen);
     if (NULL == data)
     {
         OIC_LOG(ERROR, TZ_BLE_SERVER_TAG, "malloc failed!");
@@ -786,12 +796,16 @@ CAResult_t CAUpdateCharacteristicsToAllGattClients(const char *charValue, uint32
         return CA_STATUS_FAILED;
     }
 
-    OICStrcpy(data, charValueLen + 1, charValue);
+    memcpy(data, charValue, charValueLen);   // Binary data
 
-    OIC_LOG_V(DEBUG, TZ_BLE_SERVER_TAG, "updating characteristics char [%s] data [%s] dataLen [%d]",
+    OIC_LOG_V(DEBUG, TZ_BLE_SERVER_TAG, "updating characteristics char [%s] data [%p] dataLen [%u]",
               (const char *)g_gattReadCharPath, data, charValueLen);
 
-    int ret =  bt_gatt_update_characteristic(g_gattReadCharPath, data, charValueLen, NULL);
+    int ret =
+        bt_gatt_update_characteristic(g_gattReadCharPath,
+                                      data,
+                                      charValueLen,
+                                      NULL);
     if (0 != ret)
     {
         OIC_LOG_V(ERROR, TZ_BLE_SERVER_TAG,
index bc37c05..5b551bb 100644 (file)
 
 Import('env')
 
+transport = env.get('TARGET_TRANSPORT')
+if 'BLE' in transport:
+        # Only supported for ethernet and WiFi.
+        Return()
+
 arduino_simplecs_env = env.Clone()
 ######################################################################
 # Build flags