setup macsniff with ota trigger mac

This commit is contained in:
Marius Gripp 2019-09-02 15:11:52 +02:00
parent 2ec6966496
commit e92bcbd8b1
3 changed files with 15 additions and 0 deletions

View File

@ -12,6 +12,7 @@
#define MAC_SNIFF_WIFI 0 #define MAC_SNIFF_WIFI 0
#define MAC_SNIFF_BLE 1 #define MAC_SNIFF_BLE 1
void macsniff_setup(void);
uint16_t get_salt(void); uint16_t get_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);

View File

@ -6,10 +6,22 @@
#include "vendor_array.h" #include "vendor_array.h"
#endif #endif
#include <sstream>
#include <iostream>
// Local logging tag // Local logging tag
static const char TAG[] = __FILE__; static const char TAG[] = __FILE__;
uint16_t salt; uint16_t salt;
uint64_t fota_trigger_mac;
void macsniff_setup() {
std::stringstream ss;
ss << std::hex << OTA_TRIGGER_MAC;
ESP_LOGI(TAG, "OTA_TRIGGER_MAC %X", OTA_TRIGGER_MAC);
ss >> fota_trigger_mac;
std::cout << static_cast<int>(fota_trigger_mac) << std::endl;
}
uint16_t get_salt(void) { uint16_t get_salt(void) {
salt = (uint16_t)random(65536); // get new 16bit random for salting hashes salt = (uint16_t)random(65536); // get new 16bit random for salting hashes

View File

@ -444,6 +444,8 @@ void setup() {
// show compiled features // show compiled features
ESP_LOGI(TAG, "Features:%s", features); ESP_LOGI(TAG, "Features:%s", features);
macsniff_setup();
uart_setup(); uart_setup();
} // setup() } // setup()