Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Fix a few places where non zero error codes were mistakenly... #79

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 6 additions & 6 deletions src/SparkFun_Ublox_Arduino_Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ boolean SFE_UBLOX_GPS::isConnected()
packetCfg.len = 0;
packetCfg.startingSpot = 0;

return sendCommand(packetCfg);
return sendCommand(packetCfg) == SFE_UBLOX_STATUS_DATA_SENT;
}
return false;
}
Expand Down Expand Up @@ -1208,7 +1208,7 @@ boolean SFE_UBLOX_GPS::saveConfiguration(uint16_t maxWait)
packetCfg.payload[4] = 0xFF; //Set any bit in the saveMask field to save current config to Flash and BBR
packetCfg.payload[5] = 0xFF;

if (sendCommand(packetCfg, maxWait) == false)
if (sendCommand(packetCfg, maxWait) != SFE_UBLOX_STATUS_DATA_SENT)
return (false); //If command send fails then bail

return (true);
Expand Down Expand Up @@ -1770,7 +1770,7 @@ boolean SFE_UBLOX_GPS::setPortOutput(uint8_t portID, uint8_t outStreamSettings,
//payloadCfg is now loaded with current bytes. Change only the ones we need to
payloadCfg[14] = outStreamSettings; //OutProtocolMask LSB - Set outStream bits

return (sendCommand(packetCfg, maxWait));
return (sendCommand(packetCfg, maxWait)) == SFE_UBLOX_STATUS_DATA_SENT;
}

//Configure a given port to input UBX, NMEA, RTCM3 or a combination thereof
Expand Down Expand Up @@ -1841,7 +1841,7 @@ boolean SFE_UBLOX_GPS::setNavigationFrequency(uint8_t navFreq, uint16_t maxWait)
payloadCfg[0] = measurementRate & 0xFF; //measRate LSB
payloadCfg[1] = measurementRate >> 8; //measRate MSB

return (sendCommand(packetCfg, maxWait));
return (sendCommand(packetCfg, maxWait)) == SFE_UBLOX_STATUS_DATA_SENT;
}

//Get the rate at which the module is outputting nav solutions
Expand Down Expand Up @@ -1897,7 +1897,7 @@ boolean SFE_UBLOX_GPS::setAutoPVT(boolean enable, boolean implicitUpdate, uint16
payloadCfg[1] = UBX_NAV_PVT;
payloadCfg[2] = enable ? 1 : 0; // rate relative to navigation freq.

bool ok = sendCommand(packetCfg, maxWait);
bool ok = sendCommand(packetCfg, maxWait) == SFE_UBLOX_STATUS_DATA_SENT;
if (ok)
{
autoPVT = enable;
Expand Down Expand Up @@ -2196,7 +2196,7 @@ boolean SFE_UBLOX_GPS::setDynamicModel(dynModel newDynamicModel, uint16_t maxWai
packetCfg.len = 36;
packetCfg.startingSpot = 0;

return (sendCommand(packetCfg, maxWait)); //Wait for ack
return (sendCommand(packetCfg, maxWait)) == SFE_UBLOX_STATUS_DATA_SENT; //Wait for ack
}

//Given a spot in the payload array, extract four bytes and build a long
Expand Down