commit
862c339166
@ -53,7 +53,7 @@ build_flags =
|
|||||||
-D_lmic_config_h_
|
-D_lmic_config_h_
|
||||||
-include "src/paxcounter.conf"
|
-include "src/paxcounter.conf"
|
||||||
-include "src/hal/${PIOENV}.h"
|
-include "src/hal/${PIOENV}.h"
|
||||||
; -w
|
-w
|
||||||
|
|
||||||
[env:test]
|
[env:test]
|
||||||
platform = ${common_env_data.platform_espressif32}
|
platform = ${common_env_data.platform_espressif32}
|
||||||
|
@ -107,18 +107,6 @@ void get_hard_deveui(uint8_t *pdeveui) {
|
|||||||
|
|
||||||
#ifdef VERBOSE
|
#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
|
// Display OTAA keys
|
||||||
void printKeys(void) {
|
void printKeys(void) {
|
||||||
// LMIC may not have used callback to fill
|
// LMIC may not have used callback to fill
|
||||||
|
@ -14,7 +14,6 @@ void os_getDevKey(u1_t *buf);
|
|||||||
void os_getArtEui(u1_t *buf);
|
void os_getArtEui(u1_t *buf);
|
||||||
void os_getDevEui(u1_t *buf);
|
void os_getDevEui(u1_t *buf);
|
||||||
void printKeys(void);
|
void printKeys(void);
|
||||||
void printKey(const char *name, const uint8_t *key, uint8_t len, bool lsb);
|
|
||||||
void lorawan_loop(void *pvParameters);
|
void lorawan_loop(void *pvParameters);
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -24,6 +24,18 @@ int8_t isBeacon(uint64_t mac) {
|
|||||||
return -1;
|
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) {
|
uint64_t macConvert(uint8_t *paddr) {
|
||||||
return ((uint64_t)paddr[0]) | ((uint64_t)paddr[1] << 8) |
|
return ((uint64_t)paddr[0]) | ((uint64_t)paddr[1] << 8) |
|
||||||
((uint64_t)paddr[2] << 16) | ((uint64_t)paddr[3] << 24) |
|
((uint64_t)paddr[2] << 16) | ((uint64_t)paddr[3] << 24) |
|
||||||
|
@ -15,5 +15,6 @@
|
|||||||
uint16_t reset_salt(void);
|
uint16_t reset_salt(void);
|
||||||
uint64_t macConvert(uint8_t *paddr);
|
uint64_t macConvert(uint8_t *paddr);
|
||||||
bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type);
|
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
|
#endif
|
Loading…
Reference in New Issue
Block a user