I'm working in sdk 5.0.4
I want to change the exist service uuid and attribute uuid at runtime, because the attribute uuid is configured by the customer at run time through the serial port
I'm developing an AT instruction bluetooth module
我正在做以下
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);
My expectation is that uuid change after the above code execution
But it doesn't work
请告诉我如何在运行后通过哪个函数更改存在uuid和属性UUID
是否有任何其他方法可以更改属性UUID?
Device:
嗨chenpenglai,
Did you try the following steps in the app_custs1_create_db() function? ? If yes, in which example of the SDK? How you would like to change the UUI?
For changing the characteristics value you will have to apply the change in two places:
Now apply the change to the characteristic itself :
谢谢,PM_DIALOG.
我试图在app_custs1_create_db()函数中执行上面的代码,如下所示
But the app_custs1_create_db() function can only change service uuid when the device startup
我想在运行时更改它,不要重启
在设备启动后,我尝试了更改array_test_svc []值并调用app_custs1_create_db()函数,但我无法更改服务uuid
Hello PM_Dialog
我需要你的帮助
嗨chenpenglai,
My apologies for the delay. I’m working on that and I’ll try o get back to you as soon as possible. Which SDK example are you using?
谢谢,PM_DIALOG.
我在ble_app_peripheral工作
嗨chenpenglai,
I used the following code snippet and I am not able to replicate you issue. I used the ble_app_peripheral example of SDK5.0.4. The only change is CUST1_IDX_LONG_VALUE_CHAR instead of CUST1_IDX_SERVER_TX_CHAR. I assume that you have created a “Server Tx” characteristic.
因为,我无法复制这个问题,请尝试调试代码。另外,你的意思是什么不起作用?是设备广告吗?你能连接吗?你用调试模式运行它吗?
谢谢,PM_DIALOG.