Topic

FAQ
Login Register
关于9218作为主连接外设
May 10, 2022 17:32

/

A

/A

我们用的SDK测试在9281上测试master模式,用的是B91_demo这个case测试,现在发现和外设(心率计)已经建立连接(app_le_connection_complete_event_handle 已经调用),但是发现一个问题没有收到心率计发过来的心率数据,我在工程的函数app_gatt_data_handler加了调试发现没有调用。

用手机上BLE调试宝测试发现主机端需要开启notify才会收到心率计的数据。

我在9218的case要如何开启蓝牙master的notify功能呢?


6 replies
TL_Soyo May 11, 2022 09:48
0
/A

Hi,

   Slave设备的notify需要master写CCC特征值,salve才能开启notify。

ninver2022 [Author] May 11, 2022 10:21
0
/A

请问telink的SDK里master写CCC特征值这个有实例代码吗?我参考下


TL_Soyo May 11, 2022 13:56
0
/A

用程序中的att write 函数写ccc的值,进而把notification打开;建议查阅相关资料,另外可以用抓包软件抓取手机修改slave设备CCC的空中包,来分析机制。

ninver2022 [Author] May 11, 2022 16:32
0
/A

我看到SDK里有下面四个函数不知道哪一个是你指的att write 函数

ble_sts_t blc_gatt_pushHandleValueNotify (u16 connHandle, u16 attHandle, u8 *p, int len);
ble_sts_t blc_gatt_pushHandleValueIndicate(u16 connHandle, u16 attHandle, u8 *p, int len);
ble_sts_t blc_gatt_pushWriteCommand (u16 connHandle, u16 attHandle, u8 *p, int len);
ble_sts_t blc_gatt_pushWriteRequest (u16 connHandle, u16 attHandle, u8 *p, int len);
ble_sts_t blc_gatt_pushFindInformationRequest(u16 connHandle, u16 start_attHandle, u16 end_attHandle);

另外问下有多连接的SDK4.0的 开发文档吗?

ninver2022 [Author] May 16, 2022 16:49
0
/A

retval = blc_gatt_pushHandleValueNotify(conn_dev_list[0].conn_handle,BATT_LEVEL_INPUT_CD_H, (u8 *)&consumer_key, 2);
if(retval !=BLE_SUCCESS)
{
printf("ble send value %d",retval);
}
我调用上面函数测试发现返回值0x82,这个可能是什么问题?


ninver2022 [Author] May 19, 2022 16:15
0
/A

Slave设备的notify需要master写CCC特征值,salve才能开启notify。 这个要调用什么函数才能实现?