Page 1 of 1

Bluedroid : How to use characteristics with more than 20 bytes ?

Posted: Thu Jan 19, 2023 1:51 pm
by ThomasESP32
Good afternoon,

Using Bluedroid, I managed to create a service with 2 characteristics.
I can connect to my equipement using a BLE Terminal and I can write something to the first characteristics.

The WRITE_EVT is raised in the program, and I manage to send an answer in notification using the second characteristics.
When the answer is more than 20 bytes long, I get the warning message :

W (591392) BT_GATT: attribute value too long, to be truncated to 20

the characteristics is defined this way (More than 20 bytes).

[TaskBluetooth::IDX_CHARAC_DOWNLOAD_VALUE] =
{{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_128, (uint8_t *)&GATTS_CHAR_DOWNLOAD_UUID, ESP_GATT_PERM_READ,
sizeof(char_Download_value), sizeof(char_Download_value), (uint8_t *)char_Download_value}},

const uint8_t char_Download_value[255] = {0x00};

Could you please help me ?

Best regards,