BLE_API wrapper library for STMicroelectronics' BlueNRG Bluetooth Low Energy expansion board shield (Component)

Dependents:   Nucleo_Zumo_BLE_IDB04A1 contest_IOT5 contest_IOT6 contest_IOT_10 ... more

Fork of X_NUCLEO_IDB0XA1 by ST Expansion SW Team

Arduino Connector Compatibility Warning

X-NUCLEO-IDB04A1 and X-NUCLEO-IDB05A1 are Arduino compatible with an exception: instead of using pin D13 for the SPI clock, they use pin D3. The default configuration for this library is having the SPI clock on pin D3.

To be fully Arduino compatible, X-NUCLEO-IDB04A1 and X-NUCLEO-IDB05A1 need a small HW patch.

For X-NUCLEO-IDB04A1 this patch consists in removing zero resistor R10 and instead soldering zero resistor R11. For X-NUCLEO-IDB05A1 this patch consists in removing zero resistor R4 and instead soldering zero resistor R6.

In case you patch your board, then you also have to configure this library to use pin D13 to drive the SPI clock (see macro IDB0XA1_D13_PATCH in file x_nucleo_idb0xa1_targets.h).

If you use pin D13 for the SPI clock, please be aware that on STM32 Nucleo boards you may not drive the LED, otherwise you will get a conflict: the LED on STM32 Nucleo boards is connected to pin D13.

Referring to the current list of tested platforms (see X-NUCLEO-IDB04A1 and X-NUCLEO-IDB05A1 pages), the patch is required by ST-Nucleo-F103RB; ST-Nucleo-F302R8; ST-Nucleo-F411RE; and ST-Nucleo-F446RE.

Revision:
142:adf1567d3900
Parent:
132:51056160fa4a
Child:
144:bdf5e8432131
--- a/source/BlueNRGGattClient.cpp	Fri Oct 09 09:56:12 2015 +0200
+++ b/source/BlueNRGGattClient.cpp	Fri Oct 16 15:59:23 2015 +0200
@@ -82,6 +82,8 @@
   GattAttribute::Handle_t startHandle, endHandle;
   UUID uuid;
   uint8_t i, offset, numAttr;
+  /* avoid compiler warnings about unused variables */
+  (void)connectionHandle;
 
   numAttr = (event_data_length - 1) / attribute_data_length;
 
@@ -135,6 +137,8 @@
   GattAttribute::Handle_t startHandle, endHandle;
   UUID uuid;
   uint8_t i, offset, numHandlePairs;
+  /* avoid compiler warnings about unused variables */
+  (void)connectionHandle;
 
   numHandlePairs = (event_data_length - 1) / 2;
 
@@ -302,9 +306,9 @@
   PRINTF("findServiceChars\n\r");
   
   tBleStatus ret;
-  uint8_t uuid_type;
+  uint8_t uuid_type = UUID_TYPE_16;
   uint8_t short_uuid[2];
-  uint8_t *uuid;
+  uint8_t *uuid = NULL;
   
   DiscoveredService *service;
   
@@ -391,9 +395,9 @@
   PRINTF("launchServiceDiscovery\n\r");
   
   tBleStatus ret;
-  uint8_t uuid_type;
+  uint8_t uuid_type = UUID_TYPE_16;
   uint8_t short_uuid[2];
-  uint8_t *uuid;
+  uint8_t *uuid = NULL;
   unsigned j;
   
   _connectionHandle = connectionHandle;
@@ -465,6 +469,11 @@
                                                 ServiceDiscovery::ServiceCallback_t  callback,
                                                 const UUID                          &matchingServiceUUID)
 {
+  /* avoid compiler warnings about unused variables */
+  (void)connectionHandle;
+  (void)callback;
+  (void)matchingServiceUUID;
+
   return BLE_ERROR_NOT_IMPLEMENTED;
 }
 
@@ -473,6 +482,12 @@
                                                 GattAttribute::Handle_t              startHandle,
                                                 GattAttribute::Handle_t              endHandle)
 {
+  /* avoid compiler warnings about unused variables */
+  (void)connectionHandle;
+  (void)callback;
+  (void)startHandle;
+  (void)endHandle;
+
   return BLE_ERROR_NOT_IMPLEMENTED;
 }
 
@@ -511,6 +526,9 @@
 
 ble_error_t BlueNRGGattClient::read(Gap::Handle_t connHandle, GattAttribute::Handle_t attributeHandle, uint16_t offset) const
 {
+  /* avoid compiler warnings about unused variables */
+  (void)offset;
+
   tBleStatus ret;
   
   BlueNRGGattClient *gattc = const_cast<BlueNRGGattClient*>(this);
@@ -539,6 +557,9 @@
                                            uint16_t offset,
                                            uint8_t *part_attr_value)
 {
+  /* avoid compiler warnings about unused variables */
+  (void)connHandle;
+
   // Update the write response params
   writeCBParams.handle = attribute_handle;
   writeCBParams.offset = offset;
@@ -551,6 +572,9 @@
 void BlueNRGGattClient::charWriteExecCB(Gap::Handle_t connHandle,
                                         uint8_t event_data_length)
 {
+  /* avoid compiler warnings about unused variables */
+  (void)event_data_length;
+
   writeCBParams.connHandle = connHandle;
   
   BlueNRGGattClient::getInstance().processWriteResponse(&writeCBParams);
@@ -562,8 +586,10 @@
                                      size_t                   length,
                                      const uint8_t           *value) const
 {
+  /* avoid compiler warnings about unused variables */
+  (void)cmd;
+
   tBleStatus ret;
-
   
   BlueNRGGattClient *gattc = const_cast<BlueNRGGattClient*>(this);