| 110 | } |
| 111 | |
| 112 | void keeloq_save(RfCodes data) { |
| 113 | String subfile_out = "Filetype: Bruce SubGhz File\nVersion 1\n"; |
| 114 | subfile_out += "Frequency: " + String(data.frequency) + "\n"; |
| 115 | subfile_out += "Preset: " + String(data.preset) + "\n"; |
| 116 | subfile_out += "Protocol: RcSwitch\n"; |
| 117 | subfile_out += "Bit: " + String(data.Bit) + "\n"; |
| 118 | |
| 119 | subfile_out += "Manufacturer: " + String(data.mf_name) + "\n"; |
| 120 | char hexString[64] = {0}; |
| 121 | |
| 122 | decimalToHexString(data.serial, hexString); |
| 123 | |
| 124 | subfile_out += "Serial: " + String(hexString) + "\n"; |
| 125 | subfile_out += "Button: " + String(data.btn) + "\n"; |
| 126 | subfile_out += "Counter: " + String(data.cnt) + "\n"; |
| 127 | |
| 128 | subfile_out += "TE: " + String(data.te) + "\n"; |
| 129 | |
| 130 | File file = filesystem->open(filepath, "w", true); |
| 131 | |
| 132 | if (file) { file.println(subfile_out); } |
| 133 | |
| 134 | file.close(); |
| 135 | } |
| 136 | |
| 137 | void loopEmulate(RfCodes &data) { |
| 138 | if (data.serial != 0) { |
no test coverage detected