mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Bindings: Python: Update pybind11
Updates to 3.0.1 and switches to smart_holder & native_enum.
This commit is contained in:
committed by
Kyle Schwarz
parent
7b5b94d980
commit
d328d314b6
@@ -1,6 +1,7 @@
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
#include <pybind11/functional.h>
|
||||
#include <pybind11/native_enum.h>
|
||||
|
||||
#include "icsneo/communication/network.h"
|
||||
|
||||
@@ -9,7 +10,7 @@ namespace icsneo {
|
||||
void init_network(pybind11::module_& m) {
|
||||
pybind11::class_<Network> network(m, "Network");
|
||||
|
||||
pybind11::enum_<Network::NetID>(network, "NetID")
|
||||
pybind11::native_enum<Network::NetID>(network, "NetID", "enum.IntEnum")
|
||||
.value("Device", Network::NetID::Device)
|
||||
.value("DWCAN_01", Network::NetID::DWCAN_01)
|
||||
.value("DWCAN_08", Network::NetID::DWCAN_08)
|
||||
@@ -166,9 +167,10 @@ void init_network(pybind11::module_& m) {
|
||||
.value("LIN_15", Network::NetID::LIN_15)
|
||||
.value("LIN_16", Network::NetID::LIN_16)
|
||||
.value("Any", Network::NetID::Any)
|
||||
.value("Invalid", Network::NetID::Invalid);
|
||||
.value("Invalid", Network::NetID::Invalid)
|
||||
.finalize();
|
||||
|
||||
pybind11::enum_<Network::Type>(network, "Type")
|
||||
pybind11::native_enum<Network::Type>(network, "Type", "enum.Enum")
|
||||
.value("Invalid", Network::Type::Invalid)
|
||||
.value("Internal", Network::Type::Internal)
|
||||
.value("CAN", Network::Type::CAN)
|
||||
@@ -185,7 +187,8 @@ void init_network(pybind11::module_& m) {
|
||||
.value("MDIO", Network::Type::MDIO)
|
||||
.value("AutomotiveEthernet", Network::Type::AutomotiveEthernet)
|
||||
.value("Any", Network::Type::Any)
|
||||
.value("Other", Network::Type::Other);
|
||||
.value("Other", Network::Type::Other)
|
||||
.finalize();
|
||||
|
||||
network
|
||||
.def(pybind11::init<Network::NetID>())
|
||||
|
||||
Reference in New Issue
Block a user