Remove Bluetooth GATT service

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
20 posts / 0 new
Last post
apoudret
Offline
Last seen:1 year 6 months ago
加入:2017-09-22 08:33
Remove Bluetooth GATT service

Hello,

My software creates and registers a GATT service, using ble_gatts_add_service() and ble_gatts_register_service(). At some point in the execution, I would like to remove permanently this service.

I am aware of the function ble_gatts_disable_service(), however this only disables the service and does not remove it from the attribute database.

Is there a way to remove a service permanently from the database?

Best regards,
Andy Poudret

Device:
PM_Dialog
Offline
Last seen:20 hours 49 min ago
Staff
加入:2018-02-08 11:03
Hi apoudret,

Hi apoudret,

Can you please use the ble_service_remove() function from ble_service.h header file, after calling the ble_gatts_disable_service()? The function removes a service from the internal database. Please, try that and let me know.

Thanks, PM_Dialog

apoudret
Offline
Last seen:1 year 6 months ago
加入:2017-09-22 08:33
Hello PM_Dialog,

Hello PM_Dialog,

As I said, I would like to remove the service from theattributedatabase.

By looking at the documentation of ble_service_remove(), it says:
"This function does not remove service from attribute database."

So it seems that ble_service_remove() removes the service from the services list but not from the attribute database.
Is there a way to remove a service permanently from the attribute database?

Best regards,
Andy Poudret

PM_Dialog
Offline
Last seen:20 hours 49 min ago
Staff
加入:2018-02-08 11:03
Hi apoudret.

Hi apoudret.

No, there is a way to remove a service permanently from the attribute database. I suppose that the only way to do this is to reset the database, but it is no recommended. Could you please explain which your issue is? Do you want to make free memory space?

Thanks, PM_Dialog

apoudret
Offline
Last seen:1 year 6 months ago
加入:2017-09-22 08:33
Hello PM_Dialog,

Hello PM_Dialog,

I'm developing a simple demo. Using input the user can create a BLE service, add characteristics and descriptors, etc.
Then the user can delete the service he has created and create other services for example.
If the services are never truly deleted from the database, I suppose I am losing memory space.

Best regards,
Andy

chenpenglai
Offline
Last seen:2 months 1 day ago
加入:2018-12-24 02:24
Hello Apoudret

Hello Apoudret

Would you tell me that how to create a BLE service and add characteristics?

PM_Dialog
Offline
Last seen:20 hours 49 min ago
Staff
加入:2018-02-08 11:03
Hi apoudret,

Hi apoudret,

As I have already mentioned in my previous comment, there is not any available API do permanently remove service from the attribute data base. If you check the initialization of the available services into the SDK, you will see that they allocate memory (OS_MALLOC) in their initialization, so it’s up to you to free (OS_FREE) the memory of the service. In case you are using custom services, you should not allocate memory dynamically in the service initialization

Thanks, PM_Dialog

apoudret
Offline
Last seen:1 year 6 months ago
加入:2017-09-22 08:33
Hello PM_Dialog,

Hello PM_Dialog,

I do not allocate any memory dynamically in my service initialization.

As I have already mentioned in my previous comment, the memory space that I am losing and that I would like to get back is the memory space in theattribute database(which was used for the attributes of my service but which I am no longer using).

Best regards,
Andy

PM_Dialog
Offline
Last seen:20 hours 49 min ago
Staff
加入:2018-02-08 11:03
Hi apoudret,

Hi apoudret,

In case that is a custom profile, I would strongly recommend you to follow the implementation of our services in the SDK, so you should allocate memory dynamically, and then free the memory.

Thanks, PM_Dialog

apoudret
Offline
Last seen:1 year 6 months ago
加入:2017-09-22 08:33
Hello,

Hello,

I think you are mistaken as I would have the same problem with a service provided by your SDK.

For example if I create & add the service CTS:
- I can disable the service (with ble_gatts_disable_service)
- I can remove storage associated to devices (ble_service_cleanup)
- I can remove service from services list (ble_service_remove)
But what I want to do is to remove the service from theattribute database. i.e. restore memory used by the ble_gatts_add_service() call.

If this not possible in your SDK, please say so.

Best regards,
Andy

PM_Dialog
Offline
Last seen:20 hours 49 min ago
Staff
加入:2018-02-08 11:03
Hi apoudret,

Hi apoudret,

不是任何API可以删除爵士vice from the attribute database. Although, I will check it again and I will let you know If you find any work around for this.

Thanks, PM_Dialog

apoudret
Offline
Last seen:1 year 6 months ago
加入:2017-09-22 08:33
Hello PM_Dialog,

Hello PM_Dialog,

Do you have any update on this issue?

Best regards,
Andy

PM_Dialog
Offline
Last seen:20 hours 49 min ago
Staff
加入:2018-02-08 11:03
Hi apoudret,

Hi apoudret,

No there is not any update. You can only use the ble_service_remove() function from ble_service.h header file, after calling the ble_gatts_disable_service().

Thanks, PM_Dialog

chenpenglai
Offline
Last seen:2 months 1 day ago
加入:2018-12-24 02:24
hi PM_Dialog

hi PM_Dialog

为祝福我在添加一个新的服务

I sent GATTM_ADD_SVC_REQ massage to the GATT Task, but it didn't seem work

Do you have any idea?

How to change exist uuid at runtime (don't reboot)?

PM_Dialog
Offline
Last seen:20 hours 49 min ago
Staff
加入:2018-02-08 11:03
嗨chenpenglai,

嗨chenpenglai,

Do you mean a custom service? If yes, please check out the following documents from our support website:

SW Example: DA1468x BLE customer service

Custom Bluetooth Low Energy Profile

Could you please share more details about your implementation?

Thanks, PM_Dialog

chenpenglai
Offline
Last seen:2 months 1 day ago
加入:2018-12-24 02:24
Hi PM_Dialog please help me

Hi PM_Dialog

please help me

chenpenglai
Offline
Last seen:2 months 1 day ago
加入:2018-12-24 02:24
give me a contact please

give me a contact please

chenpenglai
Offline
Last seen:2 months 1 day ago
加入:2018-12-24 02:24
I'm working in sdk 5.0.4

Hi PM_dialog

I'm working in sdk 5.0.4

now I want to change the exist uuid at runtime because the uuid is configured by the customer

I'm trying develop a general bluetooth module

please tell me how do I change exist uuid by which function after running

I'm doing the following

uint8_t new_uuid_arr[16]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; //a new uuid
struct att_char128_desc *p1 = (struct att_char128_desc *)cust_prf_funcs->att_db[CUST1_IDX_SERVER_TX_CHAR].value;
memcpy(p1->attr_type, new_uuid_arr, 16);

But it doesn't work

my expectation is that uuid change after the code execution ^_^

I need your help, project very urgent

I can't find ble_gatts_add_service() and ble_gatts_register_service() function in sdk 5.0.4

chenpenglai
Offline
Last seen:2 months 1 day ago
加入:2018-12-24 02:24
Hi PM_dialog

Hi PM_dialog

I really need your help!!!

PM_Dialog
Offline
Last seen:20 hours 49 min ago
Staff
加入:2018-02-08 11:03
嗨chenpenglai,

嗨chenpenglai,

Please try to not duplicate the question on the forum. This thread is related to DA1468x product family and SDK1. I have replied you in the following thread :

https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-42-%E2%80%93-software/can-arbitrary-uuid-set-after

Thanks, PM_Dialog