diff --git a/libuavcan/include/uavcan/node/generic_publisher.hpp b/libuavcan/include/uavcan/node/generic_publisher.hpp index a2844e7932..60623ecbe3 100644 --- a/libuavcan/include/uavcan/node/generic_publisher.hpp +++ b/libuavcan/include/uavcan/node/generic_publisher.hpp @@ -126,6 +126,15 @@ public: return checkInit(); } + /** + * This overload allows to set the priority; otherwise it's the same. + */ + int init(TransferPriority priority) + { + setPriority(priority); + return checkInit(); + } + int publish(const DataStruct& message, TransferType transfer_type, NodeID dst_node_id, MonotonicTime blocking_deadline = MonotonicTime()) { diff --git a/libuavcan/include/uavcan/node/service_client.hpp b/libuavcan/include/uavcan/node/service_client.hpp index f2c388d3be..daea7ac7cf 100644 --- a/libuavcan/include/uavcan/node/service_client.hpp +++ b/libuavcan/include/uavcan/node/service_client.hpp @@ -324,6 +324,16 @@ public: return publisher_.init(); } + /** + * Shall be called before first use. + * This overload allows to set the priority, otherwise it's the same. + * Returns negative error code. + */ + int init(TransferPriority priority) + { + return publisher_.init(priority); + } + /** * Performs non-blocking service call. * This method transmits the service request and returns immediately.