comparison Small_CPU/Src/uartProtocol_O2.c @ 798:e9eba334b942

Migrated CO2 protocol implementation to new format: The previous implementation was a monolithic protocol implementation which was not usable together with the multiplexer. The new implementation moves the CO2 implementation into a separate C file and decoubles the upper layer external interface, which is not able to handle DiveO2 and CO2 sensors in parallel without restriction to port assignments.
author Ideenmodellierer
date Mon, 07 Aug 2023 20:29:44 +0200
parents d4083ac09b5d
children f8a112c5e71d
comparison
equal deleted inserted replaced
797:acf6614dc396 798:e9eba334b942
47 break; 47 break;
48 case UART_O2_REQ_INFO: *cmdLength = snprintf((char*)cmdString, 10, "#VERS"); 48 case UART_O2_REQ_INFO: *cmdLength = snprintf((char*)cmdString, 10, "#VERS");
49 break; 49 break;
50 case UART_O2_REQ_ID: *cmdLength = snprintf((char*)cmdString, 10, "#IDNR"); 50 case UART_O2_REQ_ID: *cmdLength = snprintf((char*)cmdString, 10, "#IDNR");
51 break; 51 break;
52 case UART_O2_REQ_O2: *cmdLength = snprintf((char*)cmdString, 10, "#DOXY"); 52 case UART_O2_REQ_O2: *cmdLength = snprintf((char*)cmdString, 10, "#MOXY");
53 break; 53 break;
54 case UART_O2_REQ_RAW: *cmdLength = snprintf((char*)cmdString, 10, "#DRAW"); 54 case UART_O2_REQ_RAW: *cmdLength = snprintf((char*)cmdString, 10, "#MRAW");
55 break; 55 break;
56 default: *cmdLength = 0; 56 default: *cmdLength = 0;
57 break; 57 break;
58 } 58 }
59 if(*cmdLength != 0) 59 if(*cmdLength != 0)
97 localComState = UART_O2_IDLE; 97 localComState = UART_O2_IDLE;
98 } 98 }
99 UART_FlushRxBuffer(); 99 UART_FlushRxBuffer();
100 } 100 }
101 101
102 if(localComState == UART_O2_INIT) 102 if(localComState == UART_COMMON_INIT)
103 { 103 {
104 memset((char*) &tmpSensorDataDiveO2, 0, sizeof(tmpSensorDataDiveO2)); 104 memset((char*) &tmpSensorDataDiveO2, 0, sizeof(tmpSensorDataDiveO2));
105 externalInterface_SetSensorData(0xFF,(uint8_t*)&tmpSensorDataDiveO2); 105 externalInterface_SetSensorData(0xFF,(uint8_t*)&tmpSensorDataDiveO2);
106 106
107 localComState = UART_O2_CHECK; 107 localComState = UART_O2_CHECK;