some syrlinks tweakd and fixes
This commit is contained in:
parent
1926e7f864
commit
0419561ff8
@ -33,7 +33,10 @@ void SyrlinksHkHandler::doStartUp() {
|
||||
}
|
||||
}
|
||||
|
||||
void SyrlinksHkHandler::doShutDown() { setMode(_MODE_POWER_DOWN); }
|
||||
void SyrlinksHkHandler::doShutDown() {
|
||||
setMode(_MODE_POWER_DOWN);
|
||||
temperatureSet.setValidity(false, true);
|
||||
}
|
||||
|
||||
ReturnValue_t SyrlinksHkHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
||||
switch (nextCommand) {
|
||||
@ -363,6 +366,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
||||
tempBasebandBoard = calcTempVal(rawTempBasebandBoard);
|
||||
PoolReadGuard rg(&temperatureSet);
|
||||
temperatureSet.temperatureBasebandBoard = tempBasebandBoard;
|
||||
temperatureSet.temperatureBasebandBoard.setValid(true);
|
||||
if (debugMode) {
|
||||
sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C"
|
||||
<< std::endl;
|
||||
@ -394,6 +398,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
||||
tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier);
|
||||
PoolReadGuard rg(&temperatureSet);
|
||||
temperatureSet.temperaturePowerAmplifier = tempPowerAmplifier;
|
||||
temperatureSet.temperaturePowerAmplifier.setValid(true);
|
||||
if (debugMode) {
|
||||
sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C"
|
||||
<< std::endl;
|
||||
@ -443,29 +448,6 @@ uint16_t SyrlinksHkHandler::convertHexStringToUint16(const char* fourChars) {
|
||||
return value;
|
||||
}
|
||||
|
||||
uint32_t SyrlinksHkHandler::convertHexStringToUint32(const char* characters,
|
||||
uint8_t numberOfChars) {
|
||||
uint32_t value = 0;
|
||||
|
||||
switch (numberOfChars) {
|
||||
case 6:
|
||||
value = convertHexStringToUint8(characters) << 16 |
|
||||
convertHexStringToUint8(characters + 2) << 8 |
|
||||
convertHexStringToUint8(characters + 4);
|
||||
return value;
|
||||
case 8:
|
||||
value = convertHexStringToUint8(characters) << 24 |
|
||||
convertHexStringToUint8(characters + 2) << 16 |
|
||||
convertHexStringToUint8(characters + 4) << 8 |
|
||||
convertHexStringToUint8(characters + 4);
|
||||
return value;
|
||||
default:
|
||||
sif::debug << "SyrlinksHkHandler::convertHexStringToUint32: Invalid number of characters. "
|
||||
<< "Must be either 6 or 8" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t SyrlinksHkHandler::parseReplyStatus(const char* status) {
|
||||
switch (*status) {
|
||||
case '0':
|
||||
@ -524,22 +506,23 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
|
||||
rxDataset.rxStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
||||
offset += 2;
|
||||
rxDataset.rxSensitivity =
|
||||
convertHexStringToUint32(reinterpret_cast<const char*>(packet + offset), 6);
|
||||
convertHexStringToRaw<uint32_t>(reinterpret_cast<const char*>(packet + offset), 6);
|
||||
offset += 6;
|
||||
rxDataset.rxFrequencyShift =
|
||||
convertHexStringToUint32(reinterpret_cast<const char*>(packet + offset), 6);
|
||||
convertHexStringToRaw<int32_t>(reinterpret_cast<const char*>(packet + offset), 6);
|
||||
offset += 6;
|
||||
rxDataset.rxIqPower = convertHexStringToUint16(reinterpret_cast<const char*>(packet + offset));
|
||||
offset += 4;
|
||||
rxDataset.rxAgcValue = convertHexStringToUint16(reinterpret_cast<const char*>(packet + offset));
|
||||
offset += 4;
|
||||
offset += 2; // reserved register
|
||||
rxDataset.rxDemodEb = convertHexStringToUint32(reinterpret_cast<const char*>(packet + offset), 6);
|
||||
rxDataset.rxDemodEb = convertHexStringToRaw<uint32_t>(reinterpret_cast<const char*>(packet + offset), 6);
|
||||
offset += 6;
|
||||
rxDataset.rxDemodN0 = convertHexStringToUint32(reinterpret_cast<const char*>(packet + offset), 6);
|
||||
rxDataset.rxDemodN0 = convertHexStringToRaw<uint32_t>(reinterpret_cast<const char*>(packet + offset), 6);
|
||||
offset += 6;
|
||||
rxDataset.rxDataRate = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
|
||||
|
||||
rxDataset.setValidity(true, true);
|
||||
if (debugMode) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value
|
||||
@ -568,6 +551,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));
|
||||
txDataset.txStatus.setValid(true);
|
||||
if (debugMode) {
|
||||
sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value
|
||||
<< std::endl;
|
||||
@ -578,6 +562,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));
|
||||
txDataset.txWaveform.setValid(true);
|
||||
if (debugMode) {
|
||||
sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value
|
||||
<< std::endl;
|
||||
@ -589,6 +574,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));
|
||||
txDataset.txAgcValue.setValid(true);
|
||||
if (debugMode) {
|
||||
sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl;
|
||||
}
|
||||
@ -608,7 +594,7 @@ ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& lo
|
||||
LocalDataPoolManager& poolManager) {
|
||||
localDataPoolMap.emplace(syrlinks::RX_STATUS, new PoolEntry<uint8_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<int32_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_DEMOD_EB, new PoolEntry<uint32_t>({0}));
|
||||
|
@ -154,8 +154,9 @@ class SyrlinksHkHandler : public DeviceHandlerBase {
|
||||
*
|
||||
* @return The uint32_t value.
|
||||
*/
|
||||
uint32_t convertHexStringToUint32(const char* characters, uint8_t numberOfChars);
|
||||
|
||||
// uint32_t convertHexStringToUint32(const char* characters, uint8_t numberOfChars);
|
||||
template <typename T>
|
||||
T convertHexStringToRaw(const char* characters, uint8_t numberOfChars);
|
||||
/**
|
||||
* @brief This function parses the status reply
|
||||
* @param status Pointer to the status information.
|
||||
@ -214,4 +215,27 @@ class SyrlinksHkHandler : public DeviceHandlerBase {
|
||||
void prepareCommand(std::string command, DeviceCommandId_t commandId);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
T SyrlinksHkHandler::convertHexStringToRaw(const char* characters,
|
||||
uint8_t numberOfChars) {
|
||||
T value = 0;
|
||||
|
||||
switch (numberOfChars) {
|
||||
case 6:
|
||||
value = ((convertHexStringToUint8(characters) << 24) |
|
||||
(convertHexStringToUint8(characters + 2) << 16) |
|
||||
(convertHexStringToUint8(characters + 4) << 8)) >> 8;
|
||||
return value;
|
||||
case 8:
|
||||
value = convertHexStringToUint8(characters) << 24 |
|
||||
convertHexStringToUint8(characters + 2) << 16 |
|
||||
convertHexStringToUint8(characters + 4) << 8 |
|
||||
convertHexStringToUint8(characters + 4);
|
||||
return value;
|
||||
default:
|
||||
sif::debug << "SyrlinksHkHandler::convertHexStringToUint32: Invalid number of characters. "
|
||||
<< "Must be either 6 or 8" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif /* MISSION_DEVICES_SYRLINKSHKHANDLER_H_ */
|
||||
|
@ -86,7 +86,7 @@ class RxDataset : public StaticLocalDataSet<RX_DATASET_SIZE> {
|
||||
|
||||
lp_var_t<uint8_t> rxStatus = lp_var_t<uint8_t>(sid.objectId, RX_STATUS, this);
|
||||
lp_var_t<uint32_t> rxSensitivity = lp_var_t<uint32_t>(sid.objectId, RX_SENSITIVITY, this);
|
||||
lp_var_t<uint32_t> rxFrequencyShift = lp_var_t<uint32_t>(sid.objectId, RX_FREQUENCY_SHIFT, this);
|
||||
lp_var_t<int32_t> rxFrequencyShift = lp_var_t<int32_t>(sid.objectId, RX_FREQUENCY_SHIFT, this);
|
||||
lp_var_t<uint16_t> rxIqPower = lp_var_t<uint16_t>(sid.objectId, RX_IQ_POWER, this);
|
||||
lp_var_t<uint16_t> rxAgcValue = lp_var_t<uint16_t>(sid.objectId, RX_AGC_VALUE, this);
|
||||
lp_var_t<uint32_t> rxDemodEb = lp_var_t<uint32_t>(sid.objectId, RX_DEMOD_EB, this);
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit 033c8927c0d817e3e562d1d199d217f4bdf45ce7
|
||||
Subproject commit d23201466c279c410fd421b1584c46a439827ad5
|
Loading…
Reference in New Issue
Block a user