checking other way to get all data at once
This commit is contained in:
@ -49,13 +49,11 @@ ReturnValue_t PayloadPcduHandler::buildNormalDeviceCommand(DeviceCommandId_t* id
|
||||
switch (adcState) {
|
||||
case (AdcStates::SEND_SETUP): {
|
||||
*id = plpcdu::SETUP_CMD;
|
||||
buildCommandFromCommand(*id, nullptr, 0);
|
||||
break;
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
case (AdcStates::NORMAL): {
|
||||
*id = plpcdu::READ_WITH_TEMP;
|
||||
buildCommandFromCommand(*id, nullptr, 0);
|
||||
break;
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
@ -67,7 +65,7 @@ ReturnValue_t PayloadPcduHandler::buildNormalDeviceCommand(DeviceCommandId_t* id
|
||||
ReturnValue_t PayloadPcduHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
||||
if (adcState == AdcStates::SEND_SETUP) {
|
||||
*id = plpcdu::SETUP_CMD;
|
||||
buildCommandFromCommand(*id, nullptr, 0);
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
return NOTHING_TO_SEND;
|
||||
}
|
||||
@ -105,9 +103,13 @@ ReturnValue_t PayloadPcduHandler::buildCommandFromCommand(DeviceCommandId_t devi
|
||||
max1227::prepareExternallyClockedTemperatureRead(cmdBuf.data() + sz, sz);
|
||||
rawPacketLen = sz;
|
||||
rawPacket = cmdBuf.data();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
||||
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t PayloadPcduHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
||||
@ -123,6 +125,9 @@ ReturnValue_t PayloadPcduHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||
using namespace plpcdu;
|
||||
switch (id) {
|
||||
case (SETUP_CMD): {
|
||||
if (mode == _MODE_TO_NORMAL) {
|
||||
adcCmdExecuted = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (READ_TEMP): {
|
||||
@ -184,14 +189,14 @@ void PayloadPcduHandler::handleExtConvRead(const uint8_t* bufStart) {
|
||||
void PayloadPcduHandler::handlePrintout() {
|
||||
if (periodicPrintout) {
|
||||
if (opDivider.checkAndIncrement()) {
|
||||
sif::info << "PL PCDU ADC hex [" << std::hex << std::setw(4);
|
||||
sif::info << "PL PCDU ADC hex [" << std::setfill('0') << std::hex;
|
||||
for (uint8_t idx = 0; idx < 12; idx++) {
|
||||
sif::info << std::setfill('0') << adcSet.channels[idx];
|
||||
sif::info << std::setw(3) << adcSet.channels[idx];
|
||||
if (idx < 11) {
|
||||
sif::info << ",";
|
||||
}
|
||||
}
|
||||
sif::info << "] | T[C] " << std::dec << adcSet.tempC.value;
|
||||
sif::info << "] | T[C] " << std::dec << adcSet.tempC.value << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user