cancel
Showing results for 
Search instead for 
Did you mean: 

Delete a BlueNRG service

Julien Quéré
Associate
Posted on April 14, 2017 at 11:32

Hello,

In order to have more than 6 services on my BlueNRG-MS device, I wanted to create a service that will add/remove the other ones.

At the beginning, it worked well, I could choose the services I wanted to activate but quickly, a problem appear. Indeed, it seems that the memory is not freed after deleting characteristics and services : after few adding/removing, I can't anymore add service because of a out of memory error.

I use the aci_gatt_del_char and aci_gatt_del_service functions to remove a service but is there something more to do ?

Thanks,

Julien

#bluenrg-ms #ble
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on April 21, 2017 at 09:39

Dear Customer,

as Andrea has said before the functions  aci_gatt_del_char() and aci_gatt_del_service() don't work properly because they don't reallocate properly the memory area used to store attribute values.

Therefore we suggest to not use them, instead to delete characteriscitc and service reboot the system (GATT init and

GAP init) and re-insert the correct services and characteristics.

Regards,

Graziella

View solution in original post

6 REPLIES 6
Andrea Palmieri
ST Employee
Posted on April 19, 2017 at 10:22

Hi Julien,

the current implementation of the

aci_gatt_del_char

and

aci_gatt_del_service

doesn't free memory.

Marchese.Graziella

can provide further info.‌

Kind regards

Andrea

Posted on April 20, 2017 at 11:28

Thank you for your response, you confirmed what I thought.

It is weird that this 2 functions doesn't free memory. Is there technical constraints that prevent to do it ?

Surely Graziella will give me more information.

Thanks,

Julien.

Posted on April 21, 2017 at 09:39

Dear Customer,

as Andrea has said before the functions  aci_gatt_del_char() and aci_gatt_del_service() don't work properly because they don't reallocate properly the memory area used to store attribute values.

Therefore we suggest to not use them, instead to delete characteriscitc and service reboot the system (GATT init and

GAP init) and re-insert the correct services and characteristics.

Regards,

Graziella

Posted on May 19, 2017 at 12:54

Does reinitialization of GATT and GAP keep current connection or disconnects it?

Posted on May 22, 2017 at 09:43

No, after a re-initialization of GATT and GAP the connections will be lost.

Posted on May 22, 2017 at 21:49

So it's not possible to change services without disconnecting? If so, how can I notify central device about new services and characteristics? Devices like mobile phones tend to cache information about services. Should I re-initialize GATT and GAP, wait for new connection and send an indication on Service Changed characteristic?