| 23 | } |
| 24 | |
| 25 | typedef struct BigEndianUInt16 { |
| 26 | union{ |
| 27 | uint16_t value; |
| 28 | struct { |
| 29 | uint8_t high, low; |
| 30 | }; |
| 31 | }; |
| 32 | |
| 33 | BigEndianUInt16() {} |
| 34 | |
| 35 | BigEndianUInt16(const uint16_t val) { |
| 36 | value = EndianLittleToBig16(val); |
| 37 | } |
| 38 | |
| 39 | BigEndianUInt16& operator=(const uint16_t newValue){ |
| 40 | value = EndianLittleToBig16(newValue); |
| 41 | return *this; |
| 42 | } |
| 43 | |
| 44 | operator uint16_t(){ |
| 45 | return EndianBigToLittle16(value); |
| 46 | } |
| 47 | } __attribute__((packed)) bige_uint16_t; |
| 48 | |
| 49 | typedef struct BigEndianUInt32 { |
| 50 | union{ |
nothing calls this directly
no test coverage detected