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.
Dependencies: BLE_API mbed nRF51822
Fork of BLE_UARTConsole by
Revision 9:fa721f82115a, committed 2015-08-18
- Comitter:
- roberto_b
- Date:
- Tue Aug 18 07:42:10 2015 +0000
- Parent:
- 8:f9bf6d403cde
- Commit message:
- export trials ...
Changed in this revision
--- a/BLE_API.lib Tue Jul 07 06:58:31 2015 +0000 +++ b/BLE_API.lib Tue Aug 18 07:42:10 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#9c2edf20ea56 +http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#8d316a3271a8
--- a/main.cpp Tue Jul 07 06:58:31 2015 +0000
+++ b/main.cpp Tue Aug 18 07:42:10 2015 +0000
@@ -29,8 +29,9 @@
#define DEBUG(...) /* nothing */
#endif /* #if NEED_CONSOLE_OUTPUT */
-BLEDevice ble;
-DigitalOut led1(LED1);
+Serial pc(USBTX, USBRX); // tx, rx
+BLEDevice ble;
+DigitalOut led1(LED1);
UARTService *uart;
void disconnectionCallback(Gap::Handle_t handle, Gap::DisconnectionReason_t reason)
@@ -44,12 +45,21 @@
{
led1 = !led1;
DEBUG("ping\r\n");
+ pc.printf("ping\r\n");
}
int main(void)
{
+ const char *serviceName = "rob ble";
+
led1 = 1;
Ticker ticker;
+
+ // usb/serial port initialisation
+ pc.baud(115200);
+ pc.printf("Initialising the nRF51822\n\r");
+ pc.printf("service %s\n\r", serviceName);
+
ticker.attach(periodicCallback, 1);
DEBUG("Initialising the nRF51822\n\r");
@@ -62,7 +72,7 @@
ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED);
ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
ble.accumulateAdvertisingPayload(GapAdvertisingData::SHORTENED_LOCAL_NAME,
- (const uint8_t *)"BLE UART", sizeof("BLE UART") - 1);
+ (const uint8_t *)serviceName, strlen(serviceName));
ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS,
(const uint8_t *)UARTServiceUUID_reversed, sizeof(UARTServiceUUID_reversed));
--- a/mbed.bld Tue Jul 07 06:58:31 2015 +0000 +++ b/mbed.bld Tue Aug 18 07:42:10 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/b9ad9a133dc7 \ No newline at end of file
--- a/nRF51822.lib Tue Jul 07 06:58:31 2015 +0000 +++ b/nRF51822.lib Tue Aug 18 07:42:10 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#6c82f06746bb +http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#ca9c9c2cfc6a
