diff --git a/bindings/python/icsneopy/device/device.cpp b/bindings/python/icsneopy/device/device.cpp index 2e0e59f..1fc484d 100644 --- a/bindings/python/icsneopy/device/device.cpp +++ b/bindings/python/icsneopy/device/device.cpp @@ -13,31 +13,32 @@ void init_device(pybind11::module_& m) { .def("get_serial", &Device::getSerial) .def("get_serial_number", &Device::getSerialNumber) .def("get_product_name", &Device::getProductName) - .def("open", [](Device& device) { return device.open(); }) - .def("close", &Device::close) + .def("open", [](Device& device) { return device.open(); }, pybind11::call_guard()) + .def("close", &Device::close, pybind11::call_guard()) .def("is_open", &Device::isOpen) - .def("go_online", &Device::goOnline) - .def("go_offline", &Device::goOffline) - .def("is_online", &Device::isOnline).def("enable_message_polling", &Device::enableMessagePolling) - .def("disable_message_polling", &Device::disableMessagePolling) + .def("go_online", &Device::goOnline, pybind11::call_guard()) + .def("go_offline", &Device::goOffline, pybind11::call_guard()) + .def("is_online", &Device::isOnline) + .def("enable_message_polling", &Device::enableMessagePolling, pybind11::call_guard()) + .def("disable_message_polling", &Device::disableMessagePolling, pybind11::call_guard()) .def("is_message_polling_enabled", &Device::isMessagePollingEnabled) - .def("get_messages", [](Device& device) { return device.getMessages(); }) + .def("get_messages", [](Device& device) { return device.getMessages(); }, pybind11::call_guard()) .def("get_current_message_count", &Device::getCurrentMessageCount) .def("get_polling_message_limit", &Device::getPollingMessageLimit) .def("set_polling_message_limit", &Device::setPollingMessageLimit) - .def("add_message_callback", &Device::addMessageCallback) - .def("remove_message_callback", &Device::removeMessageCallback) - .def("transmit", pybind11::overload_cast>(&Device::transmit)) + .def("add_message_callback", &Device::addMessageCallback, pybind11::call_guard()) + .def("remove_message_callback", &Device::removeMessageCallback, pybind11::call_guard()) + .def("transmit", pybind11::overload_cast>(&Device::transmit), pybind11::call_guard()) .def("get_supported_rx_networks", &Device::getSupportedRXNetworks, pybind11::return_value_policy::reference) .def("get_supported_tx_networks", &Device::getSupportedTXNetworks, pybind11::return_value_policy::reference) - .def("get_rtc", &Device::getRTC) - .def("set_rtc", &Device::setRTC) + .def("get_rtc", &Device::getRTC, pybind11::call_guard()) + .def("set_rtc", &Device::setRTC, pybind11::call_guard()) .def("describe", &Device::describe) .def("is_online_supported", &Device::isOnlineSupported) .def("supports_tc10", &Device::supportsTC10) - .def("request_tc10_wake", &Device::requestTC10Wake) - .def("request_tc10_sleep", &Device::requestTC10Sleep) - .def("get_tc10_status", &Device::getTC10Status) + .def("request_tc10_wake", &Device::requestTC10Wake, pybind11::call_guard()) + .def("request_tc10_sleep", &Device::requestTC10Sleep, pybind11::call_guard()) + .def("get_tc10_status", &Device::getTC10Status, pybind11::call_guard()) .def("__repr__", &Device::describe); }