Nimble and multiple calls to ble_gattc_read

lane.ae
Posts: 2
Joined: Thu Jan 23, 2025 7:38 pm

Nimble and multiple calls to ble_gattc_read

Postby lane.ae » Thu Jan 23, 2025 7:46 pm

Hello,

Does anybody knows how to free memory that is created/occupied by calling

Code: Select all

ble_gattc_read()
?

Function

Code: Select all

ble_gattc_read()
, calls

Code: Select all

ble_gattc_proc_alloc()
, and inside that function it is called

Code: Select all

memset()
.

How do I free that allocated memory? I get error with error code 6, which is
Operation failed due to resource exhaustion
.

Thanks for any help.

lane.ae
Posts: 2
Joined: Thu Jan 23, 2025 7:38 pm

Re: Nimble and multiple calls to ble_gattc_read

Postby lane.ae » Fri Jan 24, 2025 7:25 pm

I found solution with help from this example https://github.com/espressif/esp-idf/bl ... ain.c#L375.

Problem is in that when to call multiple times to read. Not to call all in

Code: Select all

OnDicComplete()
function, but to called it after the read is over. You have to make a chain, when one read is over.

Also, i made a mistake in a previous post. Memory is not allocated in

Code: Select all

memset()
, it is allocated in function called before, it is in

Code: Select all

os_memblock_get()
.

Who is online

Users browsing this forum: No registered users and 74 guests