Skip to content
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

get notification crash issue #224

Open
sumit1478 opened this issue Jun 16, 2021 · 2 comments
Open

get notification crash issue #224

sumit1478 opened this issue Jun 16, 2021 · 2 comments

Comments

@sumit1478
Copy link

sumit1478 commented Jun 16, 2021

Hi,
I used notification .c code to test receiving data from Nexgo-POS-BLE device.It was able to recive correct data but was crashing with following error:

Notification Handler: 30 30 30 30 30 30 30 30 30 30 30
munmap_chunk(): invalid pointer
Aborted (core dumped)

(30 30 30 30 30 30 30 30 30 30 30 was the data i sent and i was able to receive it correctly)

However when i used following indication fns instead of notification fns ,it worked flawlessly:

gattlib_register_indication(connection, notification_handler, NULL);
gattlib_indication_start(connection, &g_notify_uuid);

@felwiz
Copy link

felwiz commented Oct 15, 2021

I do not see the
gattlib_indication_start() in the gattlib.h file. Are you certain this is part of the library? I want to use it.

@vl-80
Copy link
Contributor

vl-80 commented Feb 22, 2022

@felwiz

gattlib_indication_start() is in the library:

gattlib/include/gattlib.h

Lines 547 to 555 in 1afaa8b

/*
* @brief Enable indication on GATT characteristic represented by its UUID
*
* @param connection Active GATT connection
* @param uuid UUID of the characteristic that will trigger the indication
*
* @return GATTLIB_SUCCESS on success or GATTLIB_* error code
*/
int gattlib_indication_start(gatt_connection_t* connection, const uuid_t* uuid);

int gattlib_indication_start(gatt_connection_t* connection, const uuid_t* uuid) {
return connect_signal_to_characteristic_uuid(connection, uuid, on_handle_characteristic_indication);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants