Unable to change attribute uuid at running

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
7个帖子/ 0新
最后一篇
陈鹏莱
离线
Last seen:1个月3周前
加入:2018-12-24 02:24
Unable to change attribute uuid at running

我在SDK 5.0.4工作

我想在运行时更改存在的Service UUID和属性UUID,因为客户通过串行端口运行时由客户配置了属性UUID

我正在开发在教学蓝牙模块

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};//一个新的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);

我的期望是在上面的代码执行后uuid更改

但它不起作用

Please tell me how do I change exist service uuid and attribute uuid by which function after running

Is there any other way to change attribute uuid ?

设备:
PM_Dialog
离线
Last seen:1天3小时前
职员
加入:2018-02-08 11:03
嗨Chenpenglai,

嗨Chenpenglai,

您是否尝试过以下步骤在app_custs1_create_db()函数中??如果是,在SDK的哪个例子中?你想如何改变UUI?

uint8_t array_test_svc [] = {0x03,0x03,0.x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x0x03,0x03};uint8_t array_test_long_char [] = {0x04,0x04,0x0x04,0x04,0x0x04,0x04,0x04,0x04,0x0x04,0x04,0x04,0x04,0x04,0x04,0x0x04,0x04};memcpy(cust_prf_funcs [i] .att_db [cust1_idx_svc] .value,array_test_svc,16);//这将对服务的变化进行更改

更改特征值,您必须在两个地方应用更改:

memcpy(cust_prf_funcs[i].att_db[CUST1_IDX_SVC].value + (16*7), array_test_long_char, 16); //Apply the change to the array of the included characteristics of the service

现在将改变应用于特征本身:

memcpy(cust_prf_funcs [i] .att_db [cust1_idx_long_value_char] .value + 3,array_test_long_char,16);

Thanks, PM_Dialog

陈鹏莱
离线
Last seen:1个月3周前
加入:2018-12-24 02:24
我试图在上面执行

我试图在上面执行code in the app_custs1_create_db() function, as follows

void app_custs1_create_db(void){struct custs1_create_db_req * req * req = ke_msg_alloc(custs1_create_db_req,task_custs1,task_app,custs1_create_db_req);uint8_t i = 0;/ ******************添加********************* / uint8_t array_test_svc [] = {0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x0x03};uint8_t array_test_long_char [] = {0x04,0x04,0x0x04,0x04,0x0x04,0x04,0x04,0x04,0x0x04,0x04,0x04,0x04,0x04,0x04,0x0x04,0x04};memcpy(cust_prf_funcs [0] .att_db [cust1_idx_svc] .value,array_test_svc,16);memcpy(cust_prf_funcs [0] .att_db [cust1_idx_svc] .value +(16 * 7),array_test_long_char,16);memcpy(cust_prf_funcs [0] .att_db [cust1_idx_server_tx_char] .value + 3,array_test_long_char,16);/ ******************添加了********************* / whis(cust_prf_funcs [i] .task_id!= task_none){if(cust_prf_funcs [i] .task_id == task_custs1){req-> max_nb_att = cust_prf_funcs [i] .max_nb_att;休息; } else i++; } // Attribute table. In case the handle offset needs to be saved req->att_tbl = NULL; req->cfg_flag = 0; req->features = 0; // Send the message ke_msg_send(req); }

但App_custs1_create_db()函数只能在设备启动时更改服务UUID

I want to change it at runtime, do not reboot

I tried change array_test_svc[] value and called app_custs1_create_db() function after device started, but I couldn't change the service uuid

陈鹏莱
离线
Last seen:1个月3周前
加入:2018-12-24 02:24
你好PM_DIALOG.

你好PM_DIALOG.

I need your help

PM_Dialog
离线
Last seen:1天3小时前
职员
加入:2018-02-08 11:03
嗨Chenpenglai,

嗨Chenpenglai,

我为延迟道歉。我正在努力,我会尽快回复你。您使用的是哪个SDK示例?

Thanks, PM_Dialog

陈鹏莱
离线
Last seen:1个月3周前
加入:2018-12-24 02:24
我在ble_app工作

我在ble_app工作_peripheral

PM_Dialog
离线
Last seen:1天3小时前
职员
加入:2018-02-08 11:03
嗨Chenpenglai,

嗨Chenpenglai,

我使用了以下代码片段,我无法复制您的问题。我使用了SDK5.0.4的BLE_APP_PHERICALLAL示例。唯一的变化是cust1_idx_long_value_char而不是cust1_idx_server_tx_char。我假设您已创建“服务器TX”特征。

#include "user_custs1_def.h"
void app_custs1_create_db(void){struct custs1_create_db_req * req * req = ke_msg_alloc(custs1_create_db_req,task_custs1,task_app,custs1_create_db_req);uint8_t i = 0;/ ******************添加********************* / uint8_t array_test_svc [] = {0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x0x03};uint8_t array_test_long_char [] = {0x04,0x04,0x0x04,0x04,0x0x04,0x04,0x04,0x04,0x0x04,0x04,0x04,0x04,0x04,0x04,0x0x04,0x04};memcpy(cust_prf_funcs [0] .att_db [cust1_idx_svc] .value,array_test_svc,16);memcpy(cust_prf_funcs [0] .att_db [cust1_idx_svc] .value +(16 * 7),array_test_long_char,16);memcpy(cust_prf_funcs[0].att_db[CUST1_IDX_LONG_VALUE_CHAR].value + 3, array_test_long_char, 16); /****************** Added *********************/ while(cust_prf_funcs[i].task_id != TASK_NONE) { if(cust_prf_funcs[i].task_id == TASK_CUSTS1) { req->max_nb_att = cust_prf_funcs[i].max_nb_att; break; } else i++; } // Attribute table. In case the handle offset needs to be saved req->att_tbl = NULL; req->cfg_flag = 0; req->features = 0; // Send the message ke_msg_send(req); }

Since, I am not able to replicate the issue, please try to debug your code. Additionally, what do you mean that is not working? Is the device advertising? Are you able to connect? Did you run it in debug mode?

Thanks, PM_Dialog