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.
Fork of BLE_GATT_Example by
Revision 10:6acaa9f0ef85, committed 2015-03-10
- Comitter:
- mbedAustin
- Date:
- Tue Mar 10 15:11:10 2015 +0000
- Parent:
- 9:b33f42191584
- Child:
- 11:b59226338001
- Commit message:
- Finished for Alpha Release
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Mar 09 19:21:06 2015 +0000
+++ b/main.cpp Tue Mar 10 15:11:10 2015 +0000
@@ -11,7 +11,7 @@
const static char DEVICE_NAME[] = "ChangeMe!!"; // change this
static const uint16_t uuid16_list[] = {0xFFFF}; //Custom UUID, FFFF is reserved for development
-// Set Up Characteristics
+// Set Up custom Characteristics
static uint8_t readValue[10] = {0};
GattCharacteristic readChar(reachCharUUID, readValue, sizeof(readValue), sizeof(readValue),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY);
@@ -46,6 +46,7 @@
}
// print the data if more than 1 byte is written
else {
+ printf("0x");
for(int x=0; x < params->len; x++) {
printf("%x",params->data[x]);
}
@@ -64,10 +65,9 @@
{
/* initialize stuff */
printf("\n\r********* Starting Main Loop *********\n\r");
- led = 1; // turn LED off (led is inverted)
ble.init();
ble.onDisconnection(disconnectionCallback);
- ble.onDataWritten(writeCharCallback); //TODO: this is not correct, figure out correct syntax
+ ble.onDataWritten(writeCharCallback);
/* setup advertising */
ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE); // BLE only, no classic BT
