NetBurner 3.5.8
PDF Version
Toggle main menu visibility
gps_config.h
1
/*NB_REVISION*/
2
3
/*NB_COPYRIGHT*/
4
5
#ifndef GPS_CONFIG_H
6
#define GPS_CONFIG_H
7
8
#include <config_obj.h>
9
19
class
GPSAssistConfig :
public
config_obj
20
{
21
public
:
22
// Operating Mode
23
config_chooser
m_mode{
24
0,
25
"Mode"
,
26
"GPS operating mode: 0=Mobile (don't use saved position), 1=Fixed (use saved position for faster startup)"
,
27
{
"Mobile"
,
"Fixed"
}
28
};
29
30
// Last Known Position (for Fixed mode quick start)
31
config_double
m_lastLatitude{
32
0.0,
33
"LastLatitude"
,
34
"Last known latitude in decimal degrees (-90 to +90)"
35
};
36
37
config_double
m_lastLongitude{
38
0.0,
39
"LastLongitude"
,
40
"Last known longitude in decimal degrees (-180 to +180)"
41
};
42
43
config_double
m_lastAltitude{
44
0.0,
45
"LastAltitude"
,
46
"Last known altitude in meters above sea level"
47
};
48
49
config_int
m_lastPositionTime{
50
0,
51
"LastPositionTime"
,
52
"Unix timestamp when position was last saved (epoch seconds)"
53
};
54
55
// NTP Time Assistance
56
config_bool
m_useNtpForTimeAiding{
57
true
,
58
"UseNtpTimeAiding"
,
59
"Use NTP pool servers to get time for GPS startup assistance (recommended for NTP server applications)"
60
};
61
// TODO: check on this, are we using it?
62
config_string
m_ntpServer{
63
"pool.ntp.org"
,
64
"NtpServer"
,
65
"NTP server for time aiding (default: pool.ntp.org)"
66
};
67
68
// AssistNow Data Management
69
config_int
m_assistSaveIntervalHours{
70
24,
71
"AssistSaveInterval"
,
72
"How often to save AssistNow data to flash (hours, min=12, max=168)"
73
};
74
75
config_int
m_minRuntimeBeforeSave{
76
4,
77
"MinRuntimeBeforeSave"
,
78
"Minimum GPS runtime before saving AssistNow data (hours, ensures good data quality)"
79
};
80
81
config_int
m_minSatellitesForSave{
82
6,
83
"MinSatellitesForSave"
,
84
"Minimum satellites required to save AssistNow data (ensures good fix quality)"
85
};
86
87
// Position Auto-Save (for Fixed mode)
88
config_bool
m_autoSavePosition{
89
true
,
90
"AutoSavePosition"
,
91
"Automatically save position after achieving good fix (recommended for Fixed mode)"
92
};
93
94
config_int
m_positionSaveThreshold{
95
60,
96
"PositionSaveThreshold"
,
97
"Save position after this many seconds of good fix (prevents saving during initial acquisition)"
98
};
99
100
ConfigEndMarker;
101
102
GPSAssistConfig(config_obj &owner,
const
char
*name,
const
char
*desc =
nullptr
)
103
: config_obj(owner, name, desc) {}
104
105
// Helper methods
106
bool
isFixedMode()
const
{
return
m_mode.GetValue() == 1; }
107
bool
isMobileMode()
const
{
return
m_mode.GetValue() == 0; }
108
109
bool
hasValidPosition()
const
{
110
// Check if we have a reasonably recent position (within 30 days)
111
time_t now =
time
(
nullptr
);
112
time_t lastPos = m_lastPositionTime.GetValue();
113
return
(lastPos > 0) && (now - lastPos < 30 * 24 * 3600);
114
}
115
116
// Get save interval in seconds
117
uint32_t getAssistSaveIntervalSeconds()
const
{
118
return
m_assistSaveIntervalHours.GetValue() * 3600;
119
}
120
121
uint32_t getMinRuntimeSeconds()
const
{
122
return
m_minRuntimeBeforeSave.GetValue() * 3600;
123
}
124
};
125
126
// Global configuration instance - declare as extern here, define in main.cpp
127
extern
GPSAssistConfig
gGPSAssistConfig;
128
129
#endif
// GPS_CONFIG_H
GPSAssistConfig
Definition
gps_config.h:20
config_bool
Boolean Configuration Variable.
Definition
config_obj.h:1000
config_chooser
Chooser Configuration Variable - Select From a List of Items.
Definition
config_obj.h:2037
config_double
Double Float Configuration Variable.
Definition
config_obj.h:819
config_int
Signed 32-bit Integer Configuration Variable.
Definition
config_obj.h:703
config_string
String Configuration Variable.
Definition
config_obj.h:1130
time
time_t time(time_t *pt)
Gets the current system GMT time.
examples
PlatformSpecific
NTP1061
src
gps_config.h
Generated by
1.18.0