5 posts / 0 new
Last post
Rony
Offline
Last seen:4 years 8 months ago
Master
Joined:2014-05-15 15:02
gattc_cmp_evt_handler

I am trying to get an event when a notification has been sent to the client.
I understand that it should get to gattc_cmp_evt_handler and there check if the event is for notify.
I am using multiple notification characteristics.
How can I check for which characteristic is the event?

thanks

VesaN
Offline
Last seen:5 years 3 months ago
Guru Master
Joined:2014-06-26 08:49
It is a good question.

It is a good question.

Check the glucose profile (glpc_task.c), line ~709. It has something like this:

case GATTC_NOTIFY:
{
// check if it's a Glucose measurement notification
if (glpc_env->gls.chars[GLPC_CHAR_MEAS].val_hdl == param->handle)
{
...
ke_msg_send(ind);
}
// check if it's a Glucose measurement context notification
else if (glpc_env - > gls.chars GLPC_CHAR_MEAS_CTX .val_hdl == param->handle)
{
...
ke_msg_send(ind);
}

Rony
Offline
Last seen:4 years 8 months ago
Master
Joined:2014-05-15 15:02
Hi Vesa,

Hi Vesa,
I need to know it on the complete event : gattc_cmp_evt_handler on the server side.
When you look at the parameters that are being provided to the routine they don't seem to include any link to which characteristic has been sent.

VesaN
Offline
Last seen:5 years 3 months ago
Guru Master
Joined:2014-06-26 08:49
Yes, you are right.

Yes, you are right.

It should definitely be possible to detect what notification has been completed but I cannot find the link between the parameters and the notification either.

I can only think ofnot-so-goodsolution that you have some table where you have a list of notifications with their corresponding status:

notification1 | inactive
notification2 | pending
notification3 | inactive

in the complete handler you can find the pending notification, which has been set ingattc_event_ind_handler. Of course, it will not work if two notifications are set to pending state simultaneous (which shouldn't ever happen?)

It's not a very good solution I guess. Tell if you find a "correct" solution

Thanks!

Rony
Offline
Last seen:4 years 8 months ago
Master
Joined:2014-05-15 15:02
Thanks

Thanks
Dialog?
Any suggestions?