Reputation: 1
How do I rename the service and characteristic ID's of the Adafruit Bluefruit LE SPI Friend?
I have created them and I can add only one property to each, but I don't know how to rename them.
I am programming in Arduino btw.
Adafruit BLE SPI friend introduction
Below is how I am currently creating the service and characteristic UUIDs.
/* SERVICE 1 */
/* Main Attributes to show or listen to. */
#define BLE_MAIN_SERVICE_UUID "00-b5-74-fe-7a-a4-43-d6-94-a0-c6-6d-a0-ec-92-56"
#define BLE_PLATFORM_CHAR_UUID "be-12-fc-49-7b-50-4f-5b-81-63-19-2a-71-f6-e6-51"
#define BLE_BLADELOCATION_CHAR_UUID "c5-be-51-da-f1-0a-4a-ef-a9-d4-a0-a1-f7-80-4f-50"
#define BLE_MEASUREMENT_CHAR_UUID "ab-9e-8b-0f-68-1c-48-b9-8d-bf-f3-ce-08-96-da-69"
/*SERVICE 2 */
/* Settings type of Attributes to show or listen to. */
#define BLE_SETTINGS_SERVICE_UUID "e3-d2-fc-cb-1a-65-4c-ad-a4-8f-1d-db-a3-74-29-82"
#define BLE_SWREV_CHAR_UUID "ce-17-ff-cf-da-5c-4c-03-a0-a8-e9-b9-01-f8-bc-b9"
// Start advertising
ble.sendCommandCheckOK("AT+GAPSTARTADV");
Serial.println("Advertising started, waiting for connection...");
// Set up 1st service and characteristic
Serial << "Adding 1 service ID and characteristic ID's." << endl;
success = ble.sendCommandWithIntReply(F("AT+GATTADDSERVICE=UUID128=" BLE_MAIN_SERVICE_UUID ""), &serivceID); // Add service
if (!success) {
error(F("Could not add service."));
}
success = ble.sendCommandWithIntReply(F("AT+GATTADDCHAR=UUID128=" BLE_PLATFORM_CHAR_UUID ", PROPERTIES=0X10, MIN_LEN=2, MAX_LEN=5, VALUE=00-44"), &charID_0); // create characteristic
if (!success) {
error(F("Could not add characteristic."));
}
success = ble.sendCommandWithIntReply(F("AT+GATTADDCHAR=UUID128=" BLE_BLADELOCATION_CHAR_UUID ", PROPERTIES=0X10, MIN_LEN=2, MAX_LEN=5, VALUE=00-44"), &charID_1); // create characteristic
if (!success) {
error(F("Could not add characteristic."));
}
success = ble.sendCommandWithIntReply(F("AT+GATTADDCHAR=UUID128=" BLE_MEASUREMENT_CHAR_UUID ", PROPERTIES=0X10, MIN_LEN=2, MAX_LEN=5, VALUE=00-44"), &charID_2); // create characteristic
if (!success) {
error(F("Could not add characteristic."));
}
success = ble.sendCommandWithIntReply(F("AT+GATTADDCHAR=UUID128=" BLE_SETTINGS_SERVICE_UUID ", PROPERTIES=0X10, MIN_LEN=2, MAX_LEN=5, VALUE=00-44"), &charID_3); // create characteristic
if (!success) {
error(F("Could not add characteristic."));
}
success = ble.sendCommandWithIntReply(F("AT+GATTADDCHAR=UUID128=" BLE_SWREV_CHAR_UUID ", PROPERTIES=0X10, MIN_LEN=2, MAX_LEN=5, VALUE=00-44"), &charID_4); // create characteristic
if (!success) {
error(F("Could not add characteristic."));
}
Serial << "Add service to the advertising data (needed for Nordic apps to detect the service)." << endl;
ble.sendCommandCheckOK(F("AT+GAPSETADVDATA=02-01-06-05-02-0d-18-0a-18"));
I have not found a resolution.
Upvotes: 0
Views: 21