mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-19 16:39:05 +08:00
Pub/sub fixes
This commit is contained in:
parent
ad3175a235
commit
54f920898d
@ -93,7 +93,7 @@ class GenericPublisher
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
GenericPublisher(Scheduler& scheduler, IMarshalBufferProvider& buffer_provider,
|
||||
MonotonicDuration max_transfer_interval = TransferSender::getDefaultMaxTransferInterval())
|
||||
: max_transfer_interval_(max_transfer_interval)
|
||||
@ -116,7 +116,6 @@ protected:
|
||||
return genericPublish(message, transfer_type, dst_node_id, &tid, blocking_deadline);
|
||||
}
|
||||
|
||||
public:
|
||||
static MonotonicDuration getDefaultTxTimeout() { return MonotonicDuration::fromUSec(2500); }// 2500ms --> 400Hz max
|
||||
static MonotonicDuration getMinTxTimeout() { return MonotonicDuration::fromUSec(200); }
|
||||
|
||||
|
||||
@ -123,7 +123,7 @@ class GenericSubscriber : Noncopyable
|
||||
|
||||
message_.setTransfer(&transfer);
|
||||
|
||||
const int decode_res = DataSpec::decode(message_, codec);
|
||||
const int decode_res = DataStruct::decode(message_, codec);
|
||||
// We don't need the data anymore, the memory can be reused from the callback:
|
||||
transfer.release();
|
||||
if (decode_res <= 0)
|
||||
|
||||
@ -10,7 +10,7 @@ namespace uavcan
|
||||
{
|
||||
|
||||
template <typename DataType_>
|
||||
class Publisher : public GenericPublisher<DataType_, DataType_>
|
||||
class Publisher : protected GenericPublisher<DataType_, DataType_>
|
||||
{
|
||||
typedef GenericPublisher<DataType_, DataType_> BaseType;
|
||||
|
||||
@ -40,6 +40,12 @@ public:
|
||||
}
|
||||
return publish(message, TransferTypeMessageUnicast, dst_node_id);
|
||||
}
|
||||
|
||||
using BaseType::getDefaultTxTimeout;
|
||||
using BaseType::getMinTxTimeout;
|
||||
using BaseType::getTxTimeout;
|
||||
using BaseType::setTxTimeout;
|
||||
using BaseType::getScheduler;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user