19 dst->
item(RC6_HEADER_MARK, RC6_HEADER_SPACE);
24 uint8_t header{
static_cast<uint8_t
>((1 << 3) | data.mode)};
26 for (uint8_t mask = 0x8; mask; mask >>= 1) {
33 next = next + RC6_UNIT;
43 next = next - RC6_UNIT;
57 next = next + RC6_UNIT * 2;
67 next = next - RC6_UNIT * 2;
74 uint16_t
raw{
static_cast<uint16_t
>((data.address << 8) | data.command)};
76 for (uint16_t mask = 0x8000; mask; mask >>= 1) {
83 next = next + RC6_UNIT;
93 next = next - RC6_UNIT;
116 if (!
src.expect_item(RC6_HEADER_MARK, RC6_HEADER_SPACE)) {
127 bit =
src.peek() > 0;
128 header = header + (bit << (3 - offset++));
131 if (
src.peek_mark(RC6_UNIT) ||
src.peek_space(RC6_UNIT)) {
133 }
else if (offset == 4) {
135 }
else if (!
src.peek_mark(RC6_UNIT * 2) && !
src.peek_space(RC6_UNIT * 2)) {
140 data.mode = header & RC6_MODE_MASK;
142 if (data.mode != 0) {
147 data.toggle =
src.peek() > 0;
149 if (
src.peek_mark(RC6_UNIT * 2) ||
src.peek_space(RC6_UNIT * 2)) {
155 while (offset < 16) {
156 bit =
src.peek() > 0;
157 buffer = buffer + (bit << (15 - offset++));
162 }
else if (
src.peek_mark(RC6_UNIT) ||
src.peek_space(RC6_UNIT)) {
164 }
else if (!
src.peek_mark(RC6_UNIT * 2) && !
src.peek_space(RC6_UNIT * 2)) {
169 data.address = (0xFF00 & buffer) >> 8;
170 data.command = (0x00FF & buffer);