5 #include <nlohmann/json.hpp> 13 #ifdef ARCH_IS_BIG_ENDIAN 15 buf[1] = (val >> 8) & 0xff;
16 buf[2] = (val >> 16) & 0xff;
17 buf[3] = (val >> 24) & 0xff;
18 buf[4] = (val >> 32) & 0xff;
19 buf[5] = (val >> 40) & 0xff;
20 buf[6] = (val >> 48) & 0xff;
21 buf[7] = (val >> 56) & 0xff;
23 reinterpret_cast<uint64_t*
>(buf)[0] = val;
28 #ifdef ARCH_IS_BIG_ENDIAN 30 buf[1] = (val >> 8) & 0xff;
31 buf[2] = (val >> 16) & 0xff;
32 buf[3] = (val >> 24) & 0xff;
34 reinterpret_cast<uint32_t*
>(buf)[0] = val;
39 #ifdef ARCH_IS_BIG_ENDIAN 40 uint32_t val = (bytes[0] << 24) + (bytes[1] << 16) + (bytes[2] << 8) + bytes[3];
43 return reinterpret_cast<const uint32_t*
>(buf)[0];
void to_json(nlohmann::json &j, const Channel &c)
void from_json(const nlohmann::json &j, Channel &c)
uint32_t ReadUint32LE(const uint8_t *buf)
void WriteUint64LE(uint8_t *buf, uint64_t val)
void WriteUint32LE(uint8_t *buf, uint32_t val)