Skip to content

Commit 2aa41fb

Browse files
committed
Added deprecation of usb2Mode constructors
1 parent 4297c41 commit 2aa41fb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/DeviceBindings.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ static void bindConstructors(ARG& arg){
219219
return std::make_unique<D>(pipeline, dev);
220220
}), py::arg("pipeline"), DOC(dai, DeviceBase, DeviceBase))
221221
.def(py::init([](const Pipeline& pipeline, bool usb2Mode){
222+
PyErr_WarnEx(PyExc_DeprecationWarning, "Use constructor taking 'UsbSpeed' instead", 1);
222223
auto dev = deviceSearchHelper<D>();
223224
py::gil_scoped_release release;
224225
return std::make_unique<D>(pipeline, dev, usb2Mode);
@@ -234,6 +235,7 @@ static void bindConstructors(ARG& arg){
234235
return std::make_unique<D>(pipeline, dev, pathToCmd);
235236
}), py::arg("pipeline"), py::arg("pathToCmd"), DOC(dai, DeviceBase, DeviceBase, 4))
236237
.def(py::init([](const Pipeline& pipeline, const DeviceInfo& deviceInfo, bool usb2Mode){
238+
PyErr_WarnEx(PyExc_DeprecationWarning, "Use constructor taking 'UsbSpeed' instead", 1);
237239
py::gil_scoped_release release;
238240
return std::make_unique<D>(pipeline, deviceInfo, usb2Mode);
239241
}), py::arg("pipeline"), py::arg("devInfo"), py::arg("usb2Mode") = false, DOC(dai, DeviceBase, DeviceBase, 6))
@@ -253,6 +255,7 @@ static void bindConstructors(ARG& arg){
253255
return std::make_unique<D>(version, dev);
254256
}), py::arg("version") = OpenVINO::VERSION_UNIVERSAL, DOC(dai, DeviceBase, DeviceBase, 10))
255257
.def(py::init([](OpenVINO::Version version, bool usb2Mode){
258+
PyErr_WarnEx(PyExc_DeprecationWarning, "Use constructor taking 'UsbSpeed' instead", 1);
256259
auto dev = deviceSearchHelper<D>();
257260
py::gil_scoped_release release;
258261
return std::make_unique<D>(version, dev, usb2Mode);
@@ -268,6 +271,7 @@ static void bindConstructors(ARG& arg){
268271
return std::make_unique<D>(version, dev, pathToCmd);
269272
}), py::arg("version"), py::arg("pathToCmd"), DOC(dai, DeviceBase, DeviceBase, 13))
270273
.def(py::init([](OpenVINO::Version version, const DeviceInfo& deviceInfo, bool usb2Mode){
274+
PyErr_WarnEx(PyExc_DeprecationWarning, "Use constructor taking 'UsbSpeed' instead", 1);
271275
py::gil_scoped_release release;
272276
return std::make_unique<D>(version, deviceInfo, usb2Mode);
273277
}), py::arg("version"), py::arg("deviceInfo"), py::arg("usb2Mode") = false, DOC(dai, DeviceBase, DeviceBase, 15))

0 commit comments

Comments
 (0)