5 #ifndef UAVCAN_MARSHAL_BIT_STREAM_HPP_INCLUDED 6 #define UAVCAN_MARSHAL_BIT_STREAM_HPP_INCLUDED 33 static const unsigned MaxBytesPerRW = 16;
42 uint8_t* dst_org,
unsigned dst_offset)
44 bitarrayCopy(reinterpret_cast<const unsigned char*>(src_org), 0, src_len,
45 reinterpret_cast<unsigned char*>(dst_org), dst_offset);
51 bitarrayCopy(reinterpret_cast<const unsigned char*>(src_org), src_offset, src_len,
52 reinterpret_cast<unsigned char*>(dst_org), 0);
56 static const unsigned MaxBitsPerRW = MaxBytesPerRW * 8;
60 ResultOutOfBuffer = 0,
69 StaticAssert<sizeof(uint8_t) == 1>::check();
83 int write(
const uint8_t* bytes,
const unsigned bitlen);
84 int read(
uint8_t* bytes,
const unsigned bitlen);
93 #endif // UAVCAN_MARSHAL_BIT_STREAM_HPP_INCLUDED
static unsigned bitlenToBytelen(unsigned bits)
static std::string toString(long x)
static void copyBitArrayAlignedToUnaligned(const uint8_t *src_org, unsigned src_len, uint8_t *dst_org, unsigned dst_offset)
void bitarrayCopy(const unsigned char *src_org, std::size_t src_offset, std::size_t src_len, unsigned char *dst_org, std::size_t dst_offset)
static void copyBitArrayUnalignedToAligned(const uint8_t *src_org, unsigned src_offset, unsigned src_len, uint8_t *dst_org)
BitStream(ITransferBuffer &buf)