|
|
|
@ -19,19 +19,18 @@ SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, Co
|
|
|
|
|
SyrlinksHkHandler::~SyrlinksHkHandler() {}
|
|
|
|
|
|
|
|
|
|
void SyrlinksHkHandler::doStartUp() {
|
|
|
|
|
// switch (startupState) {
|
|
|
|
|
// case StartupState::OFF: {
|
|
|
|
|
// startupState = StartupState::ENABLE_TEMPERATURE_PROTECTION;
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// case StartupState::DONE: {
|
|
|
|
|
// setMode(_MODE_TO_ON);
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// default:
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
setMode(_MODE_TO_ON);
|
|
|
|
|
switch (startupState) {
|
|
|
|
|
case StartupState::OFF: {
|
|
|
|
|
startupState = StartupState::ENABLE_TEMPERATURE_PROTECTION;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case StartupState::DONE: {
|
|
|
|
|
setMode(_MODE_TO_ON);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SyrlinksHkHandler::doShutDown() { setMode(_MODE_POWER_DOWN); }
|
|
|
|
@ -99,130 +98,81 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic
|
|
|
|
|
size_t commandDataLen) {
|
|
|
|
|
switch (deviceCommand) {
|
|
|
|
|
case (syrlinks::RESET_UNIT): {
|
|
|
|
|
resetCommand.copy(reinterpret_cast<char*>(commandBuffer), resetCommand.size(), 0);
|
|
|
|
|
rawPacketLen = resetCommand.size();
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
prepareCommand(resetCommand, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::SET_TX_MODE_STANDBY): {
|
|
|
|
|
setTxModeStandby.copy(reinterpret_cast<char*>(commandBuffer), setTxModeStandby.size(), 0);
|
|
|
|
|
rawPacketLen = setTxModeStandby.size();
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
prepareCommand(setTxModeStandby, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::SET_TX_MODE_MODULATION): {
|
|
|
|
|
setTxModeModulation.copy(reinterpret_cast<char*>(commandBuffer), setTxModeModulation.size(),
|
|
|
|
|
0);
|
|
|
|
|
rawPacketLen = setTxModeModulation.size();
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
prepareCommand(setTxModeModulation, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::SET_TX_MODE_CW): {
|
|
|
|
|
setTxModeCw.copy(reinterpret_cast<char*>(commandBuffer), setTxModeCw.size(), 0);
|
|
|
|
|
rawPacketLen = setTxModeCw.size();
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
prepareCommand(setTxModeCw, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::WRITE_LCL_CONFIG): {
|
|
|
|
|
writeLclConfig.copy(reinterpret_cast<char*>(commandBuffer), writeLclConfig.size(), 0);
|
|
|
|
|
rawPacketLen = writeLclConfig.size();
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
rememberCommandId = syrlinks::WRITE_LCL_CONFIG;
|
|
|
|
|
prepareCommand(writeLclConfig, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::READ_RX_STATUS_REGISTERS): {
|
|
|
|
|
readRxStatusRegCommand.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
|
readRxStatusRegCommand.size(), 0);
|
|
|
|
|
rawPacketLen = readRxStatusRegCommand.size();
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
prepareCommand(readRxStatusRegCommand, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::READ_LCL_CONFIG): {
|
|
|
|
|
readLclConfig.copy(reinterpret_cast<char*>(commandBuffer), readLclConfig.size(), 0);
|
|
|
|
|
rawPacketLen = readLclConfig.size();
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
rememberCommandId = syrlinks::READ_LCL_CONFIG;
|
|
|
|
|
prepareCommand(readLclConfig, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::READ_TX_STATUS): {
|
|
|
|
|
readTxStatus.copy(reinterpret_cast<char*>(commandBuffer), readTxStatus.size(), 0);
|
|
|
|
|
rawPacketLen = readTxStatus.size();
|
|
|
|
|
rememberCommandId = syrlinks::READ_TX_STATUS;
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
prepareCommand(readTxStatus, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::READ_TX_WAVEFORM): {
|
|
|
|
|
readTxWaveform.copy(reinterpret_cast<char*>(commandBuffer), readTxWaveform.size(), 0);
|
|
|
|
|
rawPacketLen = readTxWaveform.size();
|
|
|
|
|
rememberCommandId = syrlinks::READ_TX_WAVEFORM;
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
prepareCommand(readTxWaveform, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE): {
|
|
|
|
|
readTxAgcValueHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
|
readTxAgcValueHighByte.size(), 0);
|
|
|
|
|
rawPacketLen = readTxAgcValueHighByte.size();
|
|
|
|
|
rememberCommandId = syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE;
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
prepareCommand(readTxAgcValueHighByte, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::READ_TX_AGC_VALUE_LOW_BYTE): {
|
|
|
|
|
readTxAgcValueLowByte.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
|
readTxAgcValueLowByte.size(), 0);
|
|
|
|
|
rawPacketLen = readTxAgcValueLowByte.size();
|
|
|
|
|
rememberCommandId = syrlinks::READ_TX_AGC_VALUE_LOW_BYTE;
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
prepareCommand(readTxAgcValueLowByte, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE):
|
|
|
|
|
tempPowerAmpBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
|
tempPowerAmpBoardHighByte.size(), 0);
|
|
|
|
|
rawPacketLen = tempPowerAmpBoardHighByte.size();
|
|
|
|
|
rememberCommandId = syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE): {
|
|
|
|
|
prepareCommand(tempPowerAmpBoardHighByte, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
case (syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE):
|
|
|
|
|
tempPowerAmpBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
|
tempPowerAmpBoardLowByte.size(), 0);
|
|
|
|
|
rawPacketLen = tempPowerAmpBoardLowByte.size();
|
|
|
|
|
rememberCommandId = syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE;
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE): {
|
|
|
|
|
prepareCommand(tempPowerAmpBoardLowByte, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
case (syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE):
|
|
|
|
|
tempBasebandBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
|
tempBasebandBoardHighByte.size(), 0);
|
|
|
|
|
rawPacketLen = tempBasebandBoardHighByte.size();
|
|
|
|
|
rememberCommandId = syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE;
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE): {
|
|
|
|
|
prepareCommand(tempBasebandBoardHighByte, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
case (syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE):
|
|
|
|
|
tempBasebandBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
|
tempBasebandBoardLowByte.size(), 0);
|
|
|
|
|
rawPacketLen = tempBasebandBoardLowByte.size();
|
|
|
|
|
rememberCommandId = syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE;
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE): {
|
|
|
|
|
prepareCommand(tempBasebandBoardLowByte, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
case (syrlinks::SET_WAVEFORM_OQPSK):
|
|
|
|
|
setWaveformOQPSK.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
|
setWaveformOQPSK.size(), 0);
|
|
|
|
|
rawPacketLen = setWaveformOQPSK.size();
|
|
|
|
|
rememberCommandId = syrlinks::SET_WAVEFORM_OQPSK;
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::CONFIG_BPSK): {
|
|
|
|
|
prepareCommand(configBPSK, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
case (syrlinks::SET_WAVEFORM_BPSK):
|
|
|
|
|
setWaveformBPSK.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
|
setWaveformBPSK.size(), 0);
|
|
|
|
|
rawPacketLen = setWaveformBPSK.size();
|
|
|
|
|
rememberCommandId = syrlinks::SET_WAVEFORM_BPSK;
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::CONFIG_OQPSK): {
|
|
|
|
|
prepareCommand(configOQPSK, deviceCommand);
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
case (syrlinks::SET_SECOND_CONFIG):
|
|
|
|
|
setSecondConfiguration.copy(reinterpret_cast<char*>(commandBuffer),
|
|
|
|
|
setSecondConfiguration.size(), 0);
|
|
|
|
|
rawPacketLen = setSecondConfiguration.size();
|
|
|
|
|
rememberCommandId = syrlinks::SET_SECOND_CONFIG;
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::ENABLE_DEBUG): {
|
|
|
|
|
debug = true;
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
case (syrlinks::DISABLE_DEBUG): {
|
|
|
|
|
debug = false;
|
|
|
|
|
return RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
|
|
|
|
|
}
|
|
|
|
@ -240,12 +190,12 @@ void SyrlinksHkHandler::fillCommandAndReplyMap() {
|
|
|
|
|
true, syrlinks::ACK_REPLY);
|
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::WRITE_LCL_CONFIG, 1, nullptr, syrlinks::ACK_SIZE,
|
|
|
|
|
false, true, syrlinks::ACK_REPLY);
|
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::SET_WAVEFORM_OQPSK, 1, nullptr, syrlinks::ACK_SIZE,
|
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::CONFIG_BPSK, 1, nullptr, syrlinks::ACK_SIZE,
|
|
|
|
|
false, true, syrlinks::ACK_REPLY);
|
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::SET_WAVEFORM_BPSK, 1, nullptr, syrlinks::ACK_SIZE,
|
|
|
|
|
false, true, syrlinks::ACK_REPLY);
|
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::SET_SECOND_CONFIG, 1, nullptr, syrlinks::ACK_SIZE,
|
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::CONFIG_OQPSK, 1, nullptr, syrlinks::ACK_SIZE,
|
|
|
|
|
false, true, syrlinks::ACK_REPLY);
|
|
|
|
|
this->insertInCommandMap(syrlinks::ENABLE_DEBUG);
|
|
|
|
|
this->insertInCommandMap(syrlinks::DISABLE_DEBUG);
|
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::READ_LCL_CONFIG, 1, nullptr,
|
|
|
|
|
syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
|
this->insertInCommandAndReplyMap(syrlinks::READ_TX_STATUS, 1, &txDataset,
|
|
|
|
@ -316,8 +266,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
|
result = verifyReply(packet, syrlinks::ACK_SIZE);
|
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Acknowledgment reply has "
|
|
|
|
|
"invalid crc"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
"invalid crc"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
return CRC_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
result = handleAckReply(packet);
|
|
|
|
@ -330,7 +280,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
|
result = verifyReply(packet, syrlinks::RX_STATUS_REGISTERS_REPLY_SIZE);
|
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read rx status registers reply "
|
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
|
return CRC_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
parseRxStatusRegistersReply(packet);
|
|
|
|
@ -340,7 +290,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read config lcl reply "
|
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
|
return CRC_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
parseLclConfigReply(packet);
|
|
|
|
@ -350,7 +300,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx status reply "
|
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
|
return CRC_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
parseTxStatusReply(packet);
|
|
|
|
@ -360,7 +310,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx waveform reply "
|
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
|
return CRC_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
parseTxWaveformReply(packet);
|
|
|
|
@ -370,7 +320,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx AGC high byte reply "
|
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
|
return CRC_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
parseAgcHighByte(packet);
|
|
|
|
@ -380,7 +330,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx AGC low byte reply "
|
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
|
<< "has invalid crc" << std::endl;
|
|
|
|
|
return CRC_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
parseAgcLowByte(packet);
|
|
|
|
@ -390,7 +340,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
rawTempBasebandBoard = convertHexStringToUint8(reinterpret_cast<const char*>(
|
|
|
|
@ -402,8 +352,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
|
sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read temperature baseband board"
|
|
|
|
|
" low byte reply has invalid crc"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
" low byte reply has invalid crc"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
return CRC_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
rawTempBasebandBoard |= convertHexStringToUint8(
|
|
|
|
@ -412,8 +362,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
|
temperatureSet.temperatureBasebandBoard = tempBasebandBoard;
|
|
|
|
|
PoolReadGuard rg(&temperatureSet);
|
|
|
|
|
if (debug) {
|
|
|
|
|
sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -421,7 +371,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
rawTempPowerAmplifier = 0;
|
|
|
|
@ -434,7 +384,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
|
result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE);
|
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
rawTempPowerAmplifier |= convertHexStringToUint8(
|
|
|
|
@ -443,8 +393,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|
|
|
|
PoolReadGuard rg(&temperatureSet);
|
|
|
|
|
temperatureSet.temperaturePowerAmplifier = tempPowerAmplifier;
|
|
|
|
|
if (debug) {
|
|
|
|
|
sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier
|
|
|
|
|
<< " °C" << std::endl;
|
|
|
|
|
sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C"
|
|
|
|
|
<< std::endl;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -470,10 +420,6 @@ LocalPoolDataSetBase* SyrlinksHkHandler::getDataSetHandle(sid_t sid) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SyrlinksHkHandler::performOperationHook() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string SyrlinksHkHandler::convertUint16ToHexString(uint16_t intValue) {
|
|
|
|
|
std::stringstream stream;
|
|
|
|
|
stream << std::setfill('0') << std::setw(4) << std::hex << std::uppercase << intValue;
|
|
|
|
@ -592,15 +538,17 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
|
|
|
|
|
rxDataset.rxDataRate = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
|
|
|
|
|
|
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
|
sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value
|
|
|
|
|
<< std::endl;
|
|
|
|
|
sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl;
|
|
|
|
|
sif::info << "Syrlinks RX Frequency Shift: " << rxDataset.rxFrequencyShift << std::endl;
|
|
|
|
|
sif::info << "Syrlinks RX IQ Power: " << rxDataset.rxIqPower << std::endl;
|
|
|
|
|
sif::info << "Syrlinks RX AGC Value: " << rxDataset.rxAgcValue << 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 Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl;
|
|
|
|
|
if (debug) {
|
|
|
|
|
sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value
|
|
|
|
|
<< std::endl;
|
|
|
|
|
sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl;
|
|
|
|
|
sif::info << "Syrlinks RX Frequency Shift: " << rxDataset.rxFrequencyShift << std::endl;
|
|
|
|
|
sif::info << "Syrlinks RX IQ Power: " << rxDataset.rxIqPower << std::endl;
|
|
|
|
|
sif::info << "Syrlinks RX AGC Value: " << rxDataset.rxAgcValue << 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 Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -615,7 +563,7 @@ void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) {
|
|
|
|
|
PoolReadGuard readHelper(&txDataset);
|
|
|
|
|
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
|
|
|
|
|
txDataset.txStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
|
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
|
#if OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
|
sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value
|
|
|
|
|
<< std::endl;
|
|
|
|
|
#endif
|
|
|
|
@ -625,7 +573,7 @@ void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) {
|
|
|
|
|
PoolReadGuard readHelper(&txDataset);
|
|
|
|
|
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
|
|
|
|
|
txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
|
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
|
#if OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
|
sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value
|
|
|
|
|
<< std::endl;
|
|
|
|
|
#endif
|
|
|
|
@ -636,7 +584,7 @@ void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) {
|
|
|
|
|
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
|
|
|
|
|
txDataset.txAgcValue = agcValueHighByte << 8 |
|
|
|
|
|
convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
|
|
|
|
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
|
#if OBSW_DEBUG_SYRLINKS == 1
|
|
|
|
|
sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
@ -685,3 +633,10 @@ ReturnValue_t SyrlinksHkHandler::handleAckReply(const uint8_t* packet) {
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SyrlinksHkHandler::prepareCommand(std::string command, DeviceCommandId_t commandId) {
|
|
|
|
|
command.copy(reinterpret_cast<char*>(commandBuffer), readTxWaveform.size(), 0);
|
|
|
|
|
rawPacketLen = command.size();
|
|
|
|
|
rememberCommandId = commandId;
|
|
|
|
|
rawPacket = commandBuffer;
|
|
|
|
|
}
|
|
|
|
|