Skip to main content
Julien Quéré
Associate
April 14, 2017
Solved

Delete a BlueNRG service

  • April 14, 2017
  • 2 replies
  • 1428 views
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
This topic has been closed for replies.
Best answer by marchese.graziella
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

2 replies

Andrea Palmieri
ST Employee
April 19, 2017
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

Julien Quéré
Associate
April 20, 2017
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.

marchese.graziella
Visitor II
April 21, 2017
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

grzegorz
Associate III
May 19, 2017
Posted on May 19, 2017 at 12:54

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

marchese.graziella
Visitor II
May 22, 2017
Posted on May 22, 2017 at 09:43

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