我正在使用调试板试图获取通知。这在BLE_APP_PERITIVELAL示例中有效,因此我试图复制。要设置我的特征,我有:
user_custs1_def.h.
枚举{CUST1_IDX_SVC = 0,CUST1_IDX_CONTROL_POINT_CHAR,CUST1_IDX_CONTROL_POINT_VAL,CUST1_IDX_CONTROL_POINT_USER_DESC,CUST1_IDX_LED_STATE_CHAR,CUST1_IDX_LED_STATE_VAL,CUST1_IDX_LED_STATE_USER_DESC,CUST1_IDX_PRESSURE_CHAR,CUST1_IDX_PRESSURE_VAL,CUST1_IDX_PRESSURE_NTF_CFG,CUST1_IDX_PRESSURE_USER_DESC,
user_cust1_def.c.
static struct att_char128_desc cust1_pressure_char = {att_char_prop_rd |att_char_prop_ntf,{0,0},def_cust1_pressure_uuid_128};
//压力特性声明[cust1_dx_pressure_char] = {(uint8_t *)和att_decl_char,att_uuid_16_len,perm(rd,启用),sizeof(cust1_pressure_char),sizeof(cust1_pressure_char),(uint8_t *)&cust1_pressure_char},//压力特征值[cust1_idx_pressure_val]= {cust1_pressure_uuuid_128,ATT_UUID_128_LEN,PERM(RD,启用)|perm(ntf,启用),def_cust1_pressure_char_len,0,null},// ADC值1客户端特征配置描述符[cust1_idx_pressure_ntf_cfg] = {(uint8_t *)和att_decl_cfg,att_uuid_16_len,perm(rd,启用)|erm(wr,启用),sizeof(uint16_t),0,null},//压力特征用户描述[cust1_idx_pressure_user_desc] = {(uint8_t *)&att_decl_user_desc,att_uuid_16_len,perm(rd,启用),sizeof(cust1_pressure_user_desc) - 1,sizeof(cust1_pressure_user_desc) - 1,cust1_pressure_user_desc},
设置我正在使用的值:
structs custs1_val_set_req * req = ke_msg_alloc_dyn(custs1_val_set_req,task_custs1,task_app,custs1_val_set_req,def_cust1_pressure_char_len);req-> conhdl = app_env-> conhdl;req-> handle = cust1_idx_pressure_val;req-> length = def_cust1_pressure_char_len;memcpy(req->值,buff,def_cust1_pressure_char_len);KE_MSG_SEND(REQ);
我可以看到通知已启用,但我从未在我的BLE测试应用程序上收到它们。我错过了什么?
谢谢,
约翰
设备:
嗨,约翰,
您发送到SDK配置文件的邮件应该是Custs1_Val_ntf_req但不是custs1_val_set_req。