bug fix

Dependencies:   BLE_API mbed nRF51822

Fork of BLE_MIDI by Kaoru Shoji

Files at this revision

API Documentation at this revision

Comitter:
comoc
Date:
Mon Jul 25 06:02:49 2016 +0000
Parent:
3:2b71bfbaa458
Commit message:
fix a bug in counting the length of the device name string.

Changed in this revision

BLEMIDI.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 2b71bfbaa458 -r 53fa90f45a8e BLEMIDI.cpp
--- a/BLEMIDI.cpp	Tue Apr 07 09:24:31 2015 +0000
+++ b/BLEMIDI.cpp	Mon Jul 25 06:02:49 2016 +0000
@@ -310,7 +310,7 @@
     /* setup advertising */
     device->accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS, (uint8_t*)uuid128_list, sizeof(uuid128_list));
     device->accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
-    device->accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)deviceName, sizeof(deviceName));
+    device->accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)deviceName, strlen(deviceName));
 
     device->setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
     device->setAdvertisingInterval(160); /* 100ms; in multiples of 0.625ms. */