annotate Discovery/Inc/logbook.h @ 1058:3c73180fde1d Icon_Integration tip

Added log entry for surface GF: The surface GF has been added to the logbook data. A function records the GF which is present while entering close to surface condition for later storage. This is needed to avoid that an already decreased GF (after dive mode exit time) GF is stored. The surface GF is shown at logbook page1 and is available in the header data for external logbook services.
author Ideenmodellierer
date Sat, 10 Jan 2026 19:53:01 +0100
parents b0d3e8b84966
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 /// -*- coding: UTF-8 -*-
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 /// \file Discovery/Inc/logbook.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 /// \author Heinrichs Weikamp
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 /// \date 2018
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 /// $Id$
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 /// This program is free software: you can redistribute it and/or modify
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 /// it under the terms of the GNU General Public License as published by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 /// the Free Software Foundation, either version 3 of the License, or
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 /// (at your option) any later version.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 /// This program is distributed in the hope that it will be useful,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /// GNU General Public License for more details.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 /// You should have received a copy of the GNU General Public License
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 //////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 #ifndef LOGBOOK_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 #define LOGBOOK_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 #include "data_central.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 #include "settings.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32
1058
3c73180fde1d Added log entry for surface GF:
Ideenmodellierer
parents: 1020
diff changeset
33 /* FW requirement for GF_Surf data entry */
3c73180fde1d Added log entry for surface GF:
Ideenmodellierer
parents: 1020
diff changeset
34 #define GF_SURF_FW_FIRST (1)
3c73180fde1d Added log entry for surface GF:
Ideenmodellierer
parents: 1020
diff changeset
35 #define GF_SURF_FW_SECOND (7)
3c73180fde1d Added log entry for surface GF:
Ideenmodellierer
parents: 1020
diff changeset
36 #define GF_SURF_FW_THIRD (5)
3c73180fde1d Added log entry for surface GF:
Ideenmodellierer
parents: 1020
diff changeset
37
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 uint8_t setpoint_cbar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 uint8_t depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 } SSetpointLog;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 uint8_t oxygen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 uint8_t helium_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 uint8_t depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 gasbit8_Type note;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 } SGasListLog;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 //Logbook
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 uint16_t diveHeaderStart;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 uint8_t pBeginProfileData[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 uint8_t pEndProfileData[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 uint8_t profileLength[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 uint8_t logbookProfileVersion;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 uint8_t dateYear;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 uint8_t dateMonth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 uint8_t dateDay;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 uint8_t timeHour;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 uint8_t timeMinute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 uint8_t extraPagesWithData; /* from here on: changes in order with respect to OSTC3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 uint16_t maxDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 uint16_t diveTimeMinutes;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 uint8_t diveTimeSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 uint8_t samplingRate;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 int16_t minTemp;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 uint16_t surfacePressure_mbar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 uint16_t desaturationTime;
524
b33a8c1c72e5 Minor: Removed duplicated definition of number of available gases
Ideenmodellierer
parents: 486
diff changeset
73 SGasListLog gasordil[NUM_GASES];
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 uint8_t firmwareVersionLow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 uint8_t firmwareVersionHigh;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 uint16_t batteryVoltage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 uint16_t cnsAtBeginning;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 uint8_t gfAtBeginning;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 uint8_t gfAtEnd;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 uint16_t personalDiveCount;
524
b33a8c1c72e5 Minor: Removed duplicated definition of number of available gases
Ideenmodellierer
parents: 486
diff changeset
81 SSetpointLog setpoint[NUM_GASES];
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 uint16_t maxCNS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 uint16_t averageDepth_mbar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 uint16_t total_diveTime_seconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 uint8_t salinity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 uint8_t gfLow_or_Vpm_conservatism;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 uint8_t gfHigh;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 uint8_t decoModel;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 float n2Compartments[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 float heCompartments[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 uint8_t n2CompartDesatTime_min[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 uint8_t heCompartDesatTime_min[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 uint16_t diveNumber;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 uint8_t lastDecostop_m;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 uint8_t CCRmode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 uint8_t diveMode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 uint8_t hwHudLastStatus; /* from here on identical to OSTC3 again */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 uint16_t hwHudBattery_mV;
486
3db9eba89e3c Bugfix header EEPROM layout:
ideenmodellierer
parents: 471
diff changeset
99 uint8_t batteryGaugeRegisters[5]; /* former batteryGaugeRegisters (6 Bytes) which were not used => use as reserve to keep memory layout */
3db9eba89e3c Bugfix header EEPROM layout:
ideenmodellierer
parents: 471
diff changeset
100 uint8_t batteryCharge; /* first reuse byte */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 uint16_t diveHeaderEnd;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 } SLogbookHeader;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 //Logbook OSTC3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 uint8_t diveHeaderStart[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 uint8_t pBeginProfileData[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 uint8_t pEndProfileData[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 uint8_t logbookProfileVersion;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 uint8_t profileLength[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 uint8_t dateYear;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 uint8_t dateMonth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 uint8_t dateDay;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 uint8_t timeHour;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 uint8_t timeMinute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 uint8_t maxDepth[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 uint8_t diveTimeMinutes[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 uint8_t diveTimeSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 uint8_t minTemp[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 uint8_t surfacePressure_mbar[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 uint8_t desaturationTime[2];
524
b33a8c1c72e5 Minor: Removed duplicated definition of number of available gases
Ideenmodellierer
parents: 486
diff changeset
123 uint8_t gasordil[NUM_GASES*4];
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 uint8_t firmwareVersionLow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 uint8_t firmwareVersionHigh;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 uint8_t batteryVoltage[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 uint8_t samplingRate;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 uint8_t cnsAtBeginning[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 uint8_t gfAtBeginning;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 uint8_t gfAtEnd;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 uint8_t personalDiveCount[2];
471
73da921869d9 bugfix: implement battery charge percentage in dive header
Jan Mulder <jlmulder@xs4all.nl>
parents: 458
diff changeset
132 uint8_t batteryCharge;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 uint8_t setpoint[5*2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 uint8_t salinity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 uint8_t maxCNS[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 uint8_t averageDepth_mbar[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 uint8_t total_diveTime_seconds[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 uint8_t gfLow_or_Vpm_conservatism;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 uint8_t gfHigh;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 uint8_t decoModel;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 uint8_t diveNumber[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 uint8_t diveMode;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 uint8_t n2CompartDesatTime_min[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 uint8_t n2Compartments[16*4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 uint8_t heCompartDesatTime_min[16];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 uint8_t heCompartments[16*4];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 uint8_t lastDecostop_m;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 uint8_t safetyDistance_10cm;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 uint8_t hwHudBattery_mV[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 uint8_t hwHudLastStatus;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 uint8_t batteryGaugeRegisters[6];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 uint8_t diveHeaderEnd[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 } SLogbookHeaderOSTC3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 //Logbook OSTC3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 uint8_t profileLength[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 uint8_t dateYear;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 uint8_t dateMonth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 uint8_t dateDay;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 uint8_t timeHour;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 uint8_t timeMinute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 uint8_t maxDepth[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 uint8_t diveTimeMinutes[2];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 uint8_t diveTimeSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 uint8_t totalDiveNumberLow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 uint8_t totalDiveNumberHigh;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 uint8_t profileVersion;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 } SLogbookHeaderOSTC3compact;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 uint8_t profileLength[3];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 uint8_t samplingRate_seconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 uint8_t numDivisors;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 uint8_t tempType;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 uint8_t tempLength;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 uint8_t tempDivisor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 uint8_t deco_ndlType;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 uint8_t deco_ndlLength;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 uint8_t deco_ndlDivisor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 uint8_t gfType;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 uint8_t gfLength;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 uint8_t gfDivisor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 uint8_t ppo2Type;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 uint8_t ppo2Length;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 uint8_t ppo2Divisor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 uint8_t decoplanType;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 uint8_t decoplanLength;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 uint8_t decoplanDivisor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 uint8_t cnsType;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 uint8_t cnsLength;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 uint8_t cnsDivisor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 uint8_t tankType;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 uint8_t tankLength;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 uint8_t tankDivisor;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 } SSmallHeader;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 int8_t percentageO2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 int8_t percentageHe;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 } SManualGas;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207
270
2e58a4094770 feature, debug: make simulator write a logbook entry
Jan Mulder <jlmulder@xs4all.nl>
parents: 269
diff changeset
208 void logbook_writeSample(const SDiveState *state);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 void logbook_initNewdiveProfile(const SDiveState* pInfo, SSettings* pSettings);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 void logbook_EndDive(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 SLogbookHeader* logbook_getCurrentHeader(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 SLogbookHeaderOSTC3 * logbook_build_ostc3header(SLogbookHeader* pLogbookHeader);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 SLogbookHeaderOSTC3compact * logbook_build_ostc3header_compact(SLogbookHeader* pHead);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 uint8_t logbook_getNumberOfHeaders(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 uint8_t logbook_getHeader(uint8_t StepBackwards,SLogbookHeader* pLogbookHeader);
455
928a14568689 Reactivated samples for bottle pressure information:
ideenmodellierer
parents: 270
diff changeset
218 uint16_t logbook_readSampleData(uint8_t StepBackwards, uint16_t length,uint16_t* depth, uint8_t* gasid, int16_t* temperature, uint16_t* ppo2,
928a14568689 Reactivated samples for bottle pressure information:
ideenmodellierer
parents: 270
diff changeset
219 uint16_t* setpoint, uint16_t* sensor1, uint16_t* sensor2, uint16_t* sensor3, uint16_t* cns, uint8_t* bailout,
1020
b0d3e8b84966 Fix: Add Missing Compass Heading to the Logbook Reader.
heinrichsweikamp
parents: 1014
diff changeset
220 uint16_t* decostopDepth, uint16_t* tank, uint16_t* compassHeading, SGnssCoord* pPosition, uint16_t* scrubberState, uint8_t* event);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 void logbook_test(void);
941
6d8ae8fbccf5 Added gnss to logbook data:
Ideenmodellierer
parents: 610
diff changeset
222 void logbook_InitAndWrite(SDiveState* pStateReal);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 void logbook_recover_brokenlog(uint8_t headerId);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 uint16_t logbook_lastDive_diveNumber(void);
458
5dd996ed8611 Added ppO2 to dummy profile data:
ideenmodellierer
parents: 455
diff changeset
226 uint16_t logbook_fillDummySampleBuffer(SLogbookHeader* pHeader);
455
928a14568689 Reactivated samples for bottle pressure information:
ideenmodellierer
parents: 270
diff changeset
227 void logbook_readDummySamples(uint8_t* pTarget, uint16_t length);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228
1014
8c0134a287da Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents: 941
diff changeset
229 void logScrubberState(const SScrubberData *scrubberData);
8c0134a287da Add a log data event to the scrubber timer at the start of the dive and every time the timer (in minutes)
heinrichsweikamp
parents: 941
diff changeset
230
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 #endif /* LOGBOOK_H */