diff --git a/dummies/GpsCtrlDummy.cpp b/dummies/GpsCtrlDummy.cpp index 3a1f61ba..e69261b4 100644 --- a/dummies/GpsCtrlDummy.cpp +++ b/dummies/GpsCtrlDummy.cpp @@ -1,3 +1,21 @@ #include "GpsCtrlDummy.h" -GpsCtrlDummy::GpsCtrlDummy(object_id_t objectId): ExtendedControllerBase(objectId, 20) {} +GpsCtrlDummy::GpsCtrlDummy(object_id_t objectId) : ExtendedControllerBase(objectId, 20) {} + +ReturnValue_t GpsCtrlDummy::handleCommandMessage(CommandMessage* message) { + return returnvalue::OK; +} + +void GpsCtrlDummy::performControlOperation() {} + +ReturnValue_t GpsCtrlDummy::checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t* msToReachTheMode) { + return returnvalue::OK; +} + +ReturnValue_t GpsCtrlDummy::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) { + return returnvalue::OK; +} + +LocalPoolDataSetBase* GpsCtrlDummy::getDataSetHandle(sid_t sid) { return nullptr; } diff --git a/dummies/GpsCtrlDummy.h b/dummies/GpsCtrlDummy.h index 3d6f40bc..128a9a85 100644 --- a/dummies/GpsCtrlDummy.h +++ b/dummies/GpsCtrlDummy.h @@ -3,10 +3,18 @@ #include -class GpsCtrlDummy: public ExtendedControllerBase { -public: +class GpsCtrlDummy : public ExtendedControllerBase { + public: GpsCtrlDummy(object_id_t objectId); -private: + + private: + ReturnValue_t handleCommandMessage(CommandMessage* message) override; + void performControlOperation() override; + ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t* msToReachTheMode) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; }; #endif /* DUMMIES_GPSCTRLDUMMY_H_ */ diff --git a/dummies/GpsDhbDummy.cpp b/dummies/GpsDhbDummy.cpp index 84c82da4..d46e6265 100644 --- a/dummies/GpsDhbDummy.cpp +++ b/dummies/GpsDhbDummy.cpp @@ -10,19 +10,22 @@ void GpsDhbDummy::doStartUp() {} void GpsDhbDummy::doShutDown() {} -ReturnValue_t GpsDhbDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } +ReturnValue_t GpsDhbDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} ReturnValue_t GpsDhbDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } ReturnValue_t GpsDhbDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, - const uint8_t *commandData, size_t commandDataLen) { + const uint8_t *commandData, + size_t commandDataLen) { return returnvalue::OK; } -ReturnValue_t GpsDhbDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, - size_t *foundLen) { +ReturnValue_t GpsDhbDummy::scanForReply(const uint8_t *start, size_t len, + DeviceCommandId_t *foundId, size_t *foundLen) { return returnvalue::OK; } @@ -35,7 +38,7 @@ void GpsDhbDummy::fillCommandAndReplyMap() {} uint32_t GpsDhbDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } ReturnValue_t GpsDhbDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, - LocalDataPoolManager &poolManager) { + LocalDataPoolManager &poolManager) { localDataPoolMap.emplace(GpsHyperion::LATITUDE, new PoolEntry({0.0}, 1)); localDataPoolMap.emplace(GpsHyperion::LONGITUDE, new PoolEntry({0.0}, 1)); localDataPoolMap.emplace(GpsHyperion::ALTITUDE, new PoolEntry({0.0})); diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 1fd8a37c..b983f221 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -64,15 +65,23 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio if (cfg.addAcsBoardDummies) { std::array assemblyDhbs; - assemblyDhbs[0] = new MgmLIS3MDLDummy(objects::MGM_0_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[1] = new MgmLIS3MDLDummy(objects::MGM_2_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[2] = new MgmRm3100Dummy(objects::MGM_1_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[3] = new MgmRm3100Dummy(objects::MGM_3_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[4] = new GyroAdisDummy(objects::GYRO_0_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[5] = new GyroL3GD20Dummy(objects::GYRO_1_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[6] = new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[7] = new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - auto* gpsCtrl = new GpsDhbDummy(objects::GPS_CONTROLLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[0] = + new MgmLIS3MDLDummy(objects::MGM_0_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[1] = + new MgmLIS3MDLDummy(objects::MGM_2_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[2] = + new MgmRm3100Dummy(objects::MGM_1_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[3] = + new MgmRm3100Dummy(objects::MGM_3_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[4] = + new GyroAdisDummy(objects::GYRO_0_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[5] = + new GyroL3GD20Dummy(objects::GYRO_1_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[6] = + new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[7] = + new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + auto* gpsCtrl = new GpsCtrlDummy(objects::GPS_CONTROLLER); ObjectFactory::createAcsBoardAssy(pwrSwitcher, assemblyDhbs, gpsCtrl, gpioIF); } diff --git a/dummies/helpers.h b/dummies/helpers.h index 1d30f451..878702e3 100644 --- a/dummies/helpers.h +++ b/dummies/helpers.h @@ -2,6 +2,8 @@ #include +class GpioIF; + namespace dummy { struct DummyCfg {