This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

无法触发keyfob报警

Other Parts Discussed in Thread: CC2540

配置是CC2540开发板为central,keyfobdemo开发板为peripheral。连接正常,link loss/immediate alert/tx power服务搜索成功,CC2540读到了link loss service的alert level和tx power service的tx power。但用GATT_WriteNoRsp写入immedate alert service的alert level无反应,keyfob不报警。在keyfob跟踪了一下,keyfobdemo.c的proximityAttrCB没被触发。在发送端,GATT_WriteNoRsp的返回值是SUCCESS,而且连接没有意外断开。这时候如果把发送端关掉,keyfob也能正常报警,说明link loss service是正常工作的。发送代码如下:

attWriteReq_t req;
uint8 status;

req.handle = ias_alrtlvl_hdl;
req.len = 1;
req.value[0] = alert_lvl;
req.sig = 0;
req.cmd = 1;
status = GATT_WriteNoRsp(conn_handle, &req);

status返回零。