65 UAVCAN_TRACE(
"TransferReceiver",
"CRC expected, %s", frame.toString().c_str());
71 UAVCAN_TRACE(
"TransferReceiver",
"Toggle bit is not cleared, %s", frame.toString().c_str());
77 UAVCAN_TRACE(
"TransferReceiver",
"Unexpected start of transfer, %s", frame.toString().c_str());
82 UAVCAN_TRACE(
"TransferReceiver",
"Unexpected toggle bit (not %i), %s",
89 UAVCAN_TRACE(
"TransferReceiver",
"Unexpected TID (current %i), %s",
tid_.
get(), frame.toString().c_str());
112 const bool success = res ==
static_cast<int>(effective_payload_len);
122 const bool success = res ==
static_cast<int>(payload_len);
157 UAVCAN_TRACE(
"TransferReceiver",
"Failed to access the buffer, %s", frame.toString().c_str());
164 UAVCAN_TRACE(
"TransferReceiver",
"Payload write failed, %s", frame.toString().c_str());
192 UAVCAN_TRACE(
"TransferReceiver",
"Invalid frame, %s", frame.toString().c_str());
205 const bool need_restart =
208 (same_iface && first_frame && not_previous_tid) ||
209 (iface_switch_allowed && first_frame && non_wrapped_tid);
217 UAVCAN_TRACE(
"TransferReceiver",
"Restart [ni=%d, isa=%d, tt=%d, si=%d, ff=%d, nwtid=%d, nptid=%d, tid=%d], %s",
218 int(not_initialized),
int(iface_switch_allowed),
int(tid_timed_out),
int(same_iface),
219 int(first_frame),
int(non_wrapped_tid),
int(not_previous_tid),
int(
tid_.
get()),
220 frame.toString().c_str());
ITransferBuffer * access()
bool isMidTransfer() const
bool isStartOfTransfer() const
MonotonicTime getMonotonicTimestamp() const
uint16_t this_transfer_crc_
MonotonicTime prev_transfer_ts_
unsigned getPayloadLen() const
static const uint16_t DefaultTransferIntervalMSec
ITransferBuffer * create()
MonotonicDuration getTidTimeout() const
uint8_t yieldErrorCount()
#define UAVCAN_TRACE(...)
bool isTimedOut(MonotonicTime current_ts) const
uint16_t transfer_interval_msec_
TransferID getTransferID() const
static const uint8_t Half
const uint8_t * getPayloadPtr() const
virtual int write(unsigned offset, const uint8_t *data, unsigned len)=0
UAVCAN_EXPORT const T & max(const T &a, const T &b)
bool isEndOfTransfer() const
static const uint16_t MaxTransferIntervalMSec
MonotonicTime this_transfer_ts_
uint8_t getIfaceIndex() const
int computeForwardDistance(TransferID rhs) const
UAVCAN_EXPORT const T & min(const T &a, const T &b)
bool isInitialized() const
bool writePayload(const RxFrame &frame, ITransferBuffer &buf)
bool validate(const RxFrame &frame) const
ResultCode receive(const RxFrame &frame, TransferBufferAccessor &tba)
static const uint16_t MinTransferIntervalMSec
UtcTime getUtcTimestamp() const
MonotonicDuration getIfaceSwitchDelay() const
uint16_t buffer_write_pos_
static const uint16_t DefaultTidTimeoutMSec
static MonotonicDuration fromMSec(int64_t ms)
void registerError() const
void prepareForNextTransfer()
void updateTransferTimings()
ResultCode addFrame(const RxFrame &frame, TransferBufferAccessor &tba)