2021-02-17 15:54:48 +01:00
|
|
|
#ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_
|
|
|
|
#define MISSION_DEVICES_SYRLINKSHKHANDLER_H_
|
|
|
|
|
|
|
|
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
2021-02-19 11:02:27 +01:00
|
|
|
#include <mission/devices/devicedefinitions/SyrlinksDefinitions.h>
|
2021-02-18 16:16:38 +01:00
|
|
|
#include <cstring.h>
|
2021-02-17 15:54:48 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This is the device handler for the syrlinks transceiver. It handles the command
|
|
|
|
* transmission and reading of housekeeping data via the housekeeping interface. The
|
|
|
|
* transmission of telemetry and the reception of telecommands is handled by an additional
|
|
|
|
* class.
|
|
|
|
*
|
|
|
|
* @author J. Meier
|
|
|
|
*/
|
|
|
|
class SyrlinksHkHandler: public DeviceHandlerBase {
|
|
|
|
public:
|
|
|
|
|
|
|
|
SyrlinksHkHandler(object_id_t objectId, object_id_t comIF,
|
|
|
|
CookieIF * comCookie);
|
|
|
|
virtual ~SyrlinksHkHandler();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void doStartUp() override;
|
|
|
|
void doShutDown() override;
|
|
|
|
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t * id) override;
|
|
|
|
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t * id) override;
|
|
|
|
void fillCommandAndReplyMap() override;
|
|
|
|
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
|
|
|
const uint8_t * commandData,size_t commandDataLen) override;
|
|
|
|
ReturnValue_t scanForReply(const uint8_t *start, size_t remainingSize,
|
|
|
|
DeviceCommandId_t *foundId, size_t *foundLen) override;
|
|
|
|
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id,
|
|
|
|
const uint8_t *packet) override;
|
|
|
|
void setNormalDatapoolEntriesInvalid() override;
|
|
|
|
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
|
|
|
|
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
|
|
|
LocalDataPoolManager& poolManager) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2021-02-18 16:16:38 +01:00
|
|
|
std::string resetCommand = "<C04:5A5A:FF41>";
|
|
|
|
std::string readRxStatusRegCommand = "<E00::825B>";
|
|
|
|
std::string setTxModeStandby = "<W04:0040:2B9E>";
|
|
|
|
/** W - write, 04 - 4 bytes in data field, 01 - value, 40 register to write value */
|
|
|
|
std::string setTxModeModulation = "<W04:0140:5D2A>";
|
|
|
|
std::string setTxModeCw = "<W04:1040:81CF>";
|
|
|
|
|
2021-02-19 11:02:27 +01:00
|
|
|
SYRLINKS::RxStatusRegistersDataset rxStatusRegistersSet;
|
2021-02-17 15:54:48 +01:00
|
|
|
|
|
|
|
static const uint8_t MAX_CMD_LEN = 3;
|
|
|
|
|
|
|
|
uint8_t rememberRequestedSize = 0;
|
|
|
|
uint8_t rememberCommandId = TMP1075::NONE;
|
|
|
|
uint8_t cmdBuffer[MAX_CMD_LEN];
|
|
|
|
CommunicationStep communicationStep =
|
|
|
|
CommunicationStep::START_ADC_CONVERSION;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* MISSION_DEVICES_SYRLINKSHKHANDLER_H_ */
|