关于每个服务特征数量的问题

12个帖子/ 0新
最后一篇
曼希克林
离线
最后一次露面:4年1个月前
加入:2016-08-26 06:08
关于每个服务特征数量的问题

你好,
I have a trouble about limited number of Characteristic per service, when i create enum type ex:
枚举{
/ /服务ADC1CONTROL
cust1_idx_svc_adc1_control = 0,//服务ADC1
cust1_idx_svc_adc2_control,//服务ADC2
cust1_idx_svc_adc3_control,//服务ADC3
cust1_idx_svc_adc4_control,//服务ADC4
cust1_idx_svc_thermistor_control,//服务热敏电阻
// ADC1传感器的特性
/ ***************************** /
CHAR_ADC1_CONT_NOTIF_TYPE_CHAR,
CHAR_ADC1_CONT_NOTIF_TYPE_VAL ,
char_adc1_cont_notif_type_user_desc,
.......................
.......................
cust1_idx_nb.,
}

So, max of the CUST1_IDX_NB is 46, why limited of CUST1_IDX_NB is 46. When i create more Characteristic build program ok but when run debug code this stop at "void wrap_platform_reset(uint32_t error)". What i did wrong?
我在ble_app_peripheral示例版本sdk 5.0.4中更改代码。

Device:
mt_dialog.
离线
最后一次露面:2个月4天前
职员
加入:2015-06-08 11:34
Hi manhviking,

Hi manhviking,

The amount of characteristics you can have in a service is limited by the amount of the heap allocated for the database, the platform reset that you get is because you cannot allocate any more space (seems that your characteristics surpass the default value defined for the DB_HEAP_SZ which is 1024), you should get an error 0xF2F2F2F2 RESET_MEM_ALLOC_FAIL. You can try to increase the size of the db_heap and try to advertise again. In order to increase the size of your database heap, go to the da1458x_config_advanced.h and add under the #define USE_MEMORY_MAP a #define DB_HEAP_SZ with the desirable size that you would like 2048 for example.

谢谢mt_dialog.

曼希克林
离线
最后一次露面:4年1个月前
加入:2016-08-26 06:08
嗨MT_dialog,

