mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Communication: Add EthernetStatusMessage
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#ifndef __ETHERNETSTATUSMESSAGE_H__
|
||||
#define __ETHERNETSTATUSMESSAGE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/communication/message/message.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class EthernetStatusMessage : public Message {
|
||||
public:
|
||||
enum class LinkSpeed {
|
||||
LinkSpeedAuto,
|
||||
LinkSpeed10,
|
||||
LinkSpeed100,
|
||||
LinkSpeed1000,
|
||||
LinkSpeed2500,
|
||||
LinkSpeed5000,
|
||||
LinkSpeed10000,
|
||||
};
|
||||
enum class LinkMode {
|
||||
LinkModeAuto,
|
||||
LinkModeMaster,
|
||||
LinkModeSlave,
|
||||
LinkModeInvalid,
|
||||
};
|
||||
EthernetStatusMessage(Network net, bool state, LinkSpeed speed, bool duplex, LinkMode mode) : Message(Type::EthernetStatus),
|
||||
network(net), state(state), speed(speed), duplex(duplex), mode(mode) {}
|
||||
Network network;
|
||||
bool state;
|
||||
LinkSpeed speed;
|
||||
bool duplex;
|
||||
LinkMode mode;
|
||||
static std::shared_ptr<Message> DecodeToMessage(const std::vector<uint8_t>& bytestream);
|
||||
};
|
||||
|
||||
}; // namespace icsneo
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // __ETHERNETSTATUSMESSAGE_H__
|
||||
@@ -41,7 +41,8 @@ public:
|
||||
HardwareInfo = 0x8010,
|
||||
TC10Status = 0x8011,
|
||||
AppError = 0x8012,
|
||||
GPTPStatus = 0x8013
|
||||
GPTPStatus = 0x8013,
|
||||
EthernetStatus = 0x8014,
|
||||
};
|
||||
|
||||
Message(Type t) : type(t) {}
|
||||
|
||||
Reference in New Issue
Block a user