44 uint8_t remote_state[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00};
50 remote_state[2] = 0x20;
51 remote_state[3] = 0x50;
56 remote_state[2] = 0x60;
57 remote_state[3] = 0x50;
62 remote_state[5] = 0x40;
65 remote_state[0] |= (1 << 6);
74 remote_state[2] = 0x20;
75 remote_state[3] = 0x50;
76 remote_state[6] = 0x20;
79 remote_state[0] |= (1 << 6);
89 remote_state[2] = (remote_state[2] & 0x0F) | this->
mode_bits_;
94 remote_state[2] |= GREE_FAN_TURBO_BIT;
97 if (this->
preset_() == GREE_PRESET_SLEEP) {
98 remote_state[0] |= GREE_PRESET_SLEEP_BIT;
104 remote_state[7] = ((remote_state[0] << 4) + (remote_state[1] << 4) + 0xC0);
107 ((((remote_state[0] & 0x0F) + (remote_state[1] & 0x0F) + (remote_state[2] & 0x0F) + (remote_state[3] & 0x0F) +
108 ((remote_state[4] & 0xF0) >> 4) + ((remote_state[5] & 0xF0) >> 4) + ((remote_state[6] & 0xF0) >> 4) + 0x0A) &
114 auto *data = transmit.get_data();
115 data->set_carrier_frequency(GREE_IR_FREQUENCY);
117 data->mark(GREE_HEADER_MARK);
119 data->space(GREE_YAC1FB9_HEADER_SPACE);
121 data->space(GREE_HEADER_SPACE);
124 for (
int i = 0; i < 4; i++) {
125 for (uint8_t mask = 1; mask > 0; mask <<= 1) {
126 data->mark(GREE_BIT_MARK);
127 bool bit = remote_state[i] & mask;
128 data->space(bit ? GREE_ONE_SPACE : GREE_ZERO_SPACE);
132 data->mark(GREE_BIT_MARK);
133 data->space(GREE_ZERO_SPACE);
134 data->mark(GREE_BIT_MARK);
135 data->space(GREE_ONE_SPACE);
136 data->mark(GREE_BIT_MARK);
137 data->space(GREE_ZERO_SPACE);
139 data->mark(GREE_BIT_MARK);
141 data->space(GREE_YAC1FB9_MESSAGE_SPACE);
143 data->space(GREE_MESSAGE_SPACE);
146 for (
int i = 4; i < 8; i++) {
147 for (uint8_t mask = 1; mask > 0; mask <<= 1) {
148 data->mark(GREE_BIT_MARK);
149 bool bit = remote_state[i] & mask;
150 data->space(bit ? GREE_ONE_SPACE : GREE_ZERO_SPACE);
154 data->mark(GREE_BIT_MARK);