| 135 | } |
| 136 | |
| 137 | void loopEmulate(RfCodes &data) { |
| 138 | if (data.serial != 0) { |
| 139 | data.fix = data.btn << 28 | data.serial; |
| 140 | data.Bit = 64; |
| 141 | data.keeloq_step(0); |
| 142 | } |
| 143 | |
| 144 | display_info(data); |
| 145 | |
| 146 | while (1) { |
| 147 | if (check(EscPress)) { |
| 148 | keyList.clear(); |
| 149 | bitList.clear(); |
| 150 | |
| 151 | return; |
| 152 | } |
| 153 | |
| 154 | if (check(NextPress)) { |
| 155 | select_menu_option(data.serial != 0); |
| 156 | |
| 157 | if (returnToMenu) { |
| 158 | keyList.clear(); |
| 159 | bitList.clear(); |
| 160 | |
| 161 | return; |
| 162 | } |
| 163 | |
| 164 | display_info(data); |
| 165 | } |
| 166 | |
| 167 | if (check(SelPress)) { |
| 168 | blinkLed(); |
| 169 | |
| 170 | if (data.serial == 0) { |
| 171 | for (int i = 0; uint64_t key : keyList) { |
| 172 | data.Bit = bitList[i++]; |
| 173 | data.key = key; |
| 174 | sendRfCommand(data); |
| 175 | } |
| 176 | } else { |
| 177 | sendRfCommand(data); |
| 178 | data.keeloq_step(num_steps_keeloq); |
| 179 | keeloq_save(data); |
| 180 | display_info(data); |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | void display_info(RfCodes &data) { |
| 187 | char hexString[64] = {0}; |
no test coverage detected