changeset 716:74cfd91199bd

Added customizable data area for specific sensor data: In future smart sensors will be connected via UART interface. These sensor provide additional data like diagnostics or id numbers which may vary from sensor to sensor. That's why a byte array has been added which stores up to 32 bytes. The layout of this array may be specific to sensor needs. As first example temperature and id number of the DiveO2 sensor are provided.
author Ideenmodellierer
date Sun, 20 Nov 2022 20:43:04 +0100
parents 6c620f5f4834
children 88f73b05d45c
files Discovery/Src/data_exchange_main.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/data_exchange_main.c	Sun Nov 20 20:42:33 2022 +0100
+++ b/Discovery/Src/data_exchange_main.c	Sun Nov 20 20:43:04 2022 +0100
@@ -931,6 +931,7 @@
 	/* internal sensor: HUD data	 */
 	if(pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_OPTIC)
 	{
+		pStateReal->lifeData.extIf_sensor_Id = 0;
 		for(int i=0;i<3;i++)
 		{
 			pStateReal->lifeData.ppO2Sensor_bar[i] = get_ppO2Sensor_bar(i);
@@ -961,7 +962,11 @@
 						pStateReal->lifeData.ppO2Sensor_bar[idx] = pStateReal->lifeData.sensorVoltage_mV[idx] * pSettings->ppo2sensors_calibCoeff[idx];
 					}
 				}
-
+			}
+			pStateReal->lifeData.extIf_sensor_Id = dataIn.data[(dataIn.boolADCO2Data && DATA_BUFFER_ADC)].externalInterface_SensorID;
+			if(pStateReal->lifeData.extIf_sensor_Id != 0)
+			{
+				memcpy(pStateReal->lifeData.extIf_sensor_data, dataIn.data[(dataIn.boolADCO2Data && DATA_BUFFER_ADC)].sensor_data, 32);
 			}
 		}
 	}