diff Common/Inc/data_exchange.h @ 714:045ff7800501

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:42:08 +0100
parents 6d7c812fc173
children 9b9ed5459d57
line wrap: on
line diff
--- a/Common/Inc/data_exchange.h	Sun Nov 20 20:37:44 2022 +0100
+++ b/Common/Inc/data_exchange.h	Sun Nov 20 20:42:08 2022 +0100
@@ -52,6 +52,8 @@
 #define DATA_BUFFER_ADC				(0x01u)
 #define DATA_BUFFER_CO2				(0x02u)
 
+#define EXTIF_SENSOR_INFO_SIZE		(32u)		/* size of data array reserved for extended sensor data from external interface */
+
 enum MODE
 {
 	MODE_SURFACE	= 0,
@@ -132,6 +134,13 @@
 
 typedef struct
 {
+	int32_t temperature;
+	uint32_t status;
+	uint64_t sensorId;
+} SSensorDataDiveO2;
+
+typedef struct
+{
 		//pressure
 		float temperature;
 		float pressure_mbar;
@@ -174,7 +183,10 @@
 		uint16_t CO2_ppm;
 		uint16_t CO2_signalStrength;
 		uint16_t externalInterface_CmdAnswer;
-		uint8_t SPARE_OldWireless[44]; /* 64 - 12 for extADC - 6 for CO2 */
+		uint8_t	alignmentdummy;
+		uint8_t externalInterface_SensorID;						/* Used to identify how to read the sensor data array */
+		uint8_t sensor_data[EXTIF_SENSOR_INFO_SIZE];			/* sensor specific data array. Content may vary from sensor type to sensor type */
+		uint8_t SPARE_OldWireless[10]; 							/* 64 - 12 for extADC - 6 for CO2 - 34 for sensor (+dummmy)*/
 		// PIC data
 		uint8_t button_setting[4]; /* see dependency to SLiveData->buttonPICdata */
 		uint8_t SPARE1;