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.
我知道函数ble_gatts_disable_service(),但这只会禁用该服务,并且不会从属性数据库中删除它。
Is there a way to remove a service permanently from the database?
此致,
安迪·普罗丁
Device:
Hi apoudret,
在调用BLE_GATTS_DISABLE_SERVICE()之后,请从BLE_SERVICE.H标题文件中使用BLE_SERVICE_REMOVE()函数使用BLE_SERVICE.H头文件?该函数从内部数据库中删除服务。请尝试一下,让我知道。
Thanks, 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.
有没有方法可以永久地从属性数据库中删除服务?
此致,
安迪·普罗丁
Hi apoudret.
不,有一种方法可以从属性数据库中永久删除服务。我想这是唯一的方法是重置数据库,但没有推荐。你能解释你的问题吗?你想制作免费的记忆空间吗?
Thanks, 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.
然后用户可以删除他创建的服务并为例创建其他服务。
If the services are never truly deleted from the database, I suppose I am losing memory space.
此致,
Andy
Hello Apoudret
你能告诉我如何创建BLE服务并添加特征?
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
Hello PM_Dialog,
I do not allocate any memory dynamically in my service initialization.
正如我之前的评论中已经提到的那样,我失去的内存空间,我想回来的是内存空间attribute database(which was used for the attributes of my service but which I am no longer using).
此致,
Andy
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
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)
- 我可以从服务列表中删除服务(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.
此致,
Andy
Hi apoudret,
NIS不是可用于从属性数据库中删除服务的API。虽然,我会再次检查一下,如果您发现此目的,我会通知您。
Thanks, PM_Dialog
Hello PM_Dialog,
Do you have any update on this issue?
此致,
Andy
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
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)?
Hi chenpenglai,
Do you mean a custom service? If yes, please check out the following documents from our support website:
示例:DA1468X BLE客户服务
自定义蓝牙低能曲线
您能否分享有关您实施的更多细节?
Thanks, PM_Dialog
嗨PM_DIALOG.
please help me
give me a contact please
Hi PM_dialog
I'm working in sdk 5.0.4
现在我想在运行时更改存在的UUID,因为UUID由客户配置
我正在尝试开发一般的蓝牙模块
please tell me how do I change exist uuid by which function after running
我正在做以下
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
我无法在SDK 5.0.4中找到ble_gatts_add_service()和ble_gatts_register_service()函数
Hi PM_dialog
I really need your help!!!
Hi 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-semicondiondiondiondiondum/forums/post/dialog-smartbond-bluetooth-low-energy-42-%e2%80%93-software/can-arbitrary-uuid-set- after.
Thanks, PM_Dialog