Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of X_NUCLEO_IDB0XA1 by
Revision 200:b9df918d6d5a, committed 2015-12-15
- Comitter:
- Andrea Palmieri
- Date:
- Tue Dec 15 12:22:32 2015 +0100
- Parent:
- 199:7f9c3057adf0
- Child:
- 201:0ed200002250
- Commit message:
- Set UUIDs according to BLE API and other minor changes
Signed-off-by: Andrea Palmieri <andrea.palmieri@st.com>
Changed in this revision
| module.json | Show annotated file Show diff for this revision Revisions of this file |
| source/BlueNRGGattServer.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/module.json Fri Dec 11 10:24:17 2015 +0100
+++ b/module.json Tue Dec 15 12:22:32 2015 +0100
@@ -32,6 +32,6 @@
],
"dependencies": {
"mbed-drivers": ">=0.11.3",
- "ble": "^2.1.7"
+ "ble": "^2.1.12"
}
}
--- a/source/BlueNRGGattServer.cpp Fri Dec 11 10:24:17 2015 +0100
+++ b/source/BlueNRGGattServer.cpp Tue Dec 15 12:22:32 2015 +0100
@@ -92,8 +92,7 @@
if(type==UUID::UUID_TYPE_LONG) {
base_uuid = (service.getUUID()).getBaseUUID();
- COPY_UUID_128(primary_base_uuid, base_uuid[15],base_uuid[14],base_uuid[13],base_uuid[12],base_uuid[11],base_uuid[10],base_uuid[9],
- base_uuid[8],base_uuid[7],base_uuid[6],base_uuid[5],base_uuid[4],primary_short_uuid[1],primary_short_uuid[0],base_uuid[1],base_uuid[0]);
+ COPY_UUID_128(primary_base_uuid, base_uuid[15],base_uuid[14],primary_short_uuid[1],primary_short_uuid[0],base_uuid[11],base_uuid[10],base_uuid[9],base_uuid[8],base_uuid[7],base_uuid[6],base_uuid[5],base_uuid[4],base_uuid[3],base_uuid[2],base_uuid[1],base_uuid[0]);
}
charsCount = service.getCharacteristicCount();
@@ -133,8 +132,7 @@
if(type==UUID::UUID_TYPE_LONG) {
base_char_uuid = (p_char->getValueAttribute().getUUID()).getBaseUUID();
- COPY_UUID_128(char_base_uuid, base_char_uuid[15],base_char_uuid[14],base_char_uuid[13],base_char_uuid[12],base_char_uuid[11],base_char_uuid[10],base_char_uuid[9],
- base_char_uuid[8],base_char_uuid[7],base_char_uuid[6],base_char_uuid[5],base_char_uuid[4],int_8_uuid[1],int_8_uuid[0],base_char_uuid[1],base_char_uuid[0]);
+ COPY_UUID_128(char_base_uuid,base_char_uuid[15],base_char_uuid[14],int_8_uuid[1],int_8_uuid[0],base_char_uuid[11],base_char_uuid[10],base_char_uuid[9],base_char_uuid[8],base_char_uuid[7],base_char_uuid[6],base_char_uuid[5],base_char_uuid[4],base_char_uuid[3],base_char_uuid[2],base_char_uuid[1],base_char_uuid[0]);
}
PRINTF("Char Properties 0x%x\n\r", p_char->getProperties());
@@ -333,9 +331,14 @@
ret = aci_gatt_update_char_value(bleCharHanldeMap.find(charHandle)->second, charHandle, 0, len, buffer);
if (ret != BLE_STATUS_SUCCESS){
- PRINTF("Error while updating characteristic (ret=0x%x).\n\r", ret) ;
- return BLE_ERROR_PARAM_OUT_OF_RANGE ; //Not correct Error Value
- //FIXME: Define Error values equivalent to BlueNRG Error Codes.
+ PRINTF("Error while updating characteristic (ret=0x%x).\n\r", ret);
+ switch (ret) {
+ case BLE_STATUS_INVALID_HANDLE:
+ case BLE_STATUS_INVALID_PARAMETER:
+ return BLE_ERROR_INVALID_PARAM;
+ default:
+ return BLE_STACK_BUSY;
+ }
}
//Generate Data Sent Event Here? (GattServerEvents::GATT_EVENT_DATA_SENT) //FIXME: Is this correct?
