PL PCDU Update Mode Handling #200
@ -192,10 +192,10 @@ void SyrlinksHkHandler::fillCommandAndReplyMap() {
|
|||||||
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::CONFIG_BPSK, 1, nullptr, syrlinks::ACK_SIZE,
|
this->insertInCommandAndReplyMap(syrlinks::CONFIG_BPSK, 1, nullptr, syrlinks::ACK_SIZE, false,
|
||||||
false, true, syrlinks::ACK_REPLY);
|
true, syrlinks::ACK_REPLY);
|
||||||
this->insertInCommandAndReplyMap(syrlinks::CONFIG_OQPSK, 1, nullptr, syrlinks::ACK_SIZE,
|
this->insertInCommandAndReplyMap(syrlinks::CONFIG_OQPSK, 1, nullptr, syrlinks::ACK_SIZE, false,
|
||||||
false, true, syrlinks::ACK_REPLY);
|
true, syrlinks::ACK_REPLY);
|
||||||
this->insertInCommandMap(syrlinks::ENABLE_DEBUG);
|
this->insertInCommandMap(syrlinks::ENABLE_DEBUG);
|
||||||
this->insertInCommandMap(syrlinks::DISABLE_DEBUG);
|
this->insertInCommandMap(syrlinks::DISABLE_DEBUG);
|
||||||
this->insertInCommandAndReplyMap(syrlinks::READ_LCL_CONFIG, 1, nullptr,
|
this->insertInCommandAndReplyMap(syrlinks::READ_LCL_CONFIG, 1, nullptr,
|
||||||
@ -361,17 +361,12 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|||||||
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);
|
||||||
<<<<<<< HEAD
|
|
||||||
sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C"
|
|
||||||
<< std::endl;
|
|
||||||
=======
|
|
||||||
temperatureSet.temperatureBasebandBoard = tempBasebandBoard;
|
temperatureSet.temperatureBasebandBoard = tempBasebandBoard;
|
||||||
PoolReadGuard rg(&temperatureSet);
|
PoolReadGuard rg(&temperatureSet);
|
||||||
if (debug) {
|
if (debug) {
|
||||||
sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C"
|
sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
>>>>>>> origin/develop
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE): {
|
case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE): {
|
||||||
@ -383,11 +378,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|||||||
}
|
}
|
||||||
rawTempPowerAmplifier = 0;
|
rawTempPowerAmplifier = 0;
|
||||||
rawTempPowerAmplifier = convertHexStringToUint8(reinterpret_cast<const char*>(
|
rawTempPowerAmplifier = convertHexStringToUint8(reinterpret_cast<const char*>(
|
||||||
<<<<<<< HEAD
|
|
||||||
packet + SYRLINKS::MESSAGE_HEADER_SIZE))
|
|
||||||
=======
|
|
||||||
packet + syrlinks::MESSAGE_HEADER_SIZE))
|
packet + syrlinks::MESSAGE_HEADER_SIZE))
|
||||||
>>>>>>> origin/develop
|
|
||||||
<< 8;
|
<< 8;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -401,17 +392,12 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
|||||||
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);
|
||||||
<<<<<<< HEAD
|
|
||||||
sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C"
|
|
||||||
<< std::endl;
|
|
||||||
=======
|
|
||||||
PoolReadGuard rg(&temperatureSet);
|
PoolReadGuard rg(&temperatureSet);
|
||||||
temperatureSet.temperaturePowerAmplifier = tempPowerAmplifier;
|
temperatureSet.temperaturePowerAmplifier = tempPowerAmplifier;
|
||||||
if (debug) {
|
if (debug) {
|
||||||
sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C"
|
sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
>>>>>>> origin/develop
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@ -485,7 +471,8 @@ 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 framing 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;
|
||||||
@ -555,15 +542,15 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
|
|||||||
|
|
||||||
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1
|
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1
|
||||||
if (debug) {
|
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;
|
||||||
sif::info << "Syrlinks RX Frequency Shift: " << rxDataset.rxFrequencyShift << 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 IQ Power: " << rxDataset.rxIqPower << std::endl;
|
||||||
sif::info << "Syrlinks RX AGC Value: " << rxDataset.rxAgcValue << 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 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
|
||||||
}
|
}
|
||||||
@ -572,8 +559,8 @@ 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) {
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -583,8 +570,8 @@ void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) {
|
|||||||
txDataset.txStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
txDataset.txStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
||||||
#if OBSW_DEBUG_SYRLINKS == 1
|
#if OBSW_DEBUG_SYRLINKS == 1
|
||||||
if (debug) {
|
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
|
||||||
}
|
}
|
||||||
@ -595,8 +582,8 @@ void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) {
|
|||||||
txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
||||||
#if OBSW_DEBUG_SYRLINKS == 1
|
#if OBSW_DEBUG_SYRLINKS == 1
|
||||||
if (debug) {
|
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
|
||||||
}
|
}
|
||||||
@ -608,7 +595,7 @@ void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) {
|
|||||||
convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
||||||
#if OBSW_DEBUG_SYRLINKS == 1
|
#if OBSW_DEBUG_SYRLINKS == 1
|
||||||
if (debug) {
|
if (debug) {
|
||||||
sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl;
|
sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,9 @@
|
|||||||
|
|
||||||
#include "devices/powerSwitcherList.h"
|
#include "devices/powerSwitcherList.h"
|
||||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||||
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
|
||||||
#include "fsfw_hal/linux/gpio/Gpio.h"
|
|
||||||
#include "fsfw/timemanager/Countdown.h"
|
#include "fsfw/timemanager/Countdown.h"
|
||||||
#include <string.h>
|
#include "fsfw_hal/linux/gpio/Gpio.h"
|
||||||
|
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This is the device handler for the syrlinks transceiver. It handles the command
|
* @brief This is the device handler for the syrlinks transceiver. It handles the command
|
||||||
@ -104,11 +103,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase {
|
|||||||
|
|
||||||
uint8_t commandBuffer[syrlinks::MAX_COMMAND_SIZE];
|
uint8_t commandBuffer[syrlinks::MAX_COMMAND_SIZE];
|
||||||
|
|
||||||
enum class StartupState {
|
enum class StartupState { OFF, ENABLE_TEMPERATURE_PROTECTION, DONE };
|
||||||
OFF,
|
|
||||||
ENABLE_TEMPERATURE_PROTECTION,
|
|
||||||
DONE
|
|
||||||
};
|
|
||||||
|
|
||||||
StartupState startupState = StartupState::OFF;
|
StartupState startupState = StartupState::OFF;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user