Skip to content

add enable GNSS API (start / stop) #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ setOutputPort KEYWORD2
factoryReset KEYWORD2
hardReset KEYWORD2
softwareResetGNSSOnly KEYWORD2
softwareEnableGNSS KEYWORD2
factoryDefault KEYWORD2

saveConfiguration KEYWORD2
Expand Down
14 changes: 14 additions & 0 deletions src/SparkFun_u-blox_GNSS_Arduino_Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7351,6 +7351,20 @@ void SFE_UBLOX_GNSS::softwareResetGNSSOnly()
sendCommand(&packetCfg, 0); // don't expect ACK
}

void SFE_UBLOX_GNSS::softwareEnableGNSS(bool enable)
{
// Issue controlled software reset (GNSS only)
packetCfg.cls = UBX_CLASS_CFG;
packetCfg.id = UBX_CFG_RST;
packetCfg.len = 4;
packetCfg.startingSpot = 0;
payloadCfg[0] = 0; // hot start
payloadCfg[1] = 0; // hot start
payloadCfg[2] = enable ? 0x09 : 0x08; // 0x09 = start GNSS, 0x08 = stop GNSS
payloadCfg[3] = 0; // reserved
sendCommand(&packetCfg, 0); // don't expect ACK
}

// Reset module to factory defaults
// This still works but it is the old way of configuring ublox modules. See getVal and setVal for the new methods
bool SFE_UBLOX_GNSS::factoryDefault(uint16_t maxWait)
Expand Down
1 change: 1 addition & 0 deletions src/SparkFun_u-blox_GNSS_Arduino_Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ class SFE_UBLOX_GNSS
void factoryReset(); // Send factory reset sequence (i.e. load "default" configuration and perform hardReset)
void hardReset(); // Perform a reset leading to a cold start (zero info start-up)
void softwareResetGNSSOnly(); // Controlled Software Reset (GNSS only) only restarts the GNSS tasks, without reinitializing the full system or reloading any stored configuration.
void softwareEnableGNSS(bool enable); // Controlled Software Start / Stop (GNSS only)
bool factoryDefault(uint16_t maxWait = defaultMaxWait); // Reset module to factory defaults

// Save configuration to BBR / Flash
Expand Down