Go to the documentation of this file.
5 #ifndef UAVCAN_TRANSPORT_TRANSFER_HPP_INCLUDED
6 #define UAVCAN_TRANSPORT_TRANSFER_HPP_INCLUDED
34 static const uint8_t NumericallyMax = (1U << BitLen) - 1;
52 template <u
int8_t Percent>
56 enum { Result = ((100U - Percent) * NumericallyMax) / 100U };
64 bool isValid()
const {
return value_ < (1U << BitLen); }
77 static const uint8_t Max = (1U << BitLen) - 1U;
78 static const uint8_t Half = (1U << BitLen) / 2U;
96 value_ = (value_ + 1) & Max;
108 int computeForwardDistance(
TransferID rhs)
const;
120 static const uint8_t Max = (1U << BitLen) - 1U;
121 static const uint8_t MaxRecommendedForRegularNodes = Max - 2;
134 bool isValid()
const {
return value_ <= Max; }
136 bool isUnicast()
const {
return (value_ <= Max) && (value_ != ValueBroadcast); }
149 #endif // UAVCAN_TRANSPORT_TRANSFER_HPP_INCLUDED
bool operator!=(NodeID rhs) const
UAVCAN_EXPORT EnableIf<!IsSameType< R, Array< T, ArrayMode, MaxSize > >::Result, bool >::Type operator==(const R &rhs, const Array< T, ArrayMode, MaxSize > &lhs)
static const unsigned GuaranteedPayloadLenPerFrame
Guaranteed for all transfers, all CAN standards.
ROSCPP_DECL bool get(const std::string &key, bool &b)
@ TransferTypeServiceResponse
bool operator<(NodeID rhs) const
bool operator==(TransferPriority rhs) const
struct UAVCAN_EXPORT StaticAssert
@ TransferTypeServiceRequest
bool operator<=(NodeID rhs) const
static const uint8_t NumTransferTypes
static const TransferPriority MiddleLower
bool operator!=(TransferPriority rhs) const
TransferID(uint8_t value)
static const TransferPriority Lowest
static const TransferPriority OneHigherThanLowest
@ TransferTypeMessageBroadcast
bool operator==(NodeID rhs) const
static const NodeID Broadcast
bool operator>=(NodeID rhs) const
static const TransferPriority OneLowerThanHighest
bool operator>(NodeID rhs) const
TransferPriority(uint8_t value)
bool operator==(TransferID rhs) const
static TransferPriority fromPercent()
static const TransferPriority Default
This priority is used by default.
bool operator!=(TransferID rhs) const