Bluetooth Low Energy enabled device with "Analog" feature, compatible with BlueST Protocol.
Dependencies: X_NUCLEO_LED61A1
Bluetooth Low Energy enabled device with "Analog" feature, compatible with BlueST Protocol.
Revision 1:71b8b1f19322, committed 2018-08-06
- Comitter:
- Davidroid
- Date:
- Mon Aug 06 10:00:29 2018 +0000
- Parent:
- 0:43dcd7811b58
- Commit message:
- Correct Custom Service UUID
Changed in this revision
source/CustomService.h | Show annotated file Show diff for this revision Revisions of this file |
source/main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 43dcd7811b58 -r 71b8b1f19322 source/CustomService.h --- a/source/CustomService.h Thu May 10 12:52:16 2018 +0000 +++ b/source/CustomService.h Mon Aug 06 10:00:29 2018 +0000 @@ -47,7 +47,7 @@ #define COMMAND_DATA_LENGTH (sizeof(uint8_t)) #define MAX_DATA_LENGTH (COMMAND_DATA_LENGTH) -const UUID::LongUUIDBytes_t CUSTOM_LED_SERVICE_UUID = {0x00,0x00,0x00,0x00,0x00,0x01,0x11,0xe1,0xac,0x36,0x00,0x02,0xa5,0xd5,0xc5,0x1b}; +const UUID::LongUUIDBytes_t CUSTOM_SERVICE_UUID = {0x00,0x00,0x00,0x00,0x00,0x01,0x11,0xe1,0x9a,0xb4,0x00,0x02,0xa5,0xd5,0xc5,0x1b}; const UUID::LongUUIDBytes_t CUSTOM_LED_CHARACTERISTIC_UUID = {0x80,0x00,0x00,0x00,0x00,0x01,0x11,0xe1,0xac,0x36,0x00,0x02,0xa5,0xd5,0xc5,0x1b}; class CustomService { @@ -66,7 +66,7 @@ GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE) { GattCharacteristic *char_table[] = {&command}; - GattService led_service(CUSTOM_LED_SERVICE_UUID, char_table, sizeof(char_table) / sizeof(GattCharacteristic *)); + GattService led_service(CUSTOM_SERVICE_UUID, char_table, sizeof(char_table) / sizeof(GattCharacteristic *)); ble.addService(led_service); memset (packed_command, 0, MAX_DATA_LENGTH); }
diff -r 43dcd7811b58 -r 71b8b1f19322 source/main.cpp --- a/source/main.cpp Thu May 10 12:52:16 2018 +0000 +++ b/source/main.cpp Mon Aug 06 10:00:29 2018 +0000 @@ -143,7 +143,7 @@ /* Setup advertising data. */ ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE); - ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS, (uint8_t *) CUSTOM_LED_SERVICE_UUID, sizeof(CUSTOM_LED_SERVICE_UUID)); + ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS, (uint8_t *) CUSTOM_SERVICE_UUID, sizeof(CUSTOM_SERVICE_UUID)); ble.gap().accumulateScanResponse(GapAdvertisingData::MANUFACTURER_SPECIFIC_DATA, MANUFACTURER_SPECIFIC_DATA, sizeof(MANUFACTURER_SPECIFIC_DATA)); ble.gap().accumulateScanResponse(GapAdvertisingData::COMPLETE_LOCAL_NAME, (const uint8_t *) DEVICE_NAME, sizeof(DEVICE_NAME) - 1); ble.gap().setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);