Hello,
当我创建枚举类型EX时,我对每项服务有限的特征有很多麻烦,请:
enum {
// Service ADC1 CONTROL
CUST1_IDX_SVC_ADC1_CONTROL = 0, // Service ADC1
CUST1_IDX_SVC_ADC2_CONTROL, // Service ADC2
CUST1_IDX_SVC_ADC3_CONTROL, // Service ADC3
CUST1_IDX_SVC_ADC4_CONTROL, // Service ADC4
CUST1_IDX_SVC_THERMISTOR_CONTROL , // Service THERMISTOR
// Characteristic for ADC1 sensor
/ ***************************/
char_adc1_cont_notif_type_char,
char_adc1_cont_notif_type_val,
CHAR_ADC1_CONT_NOTIF_TYPE_USER_DESC,
.......................
.......................
cust1_idx_nb,
}
因此,Cust1_IDX_NB的MAX是46,为什么Cust1_DX_NB的限制为46.当我创建更多特征构建程序OK时,但是在运行调试代码时停止“void wrap_platform_reset(uint32_t错误)”。我做错了什么?
I change code in the ble_app_peripheral example version SDK 5.0.4.
设备:
嗨曼希克灵,
您可以在服务中拥有的特征量受到用于数据库的堆量的限制,您获得的平台重置是因为无法分配更多的空间(似乎您的特性超过了为db_heap_sz定义的默认值这是1024),您应该收到一个错误0xf2f2f2f2 reset_mem_alloc_fail。您可以尝试增加DB_HEAP的大小并尝试再次宣传。为了增加数据库堆的大小,转到DA1458x_config_Advanced.h并在#define use_memory_map下添加#define db_heap_sz,例如您想要2048的理想大小。
Thanks MT_dialog
Hi MT_dialog,
I has flow instructed but has added another problem:
/ /服务曹ADC1控制
enum
{
CUST1_IDX_SVC_ADC1_CONTROL = 0,
// Charectic Cho ADC1传感器
/ ***************************/
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
}
和
{
/ *
* CHAR_ADC1_CONT_NOTIF_TYPE W
*/
[char_adc1_cont_notif_type_char] = {(uint8_t *)和att_decl_char,att_uuid_16_len,perm(rd,启用),
sizeof(custs1_adc1_control_char), sizeof(custs1_adc1_control_char), (uint8_t*)&custs1_adc1_control_char},
//控制点特征值
[CHAR_ADC1_CONT_NOTIF_TYPE_VAL] = {CUST1_ADC1_CONT_NOTIF_TYPE_UUID_128, ATT_UUID_128_LEN, PERM(WR, ENABLE),
def_cust1_ctrladc_point_char_len,0,null},
// Control Point Characteristic User Description
[CHAR_ADC1_CONT_NOTIF_TYPE_USER_DESC] = {(uint8_t*)&att_decl_user_desc, ATT_UUID_16_LEN, PERM(RD, ENABLE),
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};
}
When i send '1' from app "BLE Scaner" to BLE device Characteristic "CHAR_ADC1_CONT_NOTIF_TYPE_VAL " receive = '1' so "CHAR_ADC1_CROSS_NOTIF_THESH_VAL" send back phones is "index++" but Characteristic "CHAR_ADC1_CONT_NOTIF_TYPE" receive index++ it does not receive data? because Characteristic has "ATT_CHAR_PROP_WR_NO_RESP" Why ?????
嗨曼希克灵,
我不太了解这个问题,可以让你改写这个问题,你是经验的问题吗?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 ?
Thanks MT_dialog
对不起mt_dialog,
My problem: ex:
当我创建第一个characteristic has property is "WR" and second has property is "RD+NTF". From app "BLE Scaner" i send data '1' to BLE device, Characteristic second reicever '1' is true and this show in app, but in the first characteristic show in app "BLE Scaner" is HEX :'0x31'=>wrong Why?? because first characteristic is "WR" not "RD or NTF". I create 30 charectic and 5 service and i define in file "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
And #define DB_HEAP_SIZE (4096 + 12) and BLE_CONNECTION_MAX_USER = 1 at file "da1458x_scatter_config.h".
嗨曼希奇
I am still not able to understand what you are trying to say, but if you send "1" and the other side interprets it as 0x31 is because you send an ascii character and "1" in hexadecimal is 0x31. Check how BLE scanner interprets the data that receives.
Thanks MT_dialog
Hi Dialog
Example : i send '1' from app "BLE Scaner" to BLE device use characteristic 1, at BLE device when recieve '1' will increase index++ so "BLE Scaner" characteristic 2 will recieve 'index++ : 1,2,3,4...' ok true because characteristic 2 has property is "RD+NTF" but characteristic 1 has only "WR" even recieve 'index++ : 1,2,3,4...' same characteristic 2 and show that in "BLE Scaner".
Hi manhaviking,
So you are writing on a writable characteritic and when the handler hits you store the value in a variable in the write handler and increase by one, and with the result value you update the value of an other characteristic which is readable and you are able to see that on your phone. After increasing the value if you expect to read 2 in the writable characteristic (suppose that you have send 1 previously) you wont be able to do so, since the index variable has been increased but that wont update the writable characteristic and even more if a characteristic is only writable you wont be able to read it.
Thanks MT_dialog
Hi dialog,
正是,只有可写特性的问题,它显示了应用程序“BLE扫描仪”的索引增加。我不知道为什么?请记住,我创建了30个以上表征
嗨曼希克灵,
So you 've changed the index by one and you could read from a writable characteristic that the value was 2 ?
Thanks MT_dialog
Hi dialog,
当我在应用程序中发出“1”在App中发送'1'时,它显示了“索引++”。它应该显示为'0x31'
嗨曼希克灵,
仍然无法理解你所做的事情,我的意思是我明白你正在增加你从580写入你的表情的价值,我没有得到什么,你什么时候读它你会看到一个不同的数字(我的意思是它是一个可写的特征,即使580改变了数据库中的值,你也不会从BLE扫描仪中读取它,这是一个在BLE扫描仪上指示的值,其最新值是应用程序已发送到的最新值外围)。那么,你是否能够通过已经实现的特征复制您在外围示例上看到的内容?
Thanks MT_dialog