From 48199d551cca3a6cab41285c0db4d3e148aa7573 Mon Sep 17 00:00:00 2001 From: zhujiarui666 Date: Mon, 15 Aug 2022 14:05:40 +0800 Subject: [PATCH] =?UTF-8?q?xiuos\APP=5FFramework\Framework\connection\blue?= =?UTF-8?q?tooth=EF=BC=9A=201.add=20rt-thread=20msh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Framework/connection/bluetooth/adapter_bluetooth.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/APP_Framework/Framework/connection/bluetooth/adapter_bluetooth.c b/APP_Framework/Framework/connection/bluetooth/adapter_bluetooth.c index 03d116376..2f72ba2e2 100644 --- a/APP_Framework/Framework/connection/bluetooth/adapter_bluetooth.c +++ b/APP_Framework/Framework/connection/bluetooth/adapter_bluetooth.c @@ -82,7 +82,7 @@ int AdapterBlueToothInit(void) int AdapterBlueToothTest(void) { const char *bluetooth_msg = "BT Adapter Test"; - char bluetooth_recv_msg[128]; + char bluetooth_recv_msg[128]={0}; int len; int baud_rate = BAUD_RATE_9600; @@ -92,7 +92,7 @@ int AdapterBlueToothTest(void) AdapterDeviceOpen(adapter); //if bluetooth master and slave have already match, no need to AdapterDeviceControl and AdapterDeviceConnect - AdapterDeviceControl(adapter, OPE_INT, &baud_rate); + AdapterDeviceControl(adapter, OPE_INT, &baud_rate); //AdapterDeviceConnect(adapter, adapter->net_role, NULL, NULL, 0); len = strlen(bluetooth_msg); @@ -100,6 +100,7 @@ int AdapterBlueToothTest(void) while (1) { AdapterDeviceRecv(adapter, bluetooth_recv_msg, 8); printf("bluetooth_recv_msg %s\n", bluetooth_recv_msg); + AdapterDeviceSend(adapter, bluetooth_msg, len); printf("send %s after recv\n", bluetooth_msg); PrivTaskDelay(1000);