嗨MT_dialog,
我有了指示的流程,但增加了另一个问题:
//服务CHO ADC1控制
枚举
{
cust1_idx_svc_adc1_control = 0,
// Charectic cho ADC1 sensor
/ ***************************** /
CHAR_ADC1_CONT_NOTIF_TYPE_CHAR,
CHAR_ADC1_CONT_NOTIF_TYPE_VAL ,
char_adc1_cont_notif_type_user_desc,

/************************/
CHAR_ADC1_NOTIF_VALUE_CHAR ,
char_adc1_notif_value_val,
char_adc1_notif_value_ntf_cfg,
char_adc1_notif_value_user_desc,
/****************************/
char_adc1_cont_notif_intvl_char,
char_adc1_cont_notif_intvl_val,
// char_adc1_cont_notif_intvl_cfg,
char_adc1_cont_notif_intvl_desc,

/****************************/
char_adc1_change_notif_step_char,
char_adc1_change_notif_step_val,
char_adc1_change_notif_step_cfg,
CHAR_ADC1_CHANGE_NOTIF_STEP_DESC,

/ ****************************** /
CHAR_ADC1_CROSS_NOTIF_THESH_CHAR,
CHAR_ADC1_CROSS_NOTIF_THESH_VAL,
CHAR_ADC1_CROSS_NOTIF_THESH_CFG,
CHAR_ADC1_CROSS_NOTIF_THESH_DESC,
/*********************************/
char_adc1_num_cmds_proc_char,
char_adc1_num_cmds_proc_val,
char_adc1_num_cmds_proc_cfg,
char_adc1_num_cmds_proc_desc,
cust1_idx_nb.
}
and
{
/*
* char_adc1_cont_notif_type w
* /
[CHAR_ADC1_CONT_NOTIF_TYPE_CHAR] = {(uint8_t*)&att_decl_char, ATT_UUID_16_LEN, PERM(RD, ENABLE),
sizeof(custs1_adc1_control_char),sizeof(custs1_adc1_control_char),(uint8_t *)&custs1_adc1_control_char},

// Control Point Characteristic Value
[char_adc1_cont_notif_type_val] = {cust1_adc1_cont_notif_type_uuid_128,att_uuid_128_len,perm(wr,启用),
DEF_CUST1_CTRLADC_POINT_CHAR_LEN, 0, NULL},

//控制点特征用户描述
[char_adc1_cont_notif_type_user_desc] = {(uint8_t *)&att_decl_user_desc,att_uuid_16_len,perm(rd,启用),
sizeof(cust1_adc1_cont_notif_type_user_desc) - 1,sizeof(cust1_adc1_cont_notif_type_user_desc) - 1,cust1_adc1_cont_notif_type_user_desc},
}
{
static struct att_char128_desc custs1_adc1_control_char = {att_char_prop_wr_no_resp,
{0,0},
def_cust1_adc1_cont_notif_type_uuid_128};
}

当我从app“ble扫描仪”发送'1'到ble设备特征“char_adc1_cont_notif_type_val”接收='1'所以“char_adc1_cross_notif_thesh_val”发送返回电话是“index ++”但是特征“char_adc1_cont_notif_type”接收索引++它没有接收数据?因为特征有“att_char_prop_wr_no_rep”,为什么?????

mt_dialog.
离线
最后一次露面:2个月4天前
职员
加入:2015-06-08 11:34
Hi manhviking,

Hi manhviking,

I dont quite understand the problem, can you please rephrase the question and what is that you are experincing ? Please dont just paste code, describe your setup and what you would like to do, as far as could understand you send a a write command to your device from the BLE scanner application to a characteristics value and you expect some index value (whatever that value represents) to be send back to your phone and this value appears on your phone but at a wrong characteristic ?

谢谢mt_dialog.

曼希克林
离线
最后一次露面:4年1个月前
加入:2016-08-26 06:08
sory mt_dialog,

Sorry MT_Dialog,
我的问题:例如:
当我创建第一个特征时属性是“WR”,第二个具有“RD + NTF”。从应用程序“BLE扫描仪”我将数据发送数据“1'到BLE设备,特征第二reieever'1'是真实的,在应用程序中显示了这个节目,但在App”BLE扫描仪“中的第一个特征展示中是十六进制:'0x31'=>错误为什么??因为第一个特征是“WR”而不是“RD或NTF”。我创建了30个Charectic和5服务,我定义文件“da1458x_config_advanced.h”:
#define DB_HEAP_SZ 4096
#define ENV_HEAP_SZ 2296
#define msg_heap_sz 6240.
#define non_ret_heap_sz 4096.
#define db_heap_size(4096 + 12)和ble_connection_max_user = 1 in file“da1458x_catter_config.h”。

mt_dialog.
离线
最后一次露面:2个月4天前
职员
加入:2015-06-08 11:34
Hi manhviking

Hi manhviking

我仍然无法理解您想要说的话,但如果您发送“1”,另一侧将其解释为0x31是因为您在十六进制中发送ASCII字符和“1”是0x31。检查BLE扫描仪如何解释接收的数据。

谢谢mt_dialog.

曼希克林
离线
最后一次露面:4年1个月前
加入:2016-08-26 06:08
嗨对话框

嗨对话框
示例:我将“1”从App“BLE扫描仪”发送到BLE设备使用特性1,在收到'1'时,在BLE设备上会增加索引++,因此“BLE扫描仪”特征2将收到'索引++:1,2,3,4......'好的,因为特征2有属性是“Rd + NTF”,但特征1只有“WR”甚至收到'索引++:1,2,3,4 ...''相同的特征2,并显示在“ble中”扫描仪“。

mt_dialog.
离线
最后一次露面:2个月4天前
职员
加入:2015-06-08 11:34
嗨manhaviking,

嗨manhaviking,

因此,您正在写入可写字符,当处理程序点击时,您在写处理程序中的变量中存储值并增加一个,以及更新可读的其他特征的值,并且您可以更新在手机上看到这一点。如果您希望在可写的特征中读取2(假设您先前发送1),则可以执行此操作,因为索引变量已经增加,但是如果索引变量也会更新可写特征,如果是特征只可写,你不会能够阅读它。

谢谢mt_dialog.

曼希克林
离线
最后一次露面:4年1个月前
加入:2016-08-26 06:08
嗨对话框,

嗨对话框,
Exactly, the problem at only writable characteristic, it had displayed index increase in app "BLE Scanner". I don't know why? Remember that I created 30 characterized as above

mt_dialog.
离线
最后一次露面:2个月4天前
职员
加入:2015-06-08 11:34
Hi manhviking,

Hi manhviking,

所以你已经改变了一个索引,你可以从价值为2的可写特征读取?

谢谢mt_dialog.

曼希克林
离线
最后一次露面:4年1个月前
加入:2016-08-26 06:08
嗨对话框,

嗨对话框,
When i send '1' from Writable characteristic in app after that it had displayed 'index++'. It should be display is '0x31'

mt_dialog.
离线
最后一次露面:2个月4天前
职员
加入:2015-06-08 11:34
Hi manhviking,

Hi manhviking,

Still not able to understand what is that you are doing exactly, i mean i understand that you are increasing the value that you ve written to your characteritsic from the 580, what i dont get is how when you read it back you see a different number (i mean its a writable characteristic, you wont be able to read it back from the BLE Scanner even if the 580 alters the value in the database, the value that is indicated on the BLE scanner its latest value that the application has sent to the peripheral). So, are you able to replicate what you see on the peripheral example with the allready implemented characteristics ?

谢谢mt_dialog.