Nimble char descriptor
Posted: Mon Jan 06, 2020 1:04 pm
Hello,
I'm using Nimble on esp-idf v4.0-beta1. I followed the example https://github.com/espressif/esp-idf/tr ... le/bleprph to make a peripheral and it's ok but there is not any descriptors in the example.
I tried to implement that with documentation of Mynext Nimble without success.
Do you have an example that is working?
Thank you.
Here is my code :
I'm using Nimble on esp-idf v4.0-beta1. I followed the example https://github.com/espressif/esp-idf/tr ... le/bleprph to make a peripheral and it's ok but there is not any descriptors in the example.
I tried to implement that with documentation of Mynext Nimble without success.
Do you have an example that is working?
Thank you.
Here is my code :
Code: Select all
static const struct ble_gatt_svc_def gatt_svr_svcs[] =
{
{
/*** Service: Sensor Gateway. */
.type = BLE_GATT_SVC_TYPE_PRIMARY,
.uuid = &gatt_svr_svc_sensor_gateway_uuid.u,
.characteristics = (struct ble_gatt_chr_def[])
{ {
/*** Characteristic: Gateway ID. */
.uuid = &gatt_svr_chr_gateway_id_uuid.u,
.access_cb = gatt_svr_chr_access_gateway_sensor,
.flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE,
.descriptors = (struct ble_gatt_dsc_def[])
{ {
.uuid = &GATT_DESCRIPTOR_UUID.u,
.att_flags = BLE_GATT_CHR_F_READ,
.access_cb = gatt_srv_descriptor_gateway_sensor,
.arg = (void*) "description1",
},
{
0 // No more descriptors
},
}
}, {
/*** Characteristic: Script ID. */
.uuid = &gatt_svr_chr_script_id_uuid.u,
.access_cb = gatt_svr_chr_access_gateway_sensor,
.flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE,
}, {
/*** Characteristic: Server IP. */
.uuid = &gatt_svr_chr_server_ip_uuid.u,
.access_cb = gatt_svr_chr_access_gateway_sensor,
.flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE,
}, {
/*** Characteristic: ....
....