| 157 | } |
| 158 | |
| 159 | bool flasher::getInfoBlockMD5() { |
| 160 | if (!zbs->select_flash(1)) return false; |
| 161 | for (uint16_t c = 0; c < 16; c++) { |
| 162 | md5[c] = zbs->read_flash(c + 0x30); |
| 163 | } |
| 164 | uint16_t macsum = 0; |
| 165 | for (uint8_t c = 0; c < 16; c++) { |
| 166 | macsum += md5[c]; |
| 167 | sprintf(md5char + (2 * c), "%02X", md5[c]); |
| 168 | } |
| 169 | Seriallog.printf("Infoblock MD5=%s\r\n", md5char); |
| 170 | if (macsum == 0) return false; // invalid mac |
| 171 | if (macsum > 0xF00) return false; // *probably* an invalid mac |
| 172 | return true; |
| 173 | } |
| 174 | |
| 175 | bool flasher::getInfoBlockType() { |
| 176 | if (!zbs->select_flash(1)) return false; |
no test coverage detected