fixed merge conflicts
This commit is contained in:
@ -1,18 +1,35 @@
|
||||
#include "GPSHandler.h"
|
||||
#include "devicedefinitions/GPSDefinitions.h"
|
||||
|
||||
#include "lwgps/lwgps.h"
|
||||
|
||||
GPSHandler::GPSHandler(object_id_t objectId, object_id_t deviceCommunication,
|
||||
CookieIF *comCookie):
|
||||
DeviceHandlerBase(objectId, deviceCommunication, comCookie) {
|
||||
lwgps_init(&gpsData);
|
||||
}
|
||||
|
||||
GPSHandler::~GPSHandler() {}
|
||||
|
||||
void GPSHandler::doStartUp() {
|
||||
if(internalState == InternalStates::NONE) {
|
||||
commandExecuted = false;
|
||||
internalState = InternalStates::WAIT_FIRST_MESSAGE;
|
||||
}
|
||||
|
||||
if(internalState == InternalStates::WAIT_FIRST_MESSAGE) {
|
||||
if(commandExecuted) {
|
||||
internalState = InternalStates::IDLE;
|
||||
setMode(MODE_ON);
|
||||
commandExecuted = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GPSHandler::doShutDown() {
|
||||
|
||||
internalState = InternalStates::NONE;
|
||||
commandExecuted = false;
|
||||
setMode(MODE_OFF);
|
||||
}
|
||||
|
||||
ReturnValue_t GPSHandler::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
|
||||
@ -31,7 +48,14 @@ ReturnValue_t GPSHandler::buildCommandFromCommand(
|
||||
|
||||
ReturnValue_t GPSHandler::scanForReply(const uint8_t *start, size_t len,
|
||||
DeviceCommandId_t *foundId, size_t *foundLen) {
|
||||
// Pass data to GPS library
|
||||
int result = lwgps_process(&gpsData, start, len);
|
||||
if(result != 0) {
|
||||
sif::warning << "GPSHandler::scanForReply: Issue processing GPS data with lwgps"
|
||||
<< std::endl;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
|
||||
}
|
||||
|
||||
ReturnValue_t GPSHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||
@ -49,9 +73,10 @@ ReturnValue_t GPSHandler::initializeLocalDataPool(
|
||||
}
|
||||
|
||||
void GPSHandler::fillCommandAndReplyMap() {
|
||||
|
||||
// Reply length does not matter, packets should always arrive periodically
|
||||
insertInReplyMap(GpsHyperion::GPS_REPLY, 4, nullptr, 0, true);
|
||||
}
|
||||
|
||||
void GPSHandler::modeChanged() {
|
||||
|
||||
internalState = InternalStates::NONE;
|
||||
}
|
||||
|
@ -2,7 +2,14 @@
|
||||
#define MISSION_DEVICES_GPSHANDLER_H_
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
#include "lwgps/lwgps.h"
|
||||
|
||||
/**
|
||||
* @brief Device handler for the Hyperion HT-GPS200 device
|
||||
* @details
|
||||
* Flight manual:
|
||||
* https://egit.irs.uni-stuttgart.de/redmine/projects/eive-flight-manual/wiki/Hyperion_HT-GPS200
|
||||
*/
|
||||
class GPSHandler: public DeviceHandlerBase {
|
||||
public:
|
||||
GPSHandler(object_id_t objectId, object_id_t deviceCommunication,
|
||||
@ -10,6 +17,13 @@ public:
|
||||
virtual ~GPSHandler();
|
||||
|
||||
protected:
|
||||
enum class InternalStates {
|
||||
NONE,
|
||||
WAIT_FIRST_MESSAGE,
|
||||
IDLE
|
||||
};
|
||||
InternalStates internalState = InternalStates::NONE;
|
||||
bool commandExecuted = false;
|
||||
|
||||
/* DeviceHandlerBase overrides */
|
||||
ReturnValue_t buildTransitionDeviceCommand(
|
||||
@ -33,9 +47,7 @@ protected:
|
||||
LocalDataPoolManager &poolManager) override;
|
||||
|
||||
private:
|
||||
|
||||
lwgps_t gpsData = {};
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* MISSION_DEVICES_GPSHANDLER_H_ */
|
||||
|
@ -7,10 +7,13 @@
|
||||
/**
|
||||
* @brief This is the device handler class for all gomspace devices.
|
||||
*
|
||||
* @details All gomspace devices are similar with respect to commanding. Thus
|
||||
* most of the functionality to command a gomspace device can be
|
||||
* accommodated in one class. For device specific functions, a new
|
||||
* class could be created by inheriting from the GomspaceDeviceHandler.
|
||||
* @details
|
||||
* All gomspace devices are similar with respect to commanding. Thusmost of the functionality to
|
||||
* command a gomspace device can be accommodated in one class. For device specific functions, a new
|
||||
* class could be created by inheriting from the GomspaceDeviceHandler.
|
||||
*
|
||||
* Flight manual:
|
||||
* https://egit.irs.uni-stuttgart.de/redmine/projects/eive-flight-manual/wiki/Gomspace_PCDU_P60_System
|
||||
*/
|
||||
class GomspaceDeviceHandler: public DeviceHandlerBase {
|
||||
public:
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include <fsfw/action/HasActionsIF.h>
|
||||
#include <fsfw/datapool/PoolReadGuard.h>
|
||||
#include <fsfw_hal/linux/utility.h>
|
||||
|
||||
#include "GyroADIS16507Handler.h"
|
||||
|
||||
#if OBSW_ADIS16507_LINUX_COM_IF == 1
|
||||
#include "fsfw_hal/linux/utility.h"
|
||||
#include "fsfw_hal/linux/spi/SpiCookie.h"
|
||||
#include "fsfw_hal/linux/spi/SpiComIF.h"
|
||||
#include "fsfw_hal/linux/UnixFileGuard.h"
|
||||
|
@ -11,6 +11,12 @@ class SpiComIF;
|
||||
class SpiCookie;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Device handle for the ADIS16507 Gyroscope by Analog Devices
|
||||
* @details
|
||||
* Flight manual:
|
||||
* https://egit.irs.uni-stuttgart.de/redmine/projects/eive-flight-manual/wiki/ADIS16507_Gyro
|
||||
*/
|
||||
class GyroADIS16507Handler: public DeviceHandlerBase {
|
||||
public:
|
||||
GyroADIS16507Handler(object_id_t objectId, object_id_t deviceCommunication,
|
||||
|
@ -14,6 +14,8 @@
|
||||
* by STMicroeletronics
|
||||
* @details
|
||||
* Datasheet can be found online by googling LIS3MDL.
|
||||
* Flight manual:
|
||||
* https://egit.irs.uni-stuttgart.de/redmine/projects/eive-flight-manual/wiki/LIS3MDL_MGM
|
||||
* @author L. Loidold, R. Mueller
|
||||
*/
|
||||
class MGMHandlerLIS3MDL: public DeviceHandlerBase {
|
||||
|
@ -14,7 +14,7 @@
|
||||
* @brief Device Handler for the RM3100 geomagnetic magnetometer sensor
|
||||
* (https://www.pnicorp.com/rm3100/)
|
||||
* @details
|
||||
* Advanced documentation:
|
||||
* Flight manual:
|
||||
* https://egit.irs.uni-stuttgart.de/redmine/projects/eive-flight-manual/wiki/RM3100_MGM
|
||||
*/
|
||||
class MGMHandlerRM3100: public DeviceHandlerBase {
|
||||
|
@ -8,9 +8,11 @@
|
||||
/**
|
||||
* @brief This is the device handler for the PLOC.
|
||||
*
|
||||
* @details The PLOC uses the space packet protocol for communication. To each command the PLOC
|
||||
* answers with at least one acknowledgment and one execution report.
|
||||
*
|
||||
* @details
|
||||
* The PLOC uses the space packet protocol for communication. To each command the PLOC
|
||||
* answers with at least one acknowledgment and one execution report.
|
||||
* Flight manual:
|
||||
* https://egit.irs.uni-stuttgart.de/redmine/projects/eive-flight-manual/wiki/PLOC_Commands
|
||||
* @author J. Meier
|
||||
*/
|
||||
class PlocHandler: public DeviceHandlerBase {
|
||||
|
21
mission/devices/devicedefinitions/GPSDefinitions.h
Normal file
21
mission/devices/devicedefinitions/GPSDefinitions.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_GPSDEFINITIONS_H_
|
||||
#define MISSION_DEVICES_DEVICEDEFINITIONS_GPSDEFINITIONS_H_
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||
|
||||
namespace GpsHyperion {
|
||||
|
||||
static constexpr DeviceCommandId_t GPS_REPLY = 0;
|
||||
|
||||
enum GpsPoolIds: lp_id_t {
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
class GpsPrimaryDataset: public StaticLocalDataSet<5> {
|
||||
public:
|
||||
private:
|
||||
};
|
||||
|
||||
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_GPSDEFINITIONS_H_ */
|
@ -1,8 +1,7 @@
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
|
||||
#include <fsfw/tmtcpacket/pus/tm.h>
|
||||
#include <fsfw/objectmanager/ObjectManager.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <fsfw/tmtcpacket/pus/TmPacketPusC.h>
|
||||
#include <mission/utility/TmFunnel.h>
|
||||
|
||||
object_id_t TmFunnel::downlinkDestination = objects::NO_OBJECT;
|
||||
|
Reference in New Issue
Block a user