mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Bindings: Python: Add MDIOMessage
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
#include <pybind11/functional.h>
|
||||
|
||||
#include "icsneo/communication/message/mdiomessage.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
void init_mdiomessage(pybind11::module_& m) {
|
||||
pybind11::class_<MDIOMessage, std::shared_ptr<MDIOMessage>, Frame> mdioMessage(m, "MDIOMessage");
|
||||
pybind11::enum_<MDIOMessage::Clause>(mdioMessage, "Clause")
|
||||
.value("Clause45", MDIOMessage::Clause::Clause45)
|
||||
.value("Clause22", MDIOMessage::Clause::Clause22);
|
||||
pybind11::enum_<MDIOMessage::Direction>(mdioMessage, "Direction")
|
||||
.value("Write", MDIOMessage::Direction::Write)
|
||||
.value("Read", MDIOMessage::Direction::Read);
|
||||
mdioMessage
|
||||
.def(pybind11::init())
|
||||
.def_readwrite("isTXMsg", &MDIOMessage::isTXMsg)
|
||||
.def_readwrite("txTimeout", &MDIOMessage::txTimeout)
|
||||
.def_readwrite("txAborted", &MDIOMessage::txAborted)
|
||||
.def_readwrite("txInvalidBus", &MDIOMessage::txInvalidBus)
|
||||
.def_readwrite("txInvalidPhyAddr", &MDIOMessage::txInvalidPhyAddr)
|
||||
.def_readwrite("txInvalidRegAddr", &MDIOMessage::txInvalidRegAddr)
|
||||
.def_readwrite("txInvalidClause", &MDIOMessage::txInvalidClause)
|
||||
.def_readwrite("txInvalidOpcode", &MDIOMessage::txInvalidOpcode)
|
||||
.def_readwrite("phyAddress", &MDIOMessage::phyAddress)
|
||||
.def_readwrite("devAddress", &MDIOMessage::devAddress)
|
||||
.def_readwrite("regAddress", &MDIOMessage::regAddress)
|
||||
.def_readwrite("direction", &MDIOMessage::direction)
|
||||
.def_readwrite("clause", &MDIOMessage::clause);
|
||||
}
|
||||
|
||||
} // namespace icsneo
|
||||
|
||||
@@ -15,6 +15,7 @@ void init_message(pybind11::module_&);
|
||||
void init_canmessage(pybind11::module_&);
|
||||
void init_ethernetmessage(pybind11::module_&);
|
||||
void init_tc10statusmessage(pybind11::module_&);
|
||||
void init_mdiomessage(pybind11::module_&);
|
||||
void init_device(pybind11::module_&);
|
||||
void init_messagefilter(pybind11::module_&);
|
||||
void init_messagecallback(pybind11::module_&);
|
||||
@@ -33,6 +34,7 @@ PYBIND11_MODULE(icsneopy, m) {
|
||||
init_canmessage(m);
|
||||
init_ethernetmessage(m);
|
||||
init_tc10statusmessage(m);
|
||||
init_mdiomessage(m);
|
||||
init_messagefilter(m);
|
||||
init_messagecallback(m);
|
||||
init_device(m);
|
||||
|
||||
Reference in New Issue
Block a user