This is a simple program to work with RedBearLab BLE Controller App. Type something from the Terminal to send to the BLEController App or vice verse. Characteristics received from App will print on Terminal.
Dependencies: BLE_API mbed nRF51822
Revision 2:4b66b69c7ecb, committed 2015-07-27
- Comitter:
- RedBearLab
- Date:
- Mon Jul 27 06:52:44 2015 +0000
- Parent:
- 1:1c058e553423
- Child:
- 3:b3f6c612b603
- Commit message:
- Update libraries
Changed in this revision
--- a/BLE_API.lib Fri Oct 31 14:38:44 2014 +0000 +++ b/BLE_API.lib Mon Jul 27 06:52:44 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#4b68a819ab4f +http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#4cd3b18607ec
--- a/main.cpp Fri Oct 31 14:38:44 2014 +0000 +++ b/main.cpp Mon Jul 27 06:52:44 2015 +0000 @@ -25,7 +25,7 @@ */ #include "mbed.h" -#include "BLEDevice.h" +#include "ble/BLE.h" #define BLE_UUID_TXRX_SERVICE 0x0000 /**< The UUID of the Nordic UART Service. */ @@ -34,7 +34,7 @@ #define TXRX_BUF_LEN 20 -BLEDevice ble; +BLE ble; Serial pc(USBTX, USBRX); @@ -70,12 +70,12 @@ ble.startAdvertising(); } -void WrittenHandler(const GattCharacteristicWriteCBParams *Handler) +void WrittenHandler(const GattWriteCallbackParams *Handler) { uint8_t buf[TXRX_BUF_LEN]; uint16_t bytesRead, index; - if (Handler->charHandle == txCharacteristic.getValueAttribute().getHandle()) + if (Handler->handle == txCharacteristic.getValueAttribute().getHandle()) { ble.readCharacteristicValue(txCharacteristic.getValueAttribute().getHandle(), buf, &bytesRead); memset(txPayload, 0, TXRX_BUF_LEN);
--- a/mbed.bld Fri Oct 31 14:38:44 2014 +0000 +++ b/mbed.bld Mon Jul 27 06:52:44 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/bad568076d81 \ No newline at end of file
--- a/nRF51822.lib Fri Oct 31 14:38:44 2014 +0000 +++ b/nRF51822.lib Mon Jul 27 06:52:44 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#936d81c963fe +http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#c7adea3c1e37