BLE shield
Fork of X_NUCLEO_IDB0XA1 by
Revision 216:e8fa3129410a, committed 2016-03-18
- Comitter:
- Andrea Palmieri
- Date:
- Fri Mar 18 12:10:20 2016 +0100
- Parent:
- 212:8b5ff0f0186f
- Parent:
- 215:926ca3e4ccce
- Commit message:
- Merge branch 'master' into mbed_classic
Changed in this revision
source/BlueNRGGap.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 8b5ff0f0186f -r e8fa3129410a module.json --- a/module.json Thu Jan 14 11:19:43 2016 +0100 +++ b/module.json Fri Mar 18 12:10:20 2016 +0100 @@ -1,6 +1,6 @@ { "name": "x-nucleo-idb0xa1", - "version": "2.0.2", + "version": "2.0.3", "description": "ST driver for the mbed BLE API.", "keywords": [ "expansion",
diff -r 8b5ff0f0186f -r e8fa3129410a source/BlueNRGGap.cpp --- a/source/BlueNRGGap.cpp Thu Jan 14 11:19:43 2016 +0100 +++ b/source/BlueNRGGap.cpp Fri Mar 18 12:10:20 2016 +0100 @@ -283,6 +283,21 @@ //Set the SCAN_RSP Payload scan_response_payload = scanResponse.getPayload(); scan_rsp_length = scanResponse.getPayloadLen(); + + // Update the ADV data if we are already in ADV mode + if(AdvLen > 0 && state.advertising == 1) { + + tBleStatus ret = aci_gap_update_adv_data(AdvLen, AdvData); + if(BLE_STATUS_SUCCESS!=ret) { + PRINTF("error occurred while adding adv data (ret=0x%x)\n", ret); + switch (ret) { + case BLE_STATUS_TIMEOUT: + return BLE_STACK_BUSY; + default: + return BLE_ERROR_UNSPECIFIED; + } + } + } } return BLE_ERROR_NONE; }