請問各位大佬tls_ble_server_disconnect函數的具體用法

發布於 2022-06-29 17:08:46

需要實現w801作為server時主動斷開連接的功能,發現有tls_ble_server_disconnect這個函數可以用,可是該函數的一些參數不知道怎麼獲取,求求大佬們救救小弟,謝謝。(如果有不用這個函數也可以實現主動斷開的功能的,也請一並告知小弟,感謝)

/**

  • @brief disconnect an established connection or cancel a pending one

*

  • @param[in] server_if the gatt server access interface created by app register
  • @param[in] *bd_addr the remote device address
  • @param[in] conn_id connection id create when connection established

*

  • @retval @ref tls_bt_status_t

*

  • @note None

*/
tls_bt_status_t tls_ble_server_disconnect(uint8_t server_if, const tls_bt_addr_t *bd_addr, uint16_t conn_id);

查看更多

關注者
0
被浏覽
1.5k
hshiping
hshiping 2022-06-30
這家夥很懶,什麼也沒寫!

請參考這個DEMO wm_sdk_w800_20211203srcappbtappwm_ble_server_api_demo.c

原理是BLE協議棧的底層會通過初始化注冊的回調接口,返回這個連接的句柄,應用層保存後,使用這個全局參數來執行其他API。
image.png

1 個回答

撰寫答案

請登錄後再發布答案,點擊登錄

發布
問題

分享
好友

手機
浏覽

掃碼手機浏覽