Closed mxdljwxx closed 7 months ago
LuatOS-SoC_V1022_AIR601, nimble.disconnect()不能断开蓝牙连接! 查luatos源码,luat_nimble_mode_central.c 中 if (!g_ble_conn_handle) { return 0; }
if (!g_ble_conn_handle) { return 0; }
应全局连接g_ble_conn_handle = 0 ,导致if判断语句为1,退出,不执行断链语句。 可能在lua中编程习惯,C中只有0和1。 建议修改为 if (g_ble_conn_handle < 0)
if (g_ble_conn_handle < 0)
如上
主动断开连接
![Uploading nimble_lib_mode_central-disconnect-error.png…]()
如图
LuatOS-SoC_V1022_AIR601
-_- 下周看看
咦, 已经分析出原因了? 直接给个pull request嘛
已修复
描述一下这个bug / Describe the bug
LuatOS-SoC_V1022_AIR601, nimble.disconnect()不能断开蓝牙连接! 查luatos源码,luat_nimble_mode_central.c 中
if (!g_ble_conn_handle) { return 0; }
应全局连接g_ble_conn_handle = 0 ,导致if判断语句为1,退出,不执行断链语句。 可能在lua中编程习惯,C中只有0和1。 建议修改为
if (g_ble_conn_handle < 0)
复现步骤 / To Reproduce
如上
如果正常,应该是什么样 / Expected behavior
主动断开连接
截图 / Screenshots
![Uploading nimble_lib_mode_central-disconnect-error.png…]()
日志 / Logs
如图
PACK包版本 / Version
LuatOS-SoC_V1022_AIR601
验证