BLE. ESP_GATTS_READ_EVT event issue

GreenPanda
Posts: 1
Joined: Fri Apr 23, 2021 1:11 pm

BLE. ESP_GATTS_READ_EVT event issue

Postby GreenPanda » Fri Apr 23, 2021 1:27 pm

Hello everyone! Help me pls. I'm using example code from gatts_server. In ESP_GATTS_READ_EVT event we can find "param->read.handle", this is id of characteristic.
So, how it works now: I'm look on terminal and writing down in a note each handle id by tapping each characteristic (READ). Then I prescribe the conditions like:

Code: Select all

switch(param->read.handle) {
            case 44:
                sprintf((char*)rsp.attr_value.value, "413W");
                break;
            case 46:
                sprintf((char*)rsp.attr_value.value, "230V");
                break;

I think this is the wrong way. Especially if I want to add or remove some characteristics... Can I find out handle id each characterisctic by some method or smth...?

Who is online

Users browsing this forum: No registered users and 142 guests