Skip to content

notify callback #5

@gremlin-it

Description

@gremlin-it

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 ...

    characteristic = blz_get_char_from_uuid(service, "00000003-0000-1000-8000-00805f9b3062");
    blz_char_notify_start(characteristic, indicate_cb, NULL);

    for (i=0; i < 10; ++i) {
        blz_loop_one(blz, 1000);
    }

    blz_char_notify_stop(characteristic);

this code could work ?
thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions