|
|
@ -9,17 +9,27 @@ SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, Co
|
|
|
|
: DeviceHandlerBase(objectId, comIF, comCookie),
|
|
|
|
: DeviceHandlerBase(objectId, comIF, comCookie),
|
|
|
|
rxDataset(this),
|
|
|
|
rxDataset(this),
|
|
|
|
txDataset(this),
|
|
|
|
txDataset(this),
|
|
|
|
|
|
|
|
temperatureSet(this),
|
|
|
|
powerSwitch(powerSwitch) {
|
|
|
|
powerSwitch(powerSwitch) {
|
|
|
|
if (comCookie == NULL) {
|
|
|
|
if (comCookie == nullptr) {
|
|
|
|
sif::error << "SyrlinksHkHandler: Invalid com cookie" << std::endl;
|
|
|
|
sif::warning << "SyrlinksHkHandler: Invalid com cookie" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SyrlinksHkHandler::~SyrlinksHkHandler() {}
|
|
|
|
SyrlinksHkHandler::~SyrlinksHkHandler() {}
|
|
|
|
|
|
|
|
|
|
|
|
void SyrlinksHkHandler::doStartUp() {
|
|
|
|
void SyrlinksHkHandler::doStartUp() {
|
|
|
|
if (mode == _MODE_START_UP) {
|
|
|
|
switch (startupState) {
|
|
|
|
setMode(MODE_ON);
|
|
|
|
case StartupState::OFF: {
|
|
|
|
|
|
|
|
startupState = StartupState::ENABLE_TEMPERATURE_PROTECTION;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case StartupState::DONE: {
|
|
|
|
|
|
|
|
setMode(_MODE_TO_ON);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -27,161 +37,144 @@ void SyrlinksHkHandler::doShutDown() { setMode(_MODE_POWER_DOWN); }
|
|
|
|
|
|
|
|
|
|
|
|
ReturnValue_t SyrlinksHkHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
|
|
|
ReturnValue_t SyrlinksHkHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
|
|
|
switch (nextCommand) {
|
|
|
|
switch (nextCommand) {
|
|
|
|
case (SYRLINKS::READ_RX_STATUS_REGISTERS):
|
|
|
|
case (syrlinks::READ_RX_STATUS_REGISTERS):
|
|
|
|
*id = SYRLINKS::READ_RX_STATUS_REGISTERS;
|
|
|
|
*id = syrlinks::READ_RX_STATUS_REGISTERS;
|
|
|
|
nextCommand = SYRLINKS::READ_TX_STATUS;
|
|
|
|
nextCommand = syrlinks::READ_TX_STATUS;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::READ_TX_STATUS):
|
|
|
|
case (syrlinks::READ_TX_STATUS):
|
|
|
|
*id = SYRLINKS::READ_TX_STATUS;
|
|
|
|
*id = syrlinks::READ_TX_STATUS;
|
|
|
|
nextCommand = SYRLINKS::READ_TX_WAVEFORM;
|
|
|
|
nextCommand = syrlinks::READ_TX_WAVEFORM;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::READ_TX_WAVEFORM):
|
|
|
|
case (syrlinks::READ_TX_WAVEFORM):
|
|
|
|
*id = SYRLINKS::READ_TX_WAVEFORM;
|
|
|
|
*id = syrlinks::READ_TX_WAVEFORM;
|
|
|
|
nextCommand = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE;
|
|
|
|
nextCommand = syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE):
|
|
|
|
case (syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE):
|
|
|
|
*id = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE;
|
|
|
|
*id = syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE;
|
|
|
|
nextCommand = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE;
|
|
|
|
nextCommand = syrlinks::READ_TX_AGC_VALUE_LOW_BYTE;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE):
|
|
|
|
case (syrlinks::READ_TX_AGC_VALUE_LOW_BYTE):
|
|
|
|
*id = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE;
|
|
|
|
*id = syrlinks::READ_TX_AGC_VALUE_LOW_BYTE;
|
|
|
|
nextCommand = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
|
|
|
|
nextCommand = syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE):
|
|
|
|
case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE):
|
|
|
|
*id = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
|
|
|
|
*id = syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
|
|
|
|
nextCommand = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE;
|
|
|
|
nextCommand = syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE):
|
|
|
|
case (syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE):
|
|
|
|
*id = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE;
|
|
|
|
*id = syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE;
|
|
|
|
nextCommand = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE;
|
|
|
|
nextCommand = syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE):
|
|
|
|
case (syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE):
|
|
|
|
*id = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE;
|
|
|
|
*id = syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE;
|
|
|
|
nextCommand = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE;
|
|
|
|
nextCommand = syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE):
|
|
|
|
case (syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE):
|
|
|
|
*id = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE;
|
|
|
|
*id = syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE;
|
|
|
|
nextCommand = SYRLINKS::READ_RX_STATUS_REGISTERS;
|
|
|
|
nextCommand = syrlinks::READ_RX_STATUS_REGISTERS;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
sif::debug << "SyrlinksHkHandler::buildNormalDeviceCommand: rememberCommandId has invalid"
|
|
|
|
sif::debug << "SyrlinksHkHandler::buildNormalDeviceCommand: rememberCommandId has invalid"
|
|
|
|
<< "command id" << std::endl;
|
|
|
|
<< "command id" << std::endl;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return buildCommandFromCommand(*id, NULL, 0);
|
|
|
|
return buildCommandFromCommand(*id, nullptr, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ReturnValue_t SyrlinksHkHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
|
|
|
ReturnValue_t SyrlinksHkHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
|
|
|
return HasReturnvaluesIF::RETURN_OK;
|
|
|
|
switch (startupState) {
|
|
|
|
|
|
|
|
case StartupState::ENABLE_TEMPERATURE_PROTECTION: {
|
|
|
|
|
|
|
|
*id = syrlinks::WRITE_LCL_CONFIG;
|
|
|
|
|
|
|
|
return buildCommandFromCommand(*id, nullptr, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return NOTHING_TO_SEND;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
|
|
|
ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
|
|
|
const uint8_t* commandData,
|
|
|
|
const uint8_t* commandData,
|
|
|
|
size_t commandDataLen) {
|
|
|
|
size_t commandDataLen) {
|
|
|
|
switch (deviceCommand) {
|
|
|
|
switch (deviceCommand) {
|
|
|
|
case (SYRLINKS::RESET_UNIT): {
|
|
|
|
case (syrlinks::RESET_UNIT): {
|
|
|
|
resetCommand.copy(reinterpret_cast<char*>(commandBuffer), resetCommand.size(), 0);
|
|
|
|
prepareCommand(resetCommand, deviceCommand);
|
|
|
|
rawPacketLen = resetCommand.size();
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case (SYRLINKS::SET_TX_MODE_STANDBY): {
|
|
|
|
case (syrlinks::SET_TX_MODE_STANDBY): {
|
|
|
|
setTxModeStandby.copy(reinterpret_cast<char*>(commandBuffer), setTxModeStandby.size(), 0);
|
|
|
|
prepareCommand(setTxModeStandby, deviceCommand);
|
|
|
|
rawPacketLen = setTxModeStandby.size();
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case (SYRLINKS::SET_TX_MODE_MODULATION): {
|
|
|
|
case (syrlinks::SET_TX_MODE_MODULATION): {
|
|
|
|
setTxModeModulation.copy(reinterpret_cast<char*>(commandBuffer), setTxModeModulation.size(),
|
|
|
|
prepareCommand(setTxModeModulation, deviceCommand);
|
|
|
|
0);
|
|
|
|
|
|
|
|
rawPacketLen = setTxModeModulation.size();
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case (SYRLINKS::SET_TX_MODE_CW): {
|
|
|
|
case (syrlinks::SET_TX_MODE_CW): {
|
|
|
|
setTxModeCw.copy(reinterpret_cast<char*>(commandBuffer), setTxModeCw.size(), 0);
|
|
|
|
prepareCommand(setTxModeCw, deviceCommand);
|
|
|
|
rawPacketLen = setTxModeCw.size();
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case (SYRLINKS::WRITE_LCL_CONFIG): {
|
|
|
|
case (syrlinks::WRITE_LCL_CONFIG): {
|
|
|
|
writeLclConfig.copy(reinterpret_cast<char*>(commandBuffer), writeLclConfig.size(), 0);
|
|
|
|
prepareCommand(writeLclConfig, deviceCommand);
|
|
|
|
rawPacketLen = writeLclConfig.size();
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case (SYRLINKS::READ_RX_STATUS_REGISTERS): {
|
|
|
|
case (syrlinks::READ_RX_STATUS_REGISTERS): {
|
|
|
|
readRxStatusRegCommand.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
prepareCommand(readRxStatusRegCommand, deviceCommand);
|
|
|
|
readRxStatusRegCommand.size(), 0);
|
|
|
|
|
|
|
|
rawPacketLen = readRxStatusRegCommand.size();
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case (SYRLINKS::READ_LCL_CONFIG): {
|
|
|
|
case (syrlinks::READ_LCL_CONFIG): {
|
|
|
|
readLclConfig.copy(reinterpret_cast<char*>(commandBuffer), readLclConfig.size(), 0);
|
|
|
|
prepareCommand(readLclConfig, deviceCommand);
|
|
|
|
rawPacketLen = readLclConfig.size();
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
rememberCommandId = SYRLINKS::READ_LCL_CONFIG;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case (SYRLINKS::READ_TX_STATUS): {
|
|
|
|
case (syrlinks::READ_TX_STATUS): {
|
|
|
|
readTxStatus.copy(reinterpret_cast<char*>(commandBuffer), readTxStatus.size(), 0);
|
|
|
|
prepareCommand(readTxStatus, deviceCommand);
|
|
|
|
rawPacketLen = readTxStatus.size();
|
|
|
|
|
|
|
|
rememberCommandId = SYRLINKS::READ_TX_STATUS;
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case (SYRLINKS::READ_TX_WAVEFORM): {
|
|
|
|
case (syrlinks::READ_TX_WAVEFORM): {
|
|
|
|
readTxWaveform.copy(reinterpret_cast<char*>(commandBuffer), readTxWaveform.size(), 0);
|
|
|
|
prepareCommand(readTxWaveform, deviceCommand);
|
|
|
|
rawPacketLen = readTxWaveform.size();
|
|
|
|
|
|
|
|
rememberCommandId = SYRLINKS::READ_TX_WAVEFORM;
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): {
|
|
|
|
case (syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE): {
|
|
|
|
readTxAgcValueHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
prepareCommand(readTxAgcValueHighByte, deviceCommand);
|
|
|
|
readTxAgcValueHighByte.size(), 0);
|
|
|
|
|
|
|
|
rawPacketLen = readTxAgcValueHighByte.size();
|
|
|
|
|
|
|
|
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE;
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): {
|
|
|
|
case (syrlinks::READ_TX_AGC_VALUE_LOW_BYTE): {
|
|
|
|
readTxAgcValueLowByte.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
prepareCommand(readTxAgcValueLowByte, deviceCommand);
|
|
|
|
readTxAgcValueLowByte.size(), 0);
|
|
|
|
|
|
|
|
rawPacketLen = readTxAgcValueLowByte.size();
|
|
|
|
|
|
|
|
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE;
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE):
|
|
|
|
case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE): {
|
|
|
|
tempPowerAmpBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
prepareCommand(tempPowerAmpBoardHighByte, deviceCommand);
|
|
|
|
tempPowerAmpBoardHighByte.size(), 0);
|
|
|
|
|
|
|
|
rawPacketLen = tempPowerAmpBoardHighByte.size();
|
|
|
|
|
|
|
|
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE):
|
|
|
|
}
|
|
|
|
tempPowerAmpBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
case (syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE): {
|
|
|
|
tempPowerAmpBoardLowByte.size(), 0);
|
|
|
|
prepareCommand(tempPowerAmpBoardLowByte, deviceCommand);
|
|
|
|
rawPacketLen = tempPowerAmpBoardLowByte.size();
|
|
|
|
|
|
|
|
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE;
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE):
|
|
|
|
}
|
|
|
|
tempBasebandBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
case (syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE): {
|
|
|
|
tempBasebandBoardHighByte.size(), 0);
|
|
|
|
prepareCommand(tempBasebandBoardHighByte, deviceCommand);
|
|
|
|
rawPacketLen = tempBasebandBoardHighByte.size();
|
|
|
|
|
|
|
|
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE;
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE):
|
|
|
|
}
|
|
|
|
tempBasebandBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
case (syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE): {
|
|
|
|
tempBasebandBoardLowByte.size(), 0);
|
|
|
|
prepareCommand(tempBasebandBoardLowByte, deviceCommand);
|
|
|
|
rawPacketLen = tempBasebandBoardLowByte.size();
|
|
|
|
|
|
|
|
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE;
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case (syrlinks::CONFIG_BPSK): {
|
|
|
|
|
|
|
|
prepareCommand(configBPSK, deviceCommand);
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case (syrlinks::CONFIG_OQPSK): {
|
|
|
|
|
|
|
|
prepareCommand(configOQPSK, deviceCommand);
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case (syrlinks::ENABLE_DEBUG): {
|
|
|
|
|
|
|
|
debug = true;
|
|
|
|
|
|
|
|
rawPacketLen = 0;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case (syrlinks::DISABLE_DEBUG): {
|
|
|
|
|
|
|
|
debug = false;
|
|
|
|
|
|
|
|
rawPacketLen = 0;
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
|
|
|
|
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -189,36 +182,42 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SyrlinksHkHandler::fillCommandAndReplyMap() {
|
|
|
|
void SyrlinksHkHandler::fillCommandAndReplyMap() {
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::RESET_UNIT, 1, nullptr, SYRLINKS::ACK_SIZE, false,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::RESET_UNIT, 1, nullptr, syrlinks::ACK_SIZE, false,
|
|
|
|
true, SYRLINKS::ACK_REPLY);
|
|
|
|
true, syrlinks::ACK_REPLY);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::SET_TX_MODE_STANDBY, 1, nullptr, SYRLINKS::ACK_SIZE,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::SET_TX_MODE_STANDBY, 1, nullptr, syrlinks::ACK_SIZE,
|
|
|
|
false, true, SYRLINKS::ACK_REPLY);
|
|
|
|
false, true, syrlinks::ACK_REPLY);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::SET_TX_MODE_MODULATION, 1, nullptr, SYRLINKS::ACK_SIZE,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::SET_TX_MODE_MODULATION, 1, nullptr, syrlinks::ACK_SIZE,
|
|
|
|
false, true, SYRLINKS::ACK_REPLY);
|
|
|
|
false, true, syrlinks::ACK_REPLY);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::SET_TX_MODE_CW, 1, nullptr, SYRLINKS::ACK_SIZE, false,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::SET_TX_MODE_CW, 1, nullptr, syrlinks::ACK_SIZE, false,
|
|
|
|
true, SYRLINKS::ACK_REPLY);
|
|
|
|
true, syrlinks::ACK_REPLY);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::WRITE_LCL_CONFIG, 1, nullptr, SYRLINKS::ACK_SIZE,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::WRITE_LCL_CONFIG, 1, nullptr, syrlinks::ACK_SIZE,
|
|
|
|
false, true, SYRLINKS::ACK_REPLY);
|
|
|
|
false, true, syrlinks::ACK_REPLY);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::READ_LCL_CONFIG, 1, nullptr,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::CONFIG_BPSK, 1, nullptr, syrlinks::ACK_SIZE,
|
|
|
|
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
false, true, syrlinks::ACK_REPLY);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::READ_TX_STATUS, 1, &txDataset,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::CONFIG_OQPSK, 1, nullptr, syrlinks::ACK_SIZE,
|
|
|
|
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
false, true, syrlinks::ACK_REPLY);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::READ_TX_WAVEFORM, 1, &txDataset,
|
|
|
|
this->insertInCommandMap(syrlinks::ENABLE_DEBUG);
|
|
|
|
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
this->insertInCommandMap(syrlinks::DISABLE_DEBUG);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE, 1, &txDataset,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::READ_LCL_CONFIG, 1, nullptr,
|
|
|
|
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE, 1, &txDataset,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::READ_TX_STATUS, 1, &txDataset,
|
|
|
|
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE, 1, nullptr,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::READ_TX_WAVEFORM, 1, &txDataset,
|
|
|
|
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE, 1, nullptr,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE, 1, &txDataset,
|
|
|
|
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE, 1, nullptr,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::READ_TX_AGC_VALUE_LOW_BYTE, 1, &txDataset,
|
|
|
|
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE, 1, nullptr,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE, 1, nullptr,
|
|
|
|
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
this->insertInCommandAndReplyMap(SYRLINKS::READ_RX_STATUS_REGISTERS, 1, &rxDataset,
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE, 1, nullptr,
|
|
|
|
SYRLINKS::RX_STATUS_REGISTERS_REPLY_SIZE);
|
|
|
|
syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE, 1, nullptr,
|
|
|
|
|
|
|
|
syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE, 1, nullptr,
|
|
|
|
|
|
|
|
syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::READ_RX_STATUS_REGISTERS, 1, &rxDataset,
|
|
|
|
|
|
|
|
syrlinks::RX_STATUS_REGISTERS_REPLY_SIZE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ReturnValue_t SyrlinksHkHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
|
|
|
ReturnValue_t SyrlinksHkHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
|
|
@ -226,25 +225,25 @@ ReturnValue_t SyrlinksHkHandler::scanForReply(const uint8_t* start, size_t remai
|
|
|
|
ReturnValue_t result = RETURN_OK;
|
|
|
|
ReturnValue_t result = RETURN_OK;
|
|
|
|
|
|
|
|
|
|
|
|
if (*start != '<') {
|
|
|
|
if (*start != '<') {
|
|
|
|
sif::error << "SyrlinksHkHandler::scanForReply: Missing start frame character" << std::endl;
|
|
|
|
sif::warning << "SyrlinksHkHandler::scanForReply: Missing start frame character" << std::endl;
|
|
|
|
return MISSING_START_FRAME_CHARACTER;
|
|
|
|
return MISSING_START_FRAME_CHARACTER;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
switch (*(start + 1)) {
|
|
|
|
switch (*(start + 1)) {
|
|
|
|
case ('A'):
|
|
|
|
case ('A'):
|
|
|
|
*foundLen = SYRLINKS::ACK_SIZE;
|
|
|
|
*foundLen = syrlinks::ACK_SIZE;
|
|
|
|
*foundId = SYRLINKS::ACK_REPLY;
|
|
|
|
*foundId = syrlinks::ACK_REPLY;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ('E'):
|
|
|
|
case ('E'):
|
|
|
|
*foundLen = SYRLINKS::RX_STATUS_REGISTERS_REPLY_SIZE;
|
|
|
|
*foundLen = syrlinks::RX_STATUS_REGISTERS_REPLY_SIZE;
|
|
|
|
*foundId = SYRLINKS::READ_RX_STATUS_REGISTERS;
|
|
|
|
*foundId = syrlinks::READ_RX_STATUS_REGISTERS;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ('R'):
|
|
|
|
case ('R'):
|
|
|
|
*foundId = rememberCommandId;
|
|
|
|
*foundId = rememberCommandId;
|
|
|
|
*foundLen = SYRLINKS::READ_ONE_REGISTER_REPLY_SIE;
|
|
|
|
*foundLen = syrlinks::READ_ONE_REGISTER_REPLY_SIE;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
sif::error << "SyrlinksHkHandler::scanForReply: Unknown reply identifier" << std::endl;
|
|
|
|
sif::warning << "SyrlinksHkHandler::scanForReply: Unknown reply identifier" << std::endl;
|
|
|
|
result = IGNORE_REPLY_DATA;
|
|
|
|
result = IGNORE_REPLY_DATA;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -265,124 +264,142 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
ReturnValue_t result;
|
|
|
|
ReturnValue_t result;
|
|
|
|
|
|
|
|
|
|
|
|
switch (id) {
|
|
|
|
switch (id) {
|
|
|
|
case (SYRLINKS::ACK_REPLY):
|
|
|
|
case (syrlinks::ACK_REPLY): {
|
|
|
|
result = verifyReply(packet, SYRLINKS::ACK_SIZE);
|
|
|
|
result = verifyReply(packet, syrlinks::ACK_SIZE);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::error << "SyrlinksHkHandler::interpretDeviceReply: Acknowledgment reply has "
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Acknowledgment reply has "
|
|
|
|
"invalid crc"
|
|
|
|
"invalid crc"
|
|
|
|
<< std::endl;
|
|
|
|
<< std::endl;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result =
|
|
|
|
result = handleAckReply(packet);
|
|
|
|
parseReplyStatus(reinterpret_cast<const char*>(packet + SYRLINKS::MESSAGE_HEADER_SIZE));
|
|
|
|
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::READ_RX_STATUS_REGISTERS):
|
|
|
|
}
|
|
|
|
result = verifyReply(packet, SYRLINKS::RX_STATUS_REGISTERS_REPLY_SIZE);
|
|
|
|
case (syrlinks::READ_RX_STATUS_REGISTERS): {
|
|
|
|
|
|
|
|
result = verifyReply(packet, syrlinks::RX_STATUS_REGISTERS_REPLY_SIZE);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read rx status registers reply "
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read rx status registers reply "
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
parseRxStatusRegistersReply(packet);
|
|
|
|
parseRxStatusRegistersReply(packet);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::READ_LCL_CONFIG):
|
|
|
|
}
|
|
|
|
result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
case (syrlinks::READ_LCL_CONFIG): {
|
|
|
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read config lcl reply "
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read config lcl reply "
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
parseLclConfigReply(packet);
|
|
|
|
parseLclConfigReply(packet);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::READ_TX_STATUS):
|
|
|
|
}
|
|
|
|
result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
case (syrlinks::READ_TX_STATUS): {
|
|
|
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read tx status reply "
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx status reply "
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
parseTxStatusReply(packet);
|
|
|
|
parseTxStatusReply(packet);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::READ_TX_WAVEFORM):
|
|
|
|
}
|
|
|
|
result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
case (syrlinks::READ_TX_WAVEFORM): {
|
|
|
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read tx waveform reply "
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx waveform reply "
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
parseTxWaveformReply(packet);
|
|
|
|
parseTxWaveformReply(packet);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE):
|
|
|
|
}
|
|
|
|
result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
case (syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE): {
|
|
|
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read tx AGC high byte reply "
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx AGC high byte reply "
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
parseAgcHighByte(packet);
|
|
|
|
parseAgcHighByte(packet);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE):
|
|
|
|
}
|
|
|
|
result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
case (syrlinks::READ_TX_AGC_VALUE_LOW_BYTE): {
|
|
|
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read tx AGC low byte reply "
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx AGC low byte reply "
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
parseAgcLowByte(packet);
|
|
|
|
parseAgcLowByte(packet);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE):
|
|
|
|
}
|
|
|
|
result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
case (syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE): {
|
|
|
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read temperature baseband board "
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read temperature baseband board "
|
|
|
|
<< "high byte reply has invalid crc" << std::endl;
|
|
|
|
<< "high byte reply has invalid crc" << std::endl;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rawTempBasebandBoard = convertHexStringToUint8(reinterpret_cast<const char*>(
|
|
|
|
rawTempBasebandBoard = convertHexStringToUint8(reinterpret_cast<const char*>(
|
|
|
|
packet + SYRLINKS::MESSAGE_HEADER_SIZE))
|
|
|
|
packet + syrlinks::MESSAGE_HEADER_SIZE))
|
|
|
|
<< 8;
|
|
|
|
<< 8;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE):
|
|
|
|
}
|
|
|
|
result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
case (syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE): {
|
|
|
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read temperature baseband board"
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read temperature baseband board"
|
|
|
|
" low byte reply has invalid crc"
|
|
|
|
" low byte reply has invalid crc"
|
|
|
|
<< std::endl;
|
|
|
|
<< std::endl;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rawTempBasebandBoard |= convertHexStringToUint8(
|
|
|
|
rawTempBasebandBoard |= convertHexStringToUint8(
|
|
|
|
reinterpret_cast<const char*>(packet + SYRLINKS::MESSAGE_HEADER_SIZE));
|
|
|
|
reinterpret_cast<const char*>(packet + syrlinks::MESSAGE_HEADER_SIZE));
|
|
|
|
tempBasebandBoard = calcTempVal(rawTempBasebandBoard);
|
|
|
|
tempBasebandBoard = calcTempVal(rawTempBasebandBoard);
|
|
|
|
|
|
|
|
temperatureSet.temperatureBasebandBoard = tempBasebandBoard;
|
|
|
|
|
|
|
|
PoolReadGuard rg(&temperatureSet);
|
|
|
|
|
|
|
|
if (debug) {
|
|
|
|
sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C"
|
|
|
|
sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C"
|
|
|
|
<< std::endl;
|
|
|
|
<< std::endl;
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE):
|
|
|
|
}
|
|
|
|
result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE): {
|
|
|
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read temperature power amplifier "
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read temperature power amplifier "
|
|
|
|
<< "board high byte reply has invalid crc" << std::endl;
|
|
|
|
<< "board high byte reply has invalid crc" << std::endl;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rawTempPowerAmplifier = 0;
|
|
|
|
rawTempPowerAmplifier = 0;
|
|
|
|
rawTempPowerAmplifier = convertHexStringToUint8(reinterpret_cast<const char*>(
|
|
|
|
rawTempPowerAmplifier = convertHexStringToUint8(reinterpret_cast<const char*>(
|
|
|
|
packet + SYRLINKS::MESSAGE_HEADER_SIZE))
|
|
|
|
packet + syrlinks::MESSAGE_HEADER_SIZE))
|
|
|
|
<< 8;
|
|
|
|
<< 8;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE):
|
|
|
|
}
|
|
|
|
result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
case (syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE): {
|
|
|
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read temperature power amplifier"
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read temperature power amplifier"
|
|
|
|
<< " board low byte reply has invalid crc" << std::endl;
|
|
|
|
<< " board low byte reply has invalid crc" << std::endl;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
return CRC_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rawTempPowerAmplifier |= convertHexStringToUint8(
|
|
|
|
rawTempPowerAmplifier |= convertHexStringToUint8(
|
|
|
|
reinterpret_cast<const char*>(packet + SYRLINKS::MESSAGE_HEADER_SIZE));
|
|
|
|
reinterpret_cast<const char*>(packet + syrlinks::MESSAGE_HEADER_SIZE));
|
|
|
|
tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier);
|
|
|
|
tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier);
|
|
|
|
|
|
|
|
PoolReadGuard rg(&temperatureSet);
|
|
|
|
|
|
|
|
temperatureSet.temperaturePowerAmplifier = tempPowerAmplifier;
|
|
|
|
|
|
|
|
if (debug) {
|
|
|
|
sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C"
|
|
|
|
sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C"
|
|
|
|
<< std::endl;
|
|
|
|
<< std::endl;
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
default: {
|
|
|
|
sif::debug << "SyrlinksHkHandler::interpretDeviceReply: Unknown device reply id" << std::endl;
|
|
|
|
sif::debug << "SyrlinksHkHandler::interpretDeviceReply: Unknown device reply id" << std::endl;
|
|
|
|
return DeviceHandlerIF::UNKNOWN_DEVICE_REPLY;
|
|
|
|
return DeviceHandlerIF::UNKNOWN_DEVICE_REPLY;
|
|
|
@ -397,8 +414,10 @@ LocalPoolDataSetBase* SyrlinksHkHandler::getDataSetHandle(sid_t sid) {
|
|
|
|
return &rxDataset;
|
|
|
|
return &rxDataset;
|
|
|
|
} else if (sid == txDataset.getSid()) {
|
|
|
|
} else if (sid == txDataset.getSid()) {
|
|
|
|
return &txDataset;
|
|
|
|
return &txDataset;
|
|
|
|
|
|
|
|
} else if (sid == temperatureSet.getSid()) {
|
|
|
|
|
|
|
|
return &temperatureSet;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
sif::error << "SyrlinksHkHandler::getDataSetHandle: Invalid sid" << std::endl;
|
|
|
|
sif::warning << "SyrlinksHkHandler::getDataSetHandle: Invalid sid" << std::endl;
|
|
|
|
return nullptr;
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -452,7 +471,7 @@ ReturnValue_t SyrlinksHkHandler::parseReplyStatus(const char* status) {
|
|
|
|
case '0':
|
|
|
|
case '0':
|
|
|
|
return RETURN_OK;
|
|
|
|
return RETURN_OK;
|
|
|
|
case '1':
|
|
|
|
case '1':
|
|
|
|
sif::debug << "SyrlinksHkHandler::parseReplyStatus: Uart faming or parity error" << std::endl;
|
|
|
|
sif::debug << "SyrlinksHkHandler::parseReplyStatus: Uart framing or parity error" << std::endl;
|
|
|
|
return UART_FRAMIN_OR_PARITY_ERROR_ACK;
|
|
|
|
return UART_FRAMIN_OR_PARITY_ERROR_ACK;
|
|
|
|
case '2':
|
|
|
|
case '2':
|
|
|
|
sif::debug << "SyrlinksHkHandler::parseReplyStatus: Bad character detected" << std::endl;
|
|
|
|
sif::debug << "SyrlinksHkHandler::parseReplyStatus: Bad character detected" << std::endl;
|
|
|
@ -482,11 +501,11 @@ ReturnValue_t SyrlinksHkHandler::verifyReply(const uint8_t* packet, uint8_t size
|
|
|
|
int result = 0;
|
|
|
|
int result = 0;
|
|
|
|
/* Calculate crc from received packet */
|
|
|
|
/* Calculate crc from received packet */
|
|
|
|
uint16_t crc =
|
|
|
|
uint16_t crc =
|
|
|
|
CRC::crc16ccitt(packet, size - SYRLINKS::SIZE_CRC_AND_TERMINATION, CRC_INITIAL_VALUE);
|
|
|
|
CRC::crc16ccitt(packet, size - syrlinks::SIZE_CRC_AND_TERMINATION, CRC_INITIAL_VALUE);
|
|
|
|
std::string recalculatedCrc = convertUint16ToHexString(crc);
|
|
|
|
std::string recalculatedCrc = convertUint16ToHexString(crc);
|
|
|
|
|
|
|
|
|
|
|
|
const char* startOfCrc =
|
|
|
|
const char* startOfCrc =
|
|
|
|
reinterpret_cast<const char*>(packet + size - SYRLINKS::SIZE_CRC_AND_TERMINATION);
|
|
|
|
reinterpret_cast<const char*>(packet + size - syrlinks::SIZE_CRC_AND_TERMINATION);
|
|
|
|
const char* endOfCrc = reinterpret_cast<const char*>(packet + size - 1);
|
|
|
|
const char* endOfCrc = reinterpret_cast<const char*>(packet + size - 1);
|
|
|
|
|
|
|
|
|
|
|
|
std::string replyCrc(startOfCrc, endOfCrc);
|
|
|
|
std::string replyCrc(startOfCrc, endOfCrc);
|
|
|
@ -500,7 +519,7 @@ ReturnValue_t SyrlinksHkHandler::verifyReply(const uint8_t* packet, uint8_t size
|
|
|
|
|
|
|
|
|
|
|
|
void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
|
|
|
|
void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
|
|
|
|
PoolReadGuard readHelper(&rxDataset);
|
|
|
|
PoolReadGuard readHelper(&rxDataset);
|
|
|
|
uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE;
|
|
|
|
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
|
|
|
|
rxDataset.rxStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
rxDataset.rxStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
offset += 2;
|
|
|
|
offset += 2;
|
|
|
|
rxDataset.rxSensitivity =
|
|
|
|
rxDataset.rxSensitivity =
|
|
|
@ -521,6 +540,7 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
|
|
|
|
rxDataset.rxDataRate = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
rxDataset.rxDataRate = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
|
|
|
|
|
|
|
|
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
|
|
|
|
if (debug) {
|
|
|
|
sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value
|
|
|
|
sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value
|
|
|
|
<< std::endl;
|
|
|
|
<< std::endl;
|
|
|
|
sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl;
|
|
|
|
sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl;
|
|
|
@ -530,49 +550,58 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
|
|
|
|
sif::info << "Syrlinks RX Demod Eb: " << rxDataset.rxDemodEb << std::endl;
|
|
|
|
sif::info << "Syrlinks RX Demod Eb: " << rxDataset.rxDemodEb << std::endl;
|
|
|
|
sif::info << "Syrlinks RX Demod N0: " << rxDataset.rxDemodN0 << std::endl;
|
|
|
|
sif::info << "Syrlinks RX Demod N0: " << rxDataset.rxDemodN0 << std::endl;
|
|
|
|
sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl;
|
|
|
|
sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl;
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SyrlinksHkHandler::parseLclConfigReply(const uint8_t* packet) {
|
|
|
|
void SyrlinksHkHandler::parseLclConfigReply(const uint8_t* packet) {
|
|
|
|
uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE;
|
|
|
|
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
|
|
|
|
uint8_t lclConfig = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
uint8_t lclConfig = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
|
|
|
|
if (debug) {
|
|
|
|
sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: "
|
|
|
|
sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: "
|
|
|
|
<< static_cast<unsigned int>(lclConfig) << std::endl;
|
|
|
|
<< static_cast<unsigned int>(lclConfig) << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) {
|
|
|
|
void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) {
|
|
|
|
PoolReadGuard readHelper(&txDataset);
|
|
|
|
PoolReadGuard readHelper(&txDataset);
|
|
|
|
uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE;
|
|
|
|
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
|
|
|
|
txDataset.txStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
txDataset.txStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
#if OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
|
|
|
|
if (debug) {
|
|
|
|
sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value
|
|
|
|
sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value
|
|
|
|
<< std::endl;
|
|
|
|
<< std::endl;
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) {
|
|
|
|
void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) {
|
|
|
|
PoolReadGuard readHelper(&txDataset);
|
|
|
|
PoolReadGuard readHelper(&txDataset);
|
|
|
|
uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE;
|
|
|
|
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
|
|
|
|
txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
#if OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
|
|
|
|
if (debug) {
|
|
|
|
sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value
|
|
|
|
sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value
|
|
|
|
<< std::endl;
|
|
|
|
<< std::endl;
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) {
|
|
|
|
void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) {
|
|
|
|
PoolReadGuard readHelper(&txDataset);
|
|
|
|
PoolReadGuard readHelper(&txDataset);
|
|
|
|
uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE;
|
|
|
|
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
|
|
|
|
txDataset.txAgcValue = agcValueHighByte << 8 |
|
|
|
|
txDataset.txAgcValue = agcValueHighByte << 8 |
|
|
|
|
convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
#if OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
|
|
|
|
if (debug) {
|
|
|
|
sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl;
|
|
|
|
sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl;
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SyrlinksHkHandler::parseAgcHighByte(const uint8_t* packet) {
|
|
|
|
void SyrlinksHkHandler::parseAgcHighByte(const uint8_t* packet) {
|
|
|
|
PoolReadGuard readHelper(&txDataset);
|
|
|
|
PoolReadGuard readHelper(&txDataset);
|
|
|
|
uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE;
|
|
|
|
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
|
|
|
|
agcValueHighByte = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
agcValueHighByte = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -582,18 +611,20 @@ uint32_t SyrlinksHkHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo)
|
|
|
|
|
|
|
|
|
|
|
|
ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
|
|
|
ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
|
|
|
LocalDataPoolManager& poolManager) {
|
|
|
|
LocalDataPoolManager& poolManager) {
|
|
|
|
localDataPoolMap.emplace(SYRLINKS::RX_STATUS, new PoolEntry<uint8_t>({0}));
|
|
|
|
localDataPoolMap.emplace(syrlinks::RX_STATUS, new PoolEntry<uint8_t>({0}));
|
|
|
|
localDataPoolMap.emplace(SYRLINKS::RX_SENSITIVITY, new PoolEntry<uint32_t>({0}));
|
|
|
|
localDataPoolMap.emplace(syrlinks::RX_SENSITIVITY, new PoolEntry<uint32_t>({0}));
|
|
|
|
localDataPoolMap.emplace(SYRLINKS::RX_FREQUENCY_SHIFT, new PoolEntry<uint32_t>({0}));
|
|
|
|
localDataPoolMap.emplace(syrlinks::RX_FREQUENCY_SHIFT, new PoolEntry<uint32_t>({0}));
|
|
|
|
localDataPoolMap.emplace(SYRLINKS::RX_IQ_POWER, new PoolEntry<uint16_t>({0}));
|
|
|
|
localDataPoolMap.emplace(syrlinks::RX_IQ_POWER, new PoolEntry<uint16_t>({0}));
|
|
|
|
localDataPoolMap.emplace(SYRLINKS::RX_AGC_VALUE, new PoolEntry<uint16_t>({0}));
|
|
|
|
localDataPoolMap.emplace(syrlinks::RX_AGC_VALUE, new PoolEntry<uint16_t>({0}));
|
|
|
|
localDataPoolMap.emplace(SYRLINKS::RX_DEMOD_EB, new PoolEntry<uint32_t>({0}));
|
|
|
|
localDataPoolMap.emplace(syrlinks::RX_DEMOD_EB, new PoolEntry<uint32_t>({0}));
|
|
|
|
localDataPoolMap.emplace(SYRLINKS::RX_DEMOD_N0, new PoolEntry<uint32_t>({0}));
|
|
|
|
localDataPoolMap.emplace(syrlinks::RX_DEMOD_N0, new PoolEntry<uint32_t>({0}));
|
|
|
|
localDataPoolMap.emplace(SYRLINKS::RX_DATA_RATE, new PoolEntry<uint8_t>({0}));
|
|
|
|
localDataPoolMap.emplace(syrlinks::RX_DATA_RATE, new PoolEntry<uint8_t>({0}));
|
|
|
|
|
|
|
|
|
|
|
|
localDataPoolMap.emplace(SYRLINKS::TX_STATUS, new PoolEntry<uint8_t>({0}));
|
|
|
|
localDataPoolMap.emplace(syrlinks::TX_STATUS, new PoolEntry<uint8_t>({0}));
|
|
|
|
localDataPoolMap.emplace(SYRLINKS::TX_WAVEFORM, new PoolEntry<uint8_t>({0}));
|
|
|
|
localDataPoolMap.emplace(syrlinks::TX_WAVEFORM, new PoolEntry<uint8_t>({0}));
|
|
|
|
localDataPoolMap.emplace(SYRLINKS::TX_AGC_VALUE, new PoolEntry<uint16_t>({0}));
|
|
|
|
localDataPoolMap.emplace(syrlinks::TX_AGC_VALUE, new PoolEntry<uint16_t>({0}));
|
|
|
|
|
|
|
|
localDataPoolMap.emplace(syrlinks::TEMP_BASEBAND_BOARD, new PoolEntry<uint16_t>({0}));
|
|
|
|
|
|
|
|
localDataPoolMap.emplace(syrlinks::TEMP_POWER_AMPLIFIER, new PoolEntry<uint16_t>({0}));
|
|
|
|
|
|
|
|
|
|
|
|
return HasReturnvaluesIF::RETURN_OK;
|
|
|
|
return HasReturnvaluesIF::RETURN_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -601,3 +632,21 @@ ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& lo
|
|
|
|
void SyrlinksHkHandler::setModeNormal() { mode = MODE_NORMAL; }
|
|
|
|
void SyrlinksHkHandler::setModeNormal() { mode = MODE_NORMAL; }
|
|
|
|
|
|
|
|
|
|
|
|
float SyrlinksHkHandler::calcTempVal(uint16_t raw) { return 0.126984 * raw - 67.87; }
|
|
|
|
float SyrlinksHkHandler::calcTempVal(uint16_t raw) { return 0.126984 * raw - 67.87; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReturnValue_t SyrlinksHkHandler::handleAckReply(const uint8_t* packet) {
|
|
|
|
|
|
|
|
ReturnValue_t result =
|
|
|
|
|
|
|
|
parseReplyStatus(reinterpret_cast<const char*>(packet + syrlinks::MESSAGE_HEADER_SIZE));
|
|
|
|
|
|
|
|
if (rememberCommandId == syrlinks::WRITE_LCL_CONFIG and result != RETURN_OK) {
|
|
|
|
|
|
|
|
startupState = StartupState::OFF;
|
|
|
|
|
|
|
|
} else if (rememberCommandId == syrlinks::WRITE_LCL_CONFIG and result == RETURN_OK) {
|
|
|
|
|
|
|
|
startupState = StartupState::DONE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SyrlinksHkHandler::prepareCommand(std::string command, DeviceCommandId_t commandId) {
|
|
|
|
|
|
|
|
command.copy(reinterpret_cast<char*>(commandBuffer), command.size(), 0);
|
|
|
|
|
|
|
|
rawPacketLen = command.size();
|
|
|
|
|
|
|
|
rememberCommandId = commandId;
|
|
|
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
|
|
|
}
|
|
|
|