diff --git a/src/lorawan.cpp b/src/lorawan.cpp index 943df011..b6c9b2aa 100644 --- a/src/lorawan.cpp +++ b/src/lorawan.cpp @@ -107,18 +107,6 @@ void get_hard_deveui(uint8_t *pdeveui) { #ifdef VERBOSE -// Display a key -void printKey(const char *name, const uint8_t *key, uint8_t len, bool lsb) { - const uint8_t *p; - char keystring[len + 1] = "", keybyte[3]; - for (uint8_t i = 0; i < len; i++) { - p = lsb ? key + len - i - 1 : key + i; - sprintf(keybyte, "%02X", *p); - strncat(keystring, keybyte, 2); - } - ESP_LOGI(TAG, "%s: %s", name, keystring); -} - // Display OTAA keys void printKeys(void) { // LMIC may not have used callback to fill diff --git a/src/lorawan.h b/src/lorawan.h index 1c8645d4..45123d9e 100644 --- a/src/lorawan.h +++ b/src/lorawan.h @@ -14,7 +14,6 @@ void os_getDevKey(u1_t *buf); void os_getArtEui(u1_t *buf); void os_getDevEui(u1_t *buf); void printKeys(void); -void printKey(const char *name, const uint8_t *key, uint8_t len, bool lsb); void lorawan_loop(void *pvParameters); #endif \ No newline at end of file diff --git a/src/macsniff.cpp b/src/macsniff.cpp index 8bc7addd..b11f8785 100644 --- a/src/macsniff.cpp +++ b/src/macsniff.cpp @@ -24,6 +24,18 @@ int8_t isBeacon(uint64_t mac) { return -1; } +// Display a key +void printKey(const char *name, const uint8_t *key, uint8_t len, bool lsb) { + const uint8_t *p; + char keystring[len + 1] = "", keybyte[3]; + for (uint8_t i = 0; i < len; i++) { + p = lsb ? key + len - i - 1 : key + i; + sprintf(keybyte, "%02X", *p); + strncat(keystring, keybyte, 2); + } + ESP_LOGI(TAG, "%s: %s", name, keystring); +} + uint64_t macConvert(uint8_t *paddr) { return ((uint64_t)paddr[0]) | ((uint64_t)paddr[1] << 8) | ((uint64_t)paddr[2] << 16) | ((uint64_t)paddr[3] << 24) | diff --git a/src/macsniff.h b/src/macsniff.h index 1f2c2adb..40adb6cf 100644 --- a/src/macsniff.h +++ b/src/macsniff.h @@ -15,5 +15,6 @@ uint16_t reset_salt(void); uint64_t macConvert(uint8_t *paddr); bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type); +void printKey(const char *name, const uint8_t *key, uint8_t len, bool lsb); #endif \ No newline at end of file diff --git a/src/rcommand.cpp b/src/rcommand.cpp index 59a8a24b..59c58f89 100644 --- a/src/rcommand.cpp +++ b/src/rcommand.cpp @@ -183,7 +183,7 @@ void set_beacon(uint8_t val[]) { memmove(val, val + 1, 6); // strip off storage id beacons[id] = macConvert(val); // store beacon MAC in array ESP_LOGI(TAG, "Remote command: set beacon ID#%d", id); - //printKey("MAC", val, 6, false); // show beacon MAC + printKey("MAC", val, 6, false); // show beacon MAC }; void set_monitor(uint8_t val[]) {