1 #ifndef DATAIOSTREAM_H_
2 #define DATAIOSTREAM_H_
5 #include "networktables2/stream/IOStream.h"
18 #define TO_HEX__(n) 0x##n##LU // LU for unsigned long
19 #define BINARY_LITERAL_VIA_HEX__(n) (((n & 0x00000001LU) ? 1 : 0)\
20 + ((n & 0x00000010LU) ? 2 : 0) \
21 + ((n & 0x00000100LU) ? 4 : 0) \
22 + ((n & 0x00001000LU) ? 8 : 0) \
23 + ((n & 0x00010000LU) ? 16 : 0) \
24 + ((n & 0x00100000LU) ? 32 : 0) \
25 + ((n & 0x01000000LU) ? 64 : 0) \
26 + ((n & 0x10000000LU) ? 128 : 0))
28 #define b(n) ((unsigned char)BINARY_LITERAL_VIA_HEX__(TO_HEX__(n)))
34 void writeByte(uint8_t b);
35 void write2BytesBE(uint16_t s);
36 void writeString(std::string& str);
40 uint16_t read2BytesBE();
41 std::string* readString();