From a8f4fd7b2a5c9881d40df1bcadccb3b5f96970fa Mon Sep 17 00:00:00 2001 From: yl1185 <1182784652@qq.com> Date: Fri, 6 May 2022 11:14:13 +0800 Subject: [PATCH] connection/bluetooth/ BT verify 1.baud rate is 9600 not 115200 2.add macro control for rt-thread and xizi 3.bt is ok! --- .../connection/bluetooth/adapter_bluetooth.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/APP_Framework/Framework/connection/bluetooth/adapter_bluetooth.c b/APP_Framework/Framework/connection/bluetooth/adapter_bluetooth.c index ace054b49..59be51113 100644 --- a/APP_Framework/Framework/connection/bluetooth/adapter_bluetooth.c +++ b/APP_Framework/Framework/connection/bluetooth/adapter_bluetooth.c @@ -80,13 +80,13 @@ int AdapterBlueToothInit(void) return ret; } -/******************4G TEST*********************/ +/******************BT TEST*********************/ int AdapterBlueToothTest(void) { const char *bluetooth_msg = "BT Adapter Test"; char bluetooth_recv_msg[128]; int len; - int baud_rate = BAUD_RATE_115200; + int baud_rate = BAUD_RATE_9600; struct Adapter *adapter = AdapterDeviceFindByName(ADAPTER_BLUETOOTH_NAME); @@ -101,7 +101,7 @@ int AdapterBlueToothTest(void) printf("bluetooth_recv_msg %s\n", bluetooth_recv_msg); AdapterDeviceSend(adapter, bluetooth_msg, len); printf("send %s after recv\n", bluetooth_msg); - PrivTaskDelay(100); + PrivTaskDelay(1000); memset(bluetooth_recv_msg, 0, 128); } @@ -109,4 +109,9 @@ int AdapterBlueToothTest(void) return 0; } -SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0)|SHELL_CMD_DISABLE_RETURN, AdapterBlueToothTest, AdapterBlueToothTest, show adapter BT information); +#ifdef ADD_RTTHREAD_FETURES +MSH_CMD_EXPORT(AdapterBlueToothTest,a bt adpter sample); +#endif +#ifdef ADD_XIZI_FETURES +SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0)|SHELL_CMD_DISABLE_RETURN, AdapterWifiTest, AdapterWifiTest, show adapter wifi information); +#endif \ No newline at end of file