buffered MAC processing (experimental)
This commit is contained in:
1 parent
643352ce80
commit
1cd9ae16f1
8 files changed
+129
-49
No files matched your search
+11
-5
@@ -18,10 +18,6 @@
|
||||
#include "mallocator.h"
|
||||
#include <bsec.h>
|
||||
|
||||
// sniffing types
|
||||
#define MAC_SNIFF_WIFI 0
|
||||
#define MAC_SNIFF_BLE 1
|
||||
|
||||
// bits in payloadmask for filtering payload data
|
||||
#define GPS_DATA (0x01)
|
||||
#define ALARM_DATA (0x02)
|
||||
@@ -75,6 +71,9 @@ enum runmode_t {
|
||||
RUNMODE_UPDATE
|
||||
};
|
||||
|
||||
// sniffing types
|
||||
enum snifftype_t { MAC_SNIFF_WIFI, MAC_SNIFF_BLE, MAC_SNIFF_BLE_ENS };
|
||||
|
||||
// Struct holding devices's runtime configuration
|
||||
// using packed to avoid compiler padding, because struct will be memcpy'd to
|
||||
// byte array
|
||||
@@ -114,6 +113,13 @@ typedef struct {
|
||||
uint8_t Message[PAYLOAD_BUFFER_SIZE];
|
||||
} MessageBuffer_t;
|
||||
|
||||
// Struct for MAC processing queue
|
||||
typedef struct {
|
||||
uint8_t mac[6];
|
||||
int8_t rssi;
|
||||
snifftype_t sniff_type;
|
||||
} MacBuffer_t;
|
||||
|
||||
typedef struct {
|
||||
int32_t latitude;
|
||||
int32_t longitude;
|
||||
@@ -151,7 +157,7 @@ extern bool volatile TimePulseTick; // 1sec pps flag set by GPS or RTC
|
||||
extern timesource_t timeSource;
|
||||
extern hw_timer_t *displayIRQ, *matrixDisplayIRQ, *ppsIRQ;
|
||||
extern SemaphoreHandle_t I2Caccess;
|
||||
extern TaskHandle_t irqHandlerTask, ClockTask;
|
||||
extern TaskHandle_t irqHandlerTask, ClockTask, macProcessTask;
|
||||
extern TimerHandle_t WifiChanTimer;
|
||||
extern Timezone myTZ;
|
||||
extern RTC_DATA_ATTR runmode_t RTC_runmode;
|
||||
|
||||
+4
-5
@@ -14,13 +14,12 @@
|
||||
#include "corona.h"
|
||||
#endif
|
||||
|
||||
#define MAC_SNIFF_WIFI 0
|
||||
#define MAC_SNIFF_BLE 1
|
||||
#define MAC_SNIFF_BLE_CWA 2
|
||||
|
||||
uint16_t get_salt(void);
|
||||
uint64_t macConvert(uint8_t *paddr);
|
||||
uint16_t mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type);
|
||||
esp_err_t macQueueInit(void);
|
||||
void mac_process(void *pvParameters);
|
||||
void IRAM_ATTR mac_add(uint8_t *paddr, int8_t rssi, snifftype_t sniff_type);
|
||||
uint16_t mac_analyze(uint8_t *paddr, int8_t rssi, snifftype_t sniff_type);
|
||||
void printKey(const char *name, const uint8_t *key, uint8_t len, bool lsb);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user