-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
notify callback #5
Comments
Hi! Yes this code should work, actually I have something very similar in my code. To the fact that the characteristic is defined in internal, I would like to keep it like this in order to hide the implementation. Couldn't you have the characteristics pointers global and check against them? Or you could pass the characteristics pointer as the user pointer and check that? |
about the code: now seem to work also for me ... really i don't know why it didn't work for half a day ... about the opaque structure: I agree with you to keep the implementation hide, so maybe could be simple and useful to provide some getter funcion such as "char* blx_char_uuid(blz_char* ch, char *uuid)" or something like |
yes that could be useful. in the mean time i think it should be OK to check the pointers themselves... |
Found it !!! the notify callback work if the characteristic have the "Notify" attribute but nothing happen with the "Indicate" attribute! |
okay, can I close this issue then? Welcome to add the UUID check method via pull request. |
Hi
I'm not able to implement a notify callback.
the second parameter of the function blz_char_notify_start is the callback "blz_notify_handler_t cb", it's a function that return void and accept four parameters :
const uint8_t* data
size_t len
blz_char* ch
void* user
but, if inside this callback i need to access some characteristic fields is impossible cause all definition is in the blzlib_internal.h.
I'll need to check the uuid cause I'll attach the same callback to more than one chararacteristic but ch->uuid can't be resolved.
moreover also if I attach the callback to only one characteristic nothing happen ...
this code could work ?
thanks
The text was updated successfully, but these errors were encountered: