obsw config, gps update

This commit is contained in:
2021-09-16 17:24:34 +02:00
parent 536c0cb0fe
commit 00bafd98fe
5 changed files with 26 additions and 9 deletions

View File

@ -23,7 +23,6 @@ GPSHyperionHandler::~GPSHyperionHandler() {}
void GPSHyperionHandler::doStartUp() {
if(internalState == InternalStates::NONE) {
commandExecuted = false;
updatePeriodicReply(true, GpsHyperion::GPS_REPLY);
internalState = InternalStates::WAIT_FIRST_MESSAGE;
}
@ -76,7 +75,7 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len,
DeviceCommandId_t *foundId, size_t *foundLen) {
// Pass data to GPS library
if(len > 0) {
sif::debug << "GPSHandler::scanForReply: Received " << len << " bytes" << std::endl;
// sif::debug << "GPSHandler::scanForReply: Received " << len << " bytes" << std::endl;
if (internalState == InternalStates::WAIT_FIRST_MESSAGE) {
// TODO: Check whether data is valid by checking whether NMEA start string is valid?
commandExecuted = true;
@ -202,3 +201,12 @@ void GPSHyperionHandler::setResetPinTriggerFunction(gpioResetFunction_t resetCal
void GPSHyperionHandler::debugInterface(uint8_t positionTracker, object_id_t objectId,
uint32_t parameter) {
}
ReturnValue_t GPSHyperionHandler::initialize() {
ReturnValue_t result = DeviceHandlerBase::initialize();
if(result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
// Enable reply immediately for now
return updatePeriodicReply(true, GpsHyperion::GPS_REPLY);
}

View File

@ -14,12 +14,16 @@
*/
class GPSHyperionHandler: public DeviceHandlerBase {
public:
using gpioResetFunction_t = ReturnValue_t (*) (void* args);
GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication,
CookieIF* comCookie, bool debugHyperionGps = false);
virtual ~GPSHyperionHandler();
using gpioResetFunction_t = ReturnValue_t (*) (void* args);
void setResetPinTriggerFunction(gpioResetFunction_t resetCallback, void*args);
ReturnValue_t initialize() override;
protected:
gpioResetFunction_t resetCallback = nullptr;