Skip to main content
KMew
Senior III
March 9, 2023
Question

BLUENRG-M0A: Characteristics Overwritten when Specific UUIDs Are Used

  • March 9, 2023
  • 1 reply
  • 1053 views

Hello,

I am writing some BLE firmware using the BlueNRG-M0A model on a Nucleo board to try and develop an understanding. To try and build an understanding, I am creating multiple services and characteristics with different functions (read only, read/write, etc.) and I am noticing a problem when I try to use the ST BLE Toolbox to verify the proper setup, I notice that certain UUIDs cause previously created characteristics to be overwritten.

For example, when I use the following UUIDs, all only the last characteristic (E909930B-39D7-0000-8FE12A48A02B36E6) is visible in the ST BLE Toolbox.

Characteristic UUIDs:

E909900B-39D7-0000-8FE12A48A02B36E6

E909910B-39D7-0000-8FE12A48A02B36E6

E909920B-39D7-0000-8FE12A48A02B36E6

E909930B-39D7-0000-8FE12A48A02B36E6

Then, when I use the following UUIDs, all the characteristics are visible in the ST BLE Toolbox.

Characteristic UUIDs:

E909900B-39D7-0000-8FE12A48A02B36E6

E919900B-39D7-0000-8FE12A48A02B36E6

E929900B-39D7-0000-8FE12A48A02B36E6

E939900B-39D7-0000-8FE12A48A02B36E6

Can anyone explain what would cause this?

Here is the code snippet for creating the service and the character handles:

#define COPY_BATTERY_SERVICE_UUID(uuid_struct) 	 COPY_UUID_128(uuid_struct,0xE9,0x09,0x90,0x0B,0x39,0xD7,0x00,0x00,0x8F,0xE1,0x2A,0x48,0xA0,0x2B,0x36,0xE6)
#define COPY_BATTERY_SOC_CHAR_UUID(uuid_struct) 	 COPY_UUID_128(uuid_struct,0xE9,0x09,0x91,0x0B,0x39,0xD7,0x00,0x00,0x8F,0xE1,0x2A,0x48,0xA0,0x2B,0x36,0xE6)
#define COPY_VOLTAGE_POWER_CHAR_UUID(uuid_struct) 	 COPY_UUID_128(uuid_struct,0xE9,0x09,0x92,0x0B,0x39,0xD7,0x00,0x00,0x8F,0xE1,0x2A,0x48,0xA0,0x2B,0x36,0xE6)
#define COPY_TEMPERATURE_CHAR_UUID(uuid_struct) 	 COPY_UUID_128(uuid_struct,0xE9,0x09,0x93,0x0B,0x39,0xD7,0x00,0x00,0x8F,0xE1,0x2A,0x48,0xA0,0x2B,0x36,0xE6)
 
....
 
tBleStatus Add_Battery_Service(void)
{
 tBleStatus ret;
 //int32_t NumberOfCharacters=3;
 uint8_t uuid[16];
 
 COPY_BATTERY_SERVICE_UUID(uuid);
 BLUENRG_memcpy(&service_uuid.Service_UUID_128, uuid, 16);
 ret = aci_gatt_add_serv(UUID_TYPE_128, service_uuid.Service_UUID_128, PRIMARY_SERVICE,
 16, &BatteryServHandle);
 
 if (ret != BLE_STATUS_SUCCESS) {
 goto fail;
 }
 
 COPY_BATTERY_SOC_CHAR_UUID(uuid);
 BLUENRG_memcpy(&char_uuid.Char_UUID_128, uuid, 16);
 ret = aci_gatt_add_char(BatteryServHandle, UUID_TYPE_128, char_uuid.Char_UUID_128,
 2+4,
						 CHAR_PROP_NOTIFY|CHAR_PROP_READ,
 ATTR_PERMISSION_NONE,
 GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP,
 16, 0, &SOC_CharHandle);
 
 
 COPY_VOLTAGE_POWER_CHAR_UUID(uuid);
 BLUENRG_memcpy(&char_uuid.Char_UUID_128, uuid, 16);
 ret = aci_gatt_add_char(BatteryServHandle, UUID_TYPE_128, char_uuid.Char_UUID_128,
 2+4,
						 CHAR_PROP_NOTIFY|CHAR_PROP_READ,
 ATTR_PERMISSION_NONE,
 GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP,
 16, 0, &VoltagePowerCharHandle);
 
 COPY_TEMPERATURE_CHAR_UUID(uuid);
 BLUENRG_memcpy(&char_uuid.Char_UUID_128, uuid, 16);
 ret = aci_gatt_add_char(BatteryServHandle, UUID_TYPE_128, char_uuid.Char_UUID_128,
 2+4,
						 CHAR_PROP_NOTIFY|CHAR_PROP_READ,
 ATTR_PERMISSION_NONE,
 GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP,
 16, 0, &TemperatureCharHandle);
 
 
 
 if (ret != BLE_STATUS_SUCCESS) {
 goto fail;
 }
 
 return BLE_STATUS_SUCCESS;
 
fail:
 return BLE_STATUS_ERROR;
}

This topic has been closed for replies.

1 reply

KMew
KMewAuthor
Senior III
March 13, 2023

Just wanted to bump this!

Has anyone else experienced this before?