33 uint8_t remote_state[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00};
40 remote_state[3] = 0x50;
45 remote_state[2] = 0x60;
46 remote_state[3] = 0x50;
51 remote_state[5] = 0x40;
54 remote_state[0] |= (1 << 6);
63 remote_state[3] = 0x50;
64 remote_state[6] = 0x20;
67 remote_state[0] |= (1 << 6);
76 remote_state[2] = (remote_state[2] & 0x0F) | this->
mode_bits_;
81 remote_state[2] |= GREE_FAN_TURBO_BIT;
85 if (this->
preset_() == GREE_PRESET_SLEEP) {
86 remote_state[0] |= GREE_PRESET_SLEEP_BIT;
91 remote_state[7] = ((remote_state[0] << 4) + (remote_state[1] << 4) + 0xC0);
94 ((((remote_state[0] & 0x0F) + (remote_state[1] & 0x0F) + (remote_state[2] & 0x0F) + (remote_state[3] & 0x0F) +
95 ((remote_state[4] & 0xF0) >> 4) + ((remote_state[5] & 0xF0) >> 4) + ((remote_state[6] & 0xF0) >> 4) + 0x0A) &
101 auto *data = transmit.get_data();
102 data->set_carrier_frequency(GREE_IR_FREQUENCY);
104 data->mark(GREE_HEADER_MARK);
106 data->space(GREE_YAC1FB9_HEADER_SPACE);
108 data->space(GREE_HEADER_SPACE);
111 for (
int i = 0; i < 4; i++) {
112 for (uint8_t mask = 1; mask > 0; mask <<= 1) {
113 data->mark(GREE_BIT_MARK);
114 bool bit = remote_state[i] & mask;
115 data->space(bit ? GREE_ONE_SPACE : GREE_ZERO_SPACE);
119 data->mark(GREE_BIT_MARK);
120 data->space(GREE_ZERO_SPACE);
121 data->mark(GREE_BIT_MARK);
122 data->space(GREE_ONE_SPACE);
123 data->mark(GREE_BIT_MARK);
124 data->space(GREE_ZERO_SPACE);
126 data->mark(GREE_BIT_MARK);
128 data->space(GREE_YAC1FB9_MESSAGE_SPACE);
130 data->space(GREE_MESSAGE_SPACE);
133 for (
int i = 4; i < 8; i++) {
134 for (uint8_t mask = 1; mask > 0; mask <<= 1) {
135 data->mark(GREE_BIT_MARK);
136 bool bit = remote_state[i] & mask;
137 data->space(bit ? GREE_ONE_SPACE : GREE_ZERO_SPACE);
141 data->mark(GREE_BIT_MARK);