mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-04 16:51:37 +08:00
IncomingTransfer implements ITransferBuffer, which is necessary for message codec
This commit is contained in:
@@ -19,7 +19,7 @@ namespace uavcan
|
|||||||
/**
|
/**
|
||||||
* Container for received transfer.
|
* Container for received transfer.
|
||||||
*/
|
*/
|
||||||
class IncomingTransfer
|
class IncomingTransfer : public ITransferBuffer
|
||||||
{
|
{
|
||||||
uint64_t ts_monotonic_;
|
uint64_t ts_monotonic_;
|
||||||
uint64_t ts_utc_;
|
uint64_t ts_utc_;
|
||||||
@@ -27,6 +27,9 @@ class IncomingTransfer
|
|||||||
TransferID transfer_id_;
|
TransferID transfer_id_;
|
||||||
NodeID src_node_id_;
|
NodeID src_node_id_;
|
||||||
|
|
||||||
|
/// That's a no-op, asserts in debug builds
|
||||||
|
int write(unsigned int offset, const uint8_t* data, unsigned int len);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
IncomingTransfer(uint64_t ts_monotonic, uint64_t ts_utc, TransferType transfer_type,
|
IncomingTransfer(uint64_t ts_monotonic, uint64_t ts_utc, TransferType transfer_type,
|
||||||
TransferID transfer_id, NodeID source_node_id)
|
TransferID transfer_id, NodeID source_node_id)
|
||||||
@@ -38,13 +41,6 @@ protected:
|
|||||||
{ }
|
{ }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~IncomingTransfer() { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read pure payload, no service fields are included (e.g. Target Node ID, Transfer CRC)
|
|
||||||
*/
|
|
||||||
virtual int read(unsigned int offset, uint8_t* data, unsigned int len) const = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dispose the payload buffer. Further calls to read() will not be possible.
|
* Dispose the payload buffer. Further calls to read() will not be possible.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -9,6 +9,14 @@
|
|||||||
|
|
||||||
namespace uavcan
|
namespace uavcan
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* IncomingTransfer
|
||||||
|
*/
|
||||||
|
int IncomingTransfer::write(unsigned int, const uint8_t*, unsigned int)
|
||||||
|
{
|
||||||
|
assert(0); // Incoming transfer container is read-only
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SingleFrameIncomingTransfer
|
* SingleFrameIncomingTransfer
|
||||||
|
|||||||
Reference in New Issue
Block a user