Skip to content

Commit

Permalink
Merge pull request #890 from luxonis/getConnectivity_bindings
Browse files Browse the repository at this point in the history
Get connectivity bindings
  • Loading branch information
asahtik authored Nov 20, 2023
2 parents b591040 + d32e049 commit 9c50aa6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/DeviceBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ void DeviceBindings::bind(pybind11::module& m, void* pCallstack){
.def("getCrashDump", [](DeviceBase& d, bool clearCrashDump) { py::gil_scoped_release release; return d.getCrashDump(clearCrashDump); }, py::arg("clearCrashDump") = true, DOC(dai, DeviceBase, getCrashDump))
.def("hasCrashDump", [](DeviceBase& d) { py::gil_scoped_release release; return d.hasCrashDump(); }, DOC(dai, DeviceBase, hasCrashDump))
.def("getConnectedCameras", [](DeviceBase& d) { py::gil_scoped_release release; return d.getConnectedCameras(); }, DOC(dai, DeviceBase, getConnectedCameras))
.def("getConnectionInterfaces", [](DeviceBase& d) { py::gil_scoped_release release; return d.getConnectionInterfaces(); }, DOC(dai, DeviceBase, getConnectionInterfaces))
.def("getConnectedCameraFeatures", [](DeviceBase& d) { py::gil_scoped_release release; return d.getConnectedCameraFeatures(); }, DOC(dai, DeviceBase, getConnectedCameraFeatures))
.def("getCameraSensorNames", [](DeviceBase& d) { py::gil_scoped_release release; return d.getCameraSensorNames(); }, DOC(dai, DeviceBase, getCameraSensorNames))
.def("getConnectedIMU", [](DeviceBase& d) { py::gil_scoped_release release; return d.getConnectedIMU(); }, DOC(dai, DeviceBase, getConnectedIMU))
Expand Down
9 changes: 8 additions & 1 deletion src/pipeline/CommonBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

// depthai-shared
#include "depthai-shared/common/CameraBoardSocket.hpp"
#include "depthai-shared/common/Connectivity.hpp"
#include "depthai-shared/common/EepromData.hpp"
#include "depthai-shared/common/CameraImageOrientation.hpp"
#include "depthai-shared/common/CameraSensorType.hpp"
Expand Down Expand Up @@ -40,6 +41,7 @@ void CommonBindings::bind(pybind11::module& m, void* pCallstack){
py::class_<Point3f> point3f(m, "Point3f", DOC(dai, Point3f));
py::class_<Size2f> size2f(m, "Size2f", DOC(dai, Size2f));
py::enum_<CameraBoardSocket> cameraBoardSocket(m, "CameraBoardSocket", DOC(dai, CameraBoardSocket));
py::enum_<Connectivity> connectivity(m, "Connectivity", DOC(dai, Connectivity));
py::enum_<CameraSensorType> cameraSensorType(m, "CameraSensorType", DOC(dai, CameraSensorType));
py::enum_<CameraImageOrientation> cameraImageOrientation(m, "CameraImageOrientation", DOC(dai, CameraImageOrientation));
py::class_<CameraSensorConfig> cameraSensorConfig(m, "CameraSensorConfig", DOC(dai, CameraSensorConfig));
Expand Down Expand Up @@ -183,7 +185,12 @@ void CommonBindings::bind(pybind11::module& m, void* pCallstack){
.value("TOF", CameraSensorType::TOF)
.value("THERMAL", CameraSensorType::THERMAL)
;

// Connectivity enum bindings
connectivity
.value("USB", Connectivity::USB)
.value("ETHERNET", Connectivity::ETHERNET)
.value("WIFI", Connectivity::WIFI)
;
// CameraImageOrientation enum bindings
cameraImageOrientation
.value("AUTO", CameraImageOrientation::AUTO)
Expand Down
1 change: 1 addition & 0 deletions src/pipeline/PipelineBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "depthai/pipeline/node/AprilTag.hpp"
#include "depthai/pipeline/node/DetectionParser.hpp"
#include "depthai/pipeline/node/UVC.hpp"
#include "depthai/pipeline/node/Warp.hpp"

// depthai-shared
#include "depthai-shared/properties/GlobalProperties.hpp"
Expand Down
14 changes: 7 additions & 7 deletions src/pipeline/datatype/EncodedFrameBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ void bind_encodedframe(pybind11::module &m, void *pCallstack) {
.def(py::init<>())
// getters
.def("getTimestamp",
py::overload_cast<>(&EncodedFrame::getTimestamp, py::const_),
DOC(dai, EncodedFrame, getTimestamp))
py::overload_cast<>(&EncodedFrame::Buffer::getTimestamp, py::const_),
DOC(dai, Buffer, getTimestamp))
.def("getTimestampDevice",
py::overload_cast<>(&EncodedFrame::getTimestampDevice, py::const_),
DOC(dai, EncodedFrame, getTimestampDevice))
py::overload_cast<>(&EncodedFrame::Buffer::getTimestampDevice, py::const_),
DOC(dai, Buffer, getTimestampDevice))
.def("getInstanceNum", &EncodedFrame::getInstanceNum,
DOC(dai, EncodedFrame, getInstanceNum))
.def("getSequenceNum", &EncodedFrame::getSequenceNum,
DOC(dai, EncodedFrame, getSequenceNum))
.def("getSequenceNum", &EncodedFrame::Buffer::getSequenceNum,
DOC(dai, Buffer, getSequenceNum))
.def("getExposureTime", &EncodedFrame::getExposureTime,
DOC(dai, EncodedFrame, getExposureTime))
.def("getSensitivity", &EncodedFrame::getSensitivity,
Expand All @@ -116,7 +116,7 @@ void bind_encodedframe(pybind11::module &m, void *pCallstack) {
.def("setTimestampDevice", &EncodedFrame::setTimestampDevice,
DOC(dai, EncodedFrame, setTimestampDevice))
.def("setSequenceNum", &EncodedFrame::setSequenceNum,
DOC(dai, EncodedFrame, getSequenceNum))
DOC(dai, EncodedFrame, setSequenceNum))
.def("setQuality", &EncodedFrame::setQuality,
DOC(dai, EncodedFrame, getQuality))
.def("setBitrate", &EncodedFrame::setBitrate,
Expand Down

0 comments on commit 9c50aa6

Please sign in to comment.