Skip to content

Commit 7aaffa2

Browse files
committed
Add softwareEnableGNSS - see #174
1 parent a5c0f1e commit 7aaffa2

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

keywords.txt

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ setOutputPort KEYWORD2
153153
factoryReset KEYWORD2
154154
hardReset KEYWORD2
155155
softwareResetGNSSOnly KEYWORD2
156+
softwareEnableGNSS KEYWORD2
156157
factoryDefault KEYWORD2
157158

158159
saveConfiguration KEYWORD2

src/u-blox_GNSS.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -6446,6 +6446,20 @@ void DevUBLOXGNSS::softwareResetGNSSOnly()
64466446
sendCommand(&packetCfg, 0); // don't expect ACK
64476447
}
64486448

6449+
void DevUBLOXGNSS::softwareEnableGNSS(bool enable)
6450+
{
6451+
// Issue controlled software reset (GNSS only)
6452+
packetCfg.cls = UBX_CLASS_CFG;
6453+
packetCfg.id = UBX_CFG_RST;
6454+
packetCfg.len = 4;
6455+
packetCfg.startingSpot = 0;
6456+
payloadCfg[0] = 0; // hot start
6457+
payloadCfg[1] = 0; // hot start
6458+
payloadCfg[2] = enable ? 0x09 : 0x08; // 0x09 = start GNSS, 0x08 = stop GNSS
6459+
payloadCfg[3] = 0; // reserved
6460+
sendCommand(&packetCfg, 0); // don't expect ACK
6461+
}
6462+
64496463
// Reset module to factory defaults
64506464
// This still works but it is the old way of configuring ublox modules. See getVal and setVal for the new methods
64516465
bool DevUBLOXGNSS::factoryDefault(uint16_t maxWait)

src/u-blox_GNSS.h

+1
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ class DevUBLOXGNSS
296296
void factoryReset(); // Send factory reset sequence (i.e. load "default" configuration and perform hardReset)
297297
void hardReset(); // Perform a reset leading to a cold start (zero info start-up)
298298
void softwareResetGNSSOnly(); // Controlled Software Reset (GNSS only) only restarts the GNSS tasks, without reinitializing the full system or reloading any stored configuration.
299+
void softwareEnableGNSS(bool enable); // Controlled Software Start / Stop (GNSS only)
299300
bool factoryDefault(uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Reset module to factory defaults
300301

301302
// Save configuration to BBR / Flash

0 commit comments

Comments
 (0)