From ef700c0611db2fbe327a66f0ef19c35a49c06c89 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 b8cc0694e..8b2c87bbb 100644 --- a/APP_Framework/Framework/connection/bluetooth/adapter_bluetooth.c +++ b/APP_Framework/Framework/connection/bluetooth/adapter_bluetooth.c @@ -78,13 +78,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); @@ -99,7 +99,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); } @@ -107,4 +107,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