changeset 398:2d980f765034 ImproveBluetooth

Bugfix: Merge / cleanup problem: wrong variable used for receiption
author ideenmodellierer
date Mon, 02 Dec 2019 22:03:05 +0100
parents 1db721dda682
children 523892f62ce0
files Discovery/Src/tComm.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/tComm.c	Sun Dec 01 19:55:15 2019 +0100
+++ b/Discovery/Src/tComm.c	Mon Dec 02 22:03:05 2019 +0100
@@ -534,7 +534,7 @@
 
     while((answer == prompt4D4C(receiveStartByteUart)) && (timeoutCounter < UART_TIMEOUT_SECONDS)) 	/* try receive once a second */
     {
-    	if(HAL_UART_Receive(&UartHandle, (uint8_t*)&aRxByte, 1, 1000)!= HAL_OK) 							
+    	if(HAL_UART_Receive(&UartHandle, (uint8_t*)&localRx, 1, 1000)!= HAL_OK) 							
     	{
     		timeoutCounter++;
     		get_globalStateList(&status);
@@ -591,8 +591,11 @@
     count = 0;
 
     // Ignore communication on Text like RING, CONNECT,
-    if(type < 0x60)  return prompt4D4C(receiveStartByteUart);
-
+    if(type == 0xFF) return 0;
+    if(type < 0x60)
+   	{
+    	return prompt4D4C(receiveStartByteUart);
+   	}
     // service mode only commands
     if(receiveStartByteUart == BYTE_SERVICE_MODE)
     {
@@ -632,8 +635,6 @@
         logCopyDataLength.u32bit = 0;
         totalDiveCount.u16bit = 0;
 #endif
-		// Exit communication on 0xFF command
-        if(type == 0xFF) return 0;
 
         // return of command for (almost) all commands
         switch(type)