use UART Service to loopback anything received on the TX characteristic onto the RX.
Dependencies: BLE_API mbed nRF51822
Revision 12:33153cf38631, committed 2015-08-24
- Comitter:
- rgrover1
- Date:
- Mon Aug 24 12:34:53 2015 +0000
- Parent:
- 11:add794159852
- Child:
- 13:15764cc1f12c
- Commit message:
- updating to the latest of the underlying libraries.
Changed in this revision
--- a/BLE_API.lib Tue Dec 09 08:55:59 2014 +0000 +++ b/BLE_API.lib Mon Aug 24 12:34:53 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#0e9201b67e2f +http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#8d316a3271a8
--- a/main.cpp Tue Dec 09 08:55:59 2014 +0000 +++ b/main.cpp Mon Aug 24 12:34:53 2015 +0000 @@ -15,9 +15,9 @@ */ #include "mbed.h" -#include "BLEDevice.h" +#include "ble/BLE.h" -#include "UARTService.h" +#include "ble/services/UARTService.h" #define NEED_CONSOLE_OUTPUT 0 /* Set this if you need debug messages on the console; * it will have an impact on code-size and power consumption. */ @@ -40,9 +40,9 @@ ble.startAdvertising(); } -void onDataWritten(const GattCharacteristicWriteCBParams *params) +void onDataWritten(const GattWriteCallbackParams *params) { - if ((uartServicePtr != NULL) && (params->charHandle == uartServicePtr->getTXCharacteristicHandle())) { + if ((uartServicePtr != NULL) && (params->handle == uartServicePtr->getTXCharacteristicHandle())) { uint16_t bytesRead = params->len; DEBUG("received %u bytes\n\r", bytesRead); ble.updateCharacteristicValue(uartServicePtr->getRXCharacteristicHandle(), params->data, bytesRead); @@ -73,7 +73,7 @@ ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS, (const uint8_t *)UARTServiceUUID_reversed, sizeof(UARTServiceUUID_reversed)); - ble.setAdvertisingInterval(Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(1000)); + ble.setAdvertisingInterval(1000); /* 1000ms; in multiples of 0.625ms. */ ble.startAdvertising(); UARTService uartService(ble);
--- a/mbed.bld Tue Dec 09 08:55:59 2014 +0000 +++ b/mbed.bld Mon Aug 24 12:34:53 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/8ed44a420e5c \ No newline at end of file
--- a/nRF51822.lib Tue Dec 09 08:55:59 2014 +0000 +++ b/nRF51822.lib Mon Aug 24 12:34:53 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#cdcc094ab166 +http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#ca9c9c2cfc6a