mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 10:53:34 +08:00
TransferListener implemented, tests to be added
This commit is contained in:
@@ -62,10 +62,10 @@ public:
|
||||
*/
|
||||
class SingleFrameIncomingTransfer : public IncomingTransfer
|
||||
{
|
||||
uint8_t payload_[Frame::PAYLOAD_LEN_MAX];
|
||||
const uint8_t* const payload_;
|
||||
const uint8_t payload_len_;
|
||||
public:
|
||||
SingleFrameIncomingTransfer(const RxFrame& frm);
|
||||
SingleFrameIncomingTransfer(const RxFrame& frm, const uint8_t* payload, unsigned int payload_len);
|
||||
int read(unsigned int offset, uint8_t* data, unsigned int len) const;
|
||||
};
|
||||
|
||||
@@ -89,6 +89,8 @@ class TransferListenerBase : public LinkedListNode<TransferListenerBase>
|
||||
{
|
||||
const Crc16 crc_base_; ///< Pre-initialized with data type hash, thus constant
|
||||
|
||||
bool checkPayloadCrc(const uint16_t compare_with, const TransferBufferBase& tbb) const;
|
||||
|
||||
protected:
|
||||
TransferListenerBase(const DataTypeDescriptor* data_type)
|
||||
: crc_base_(data_type->hash.value, DataTypeHash::NUM_BYTES)
|
||||
|
||||
Reference in New Issue
Block a user