mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 00:13:34 +08:00
ServiceServer sends response at the same priority as request
This commit is contained in:
@@ -139,6 +139,8 @@ private:
|
||||
|
||||
if (response.isResponseEnabled())
|
||||
{
|
||||
publisher_.setPriority(request.getPriority()); // Responding at the same priority.
|
||||
|
||||
const int res = publisher_.publish(response, TransferTypeServiceResponse, request.getSrcNodeID(),
|
||||
request.getTransferID());
|
||||
if (res < 0)
|
||||
|
||||
@@ -84,7 +84,7 @@ TEST(ServiceServer, Basic)
|
||||
|
||||
frame.setStartOfTransfer(true);
|
||||
frame.setEndOfTransfer(true);
|
||||
frame.setPriority(10);
|
||||
frame.setPriority(i);
|
||||
|
||||
uavcan::RxFrame rx_frame(frame, clock_driver.getMonotonic(), clock_driver.getUtc(), 0);
|
||||
can_driver.ifaces[0].pushRx(rx_frame);
|
||||
@@ -111,6 +111,7 @@ TEST(ServiceServer, Basic)
|
||||
ASSERT_EQ(i, fr.getTransferID().get());
|
||||
ASSERT_EQ(uavcan::TransferTypeServiceResponse, fr.getTransferType());
|
||||
ASSERT_EQ(i + 0x10, fr.getDstNodeID().get());
|
||||
ASSERT_EQ(i, fr.getPriority().get());
|
||||
|
||||
// Second frame
|
||||
ASSERT_TRUE(fr.parse(can_driver.ifaces[0].popTxFrame()));
|
||||
|
||||
Reference in New Issue
Block a user