MCPcopy Create free account
hub / github.com/OpenEPaperLink/OpenEPaperLink / get_mac_format1

Method get_mac_format1

ESP32_AP-Flasher/src/flasher.cpp:287–304  ·  view source on GitHub ↗

extract original mac from firmware (1.54" and 2.9") and make it 2 bytes longer based on info in settings.h

Source from the content-addressed store, hash-verified

285
286// extract original mac from firmware (1.54" and 2.9") and make it 2 bytes longer based on info in settings.h
287void flasher::get_mac_format1() {
288 zbs->select_flash(0);
289 for (uint8_t c = 0; c < 6; c++) {
290 mac[c + 2] = zbs->read_flash(mac_offset + c); // 0xFC06
291 }
292 mac[0] = (uint8_t)(CUSTOM_MAC_HDR >> 8);
293 mac[1] = (uint8_t)CUSTOM_MAC_HDR;
294
295 mac[6] = (uint8_t)(mac_suffix >> 8);
296 mac[7] = (uint8_t)(mac_suffix & 0xFF);
297
298 uint8_t xorchk = 0;
299 for (uint8_t c = 2; c < 8; c++) {
300 xorchk ^= (mac[c] & 0x0F);
301 xorchk ^= (mac[c] >> 4);
302 }
303 mac[7] |= xorchk;
304}
305
306// extract original mac from segmented tag
307void flasher::get_mac_format2() {

Callers

nothing calls this directly

Calls 2

select_flashMethod · 0.45
read_flashMethod · 0.45

Tested by

no test coverage detected