mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-09-25 18:29:45 +02:00
Message: Validate PHY register batches
This commit is contained in:
committed by
Kyle Schwarz
parent
f0b1341cdf
commit
f310938684
+6
-1
@@ -2053,7 +2053,12 @@ std::optional<EthPhyMessage> Device::sendEthPhyMsg(const EthPhyMessage& message,
|
||||
}
|
||||
|
||||
std::vector<uint8_t> bytes;
|
||||
HardwareEthernetPhyRegisterPacket::EncodeFromMessage(message, bytes, report);
|
||||
if(timeout.count() <= 0) {
|
||||
report(APIEvent::Type::ParameterOutOfRange, APIEvent::Severity::Error);
|
||||
return std::nullopt;
|
||||
}
|
||||
if(!HardwareEthernetPhyRegisterPacket::EncodeFromMessage(message, bytes, report))
|
||||
return std::nullopt;
|
||||
std::shared_ptr<Message> response = com->waitForMessageSync(
|
||||
[this, bytes](){ return com->sendCommand(Command::PHYControlRegisters, bytes); },
|
||||
std::make_shared<MessageFilter>(Message::Type::EthernetPhyRegister), timeout);
|
||||
|
||||
Reference in New Issue
Block a user