Test code. Blinks by default at 2 seconds. Receives single characters from PC (sensor) and transmit to "nRF Connect" on droid. Droid can send ascii to Nano. When droid sends "A", blinking is twice per second. "B" returns to slow.

Dependencies:   BLE_API mbed nRF51822

Fork of IofT_comm by Eric MacDonald

Files at this revision

API Documentation at this revision

Comitter:
emacdonald
Date:
Mon Jan 30 23:04:36 2017 +0000
Parent:
5:3384d9d80bf3
Commit message:
YSU Bluetooth Sensor - "A" for fast blink, "B" for slow blink through either "Light Blue" on iPhone or "nRF_Connect" on Droid.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 3384d9d80bf3 -r 42bb0cde20f0 main.cpp
--- a/main.cpp	Sun Jan 15 14:25:30 2017 +0000
+++ b/main.cpp	Mon Jan 30 23:04:36 2017 +0000
@@ -159,7 +159,7 @@
     ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED);
     ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
     ble.accumulateAdvertisingPayload(GapAdvertisingData::SHORTENED_LOCAL_NAME,
-                                    (const uint8_t *)"IoT_bluetooth", sizeof("IoT_bluetooth") - 1);
+                                    (const uint8_t *)"YSU_bluetooth", sizeof("YSU_bluetooth") - 1);
     ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS,
                                     (const uint8_t *)uart_base_uuid_rev, sizeof(uart_base_uuid));
     // 100ms; in multiples of 0.625ms.