libpax integration 3 (remove macfilter)
This commit is contained in:
1 parent
29277af8af
commit
b2d6bb7dcc
9 files changed
+25
-41
No files matched your search
@@ -248,7 +248,7 @@ var bitmap1 = function (byte) {
|
||||
}
|
||||
var i = bytesToInt(byte);
|
||||
var bm = ('00000000' + Number(i).toString(2)).substr(-8).split('').map(Number).map(Boolean);
|
||||
return ['adr', 'screensaver', 'screen', 'countermode', 'blescan', 'antenna', 'filter', 'alarm']
|
||||
return ['adr', 'screensaver', 'screen', 'countermode', 'blescan', 'antenna', 'reserved', 'alarm']
|
||||
.reduce(function (obj, pos, index) {
|
||||
obj[pos] = +bm[index];
|
||||
return obj;
|
||||
|
||||
@@ -263,7 +263,7 @@ var bitmap1 = function (byte) {
|
||||
}
|
||||
var i = bytesToInt(byte);
|
||||
var bm = ('00000000' + Number(i).toString(2)).substr(-8).split('').map(Number).map(Boolean);
|
||||
return ['adr', 'screensaver', 'screen', 'countermode', 'blescan', 'antenna', 'filter', 'alarm']
|
||||
return ['adr', 'screensaver', 'screen', 'countermode', 'blescan', 'antenna', 'reserved', 'alarm']
|
||||
.reduce(function (obj, pos, index) {
|
||||
obj[pos] = +bm[index];
|
||||
return obj;
|
||||
|
||||
@@ -51,7 +51,6 @@ static void defaultConfig(configData_t *myconfig) {
|
||||
myconfig->blescan = BLECOUNTER; // 0=disabled, 1=enabled
|
||||
myconfig->wifiscan = WIFICOUNTER; // 0=disabled, 1=enabled
|
||||
myconfig->wifiant = 0; // 0=internal, 1=external (for LoPy/LoPy4)
|
||||
myconfig->macfilter = MACFILTER; // 0=disabled, 1=enabled
|
||||
myconfig->rgblum = RGBLUMINOSITY; // RGB Led luminosity (0..100%)
|
||||
myconfig->monitormode = 0; // 0=disabled, 1=enabled
|
||||
myconfig->payloadmask = PAYLOADMASK; // payloads as defined in default
|
||||
|
||||
@@ -399,10 +399,6 @@ void setup() {
|
||||
strcat_P(features, " SDS");
|
||||
#endif
|
||||
|
||||
#if (MACFILTER)
|
||||
strcat_P(features, " FILTER");
|
||||
#endif
|
||||
|
||||
// initialize matrix display
|
||||
#ifdef HAS_MATRIX_DISPLAY
|
||||
strcat_P(features, " LED_MATRIX");
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#define COUNTERMODE 0 // 0=cyclic, 1=cumulative, 2=cyclic confirmed
|
||||
|
||||
// MAC sniffing parameters
|
||||
#define MACFILTER 1 // set to 0 if you want to scan all devices, 1 to scan only devices with random MACs (aka smartphones) [default = 1]
|
||||
#define BLECOUNTER 1 // set to 0 if you do not want to install the BLE sniffer
|
||||
#define WIFICOUNTER 1 // set to 0 if you do not want to install the WIFI sniffer
|
||||
#define MAC_QUEUE_SIZE 50 // size of MAC processing buffer (number of MACs) [default = 50]
|
||||
|
||||
+9
-6
@@ -49,7 +49,7 @@ void PayloadConvert::addConfig(configData_t value) {
|
||||
buffer[cursor++] = value.blescantime;
|
||||
buffer[cursor++] = value.blescan;
|
||||
buffer[cursor++] = value.wifiant;
|
||||
buffer[cursor++] = value.macfilter;
|
||||
buffer[cursor++] = 0; // reserved
|
||||
buffer[cursor++] = value.rgblum;
|
||||
buffer[cursor++] = value.payloadmask;
|
||||
buffer[cursor++] = value.monitormode;
|
||||
@@ -58,7 +58,8 @@ void PayloadConvert::addConfig(configData_t value) {
|
||||
}
|
||||
|
||||
void PayloadConvert::addStatus(uint16_t voltage, uint64_t uptime, float cputemp,
|
||||
uint32_t mem, uint8_t reset0, uint32_t restarts) {
|
||||
uint32_t mem, uint8_t reset0,
|
||||
uint32_t restarts) {
|
||||
|
||||
buffer[cursor++] = highByte(voltage);
|
||||
buffer[cursor++] = lowByte(voltage);
|
||||
@@ -181,14 +182,15 @@ void PayloadConvert::addConfig(configData_t value) {
|
||||
writeUint8(value.rgblum);
|
||||
writeBitmap(value.adrmode ? true : false, value.screensaver ? true : false,
|
||||
value.screenon ? true : false, value.countermode ? true : false,
|
||||
value.blescan ? true : false, value.wifiant ? true : false,
|
||||
value.macfilter ? true : false, value.monitormode ? true : false);
|
||||
value.blescan ? true : false, value.wifiant ? true : false, 0,
|
||||
value.monitormode ? true : false);
|
||||
writeUint8(value.payloadmask);
|
||||
writeVersion(value.version);
|
||||
}
|
||||
|
||||
void PayloadConvert::addStatus(uint16_t voltage, uint64_t uptime, float cputemp,
|
||||
uint32_t mem, uint8_t reset0, uint32_t restarts) {
|
||||
uint32_t mem, uint8_t reset0,
|
||||
uint32_t restarts) {
|
||||
writeUint16(voltage);
|
||||
writeUptime(uptime);
|
||||
writeUint8((byte)cputemp);
|
||||
@@ -400,7 +402,8 @@ void PayloadConvert::addConfig(configData_t value) {
|
||||
}
|
||||
|
||||
void PayloadConvert::addStatus(uint16_t voltage, uint64_t uptime, float celsius,
|
||||
uint32_t mem, uint8_t reset0, uint32_t restarts) {
|
||||
uint32_t mem, uint8_t reset0,
|
||||
uint32_t restarts) {
|
||||
uint16_t temp = celsius * 10;
|
||||
uint16_t volt = voltage / 10;
|
||||
#if (defined BAT_MEASURE_ADC || defined HAS_PMU)
|
||||
|
||||
+12
-18
@@ -287,12 +287,6 @@ void set_wifiant(uint8_t val[]) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void set_macfilter(uint8_t val[]) {
|
||||
ESP_LOGI(TAG, "Remote command: set macfilter mode to %s",
|
||||
val[0] ? "on" : "off");
|
||||
cfg.macfilter = val[0] ? 1 : 0;
|
||||
}
|
||||
|
||||
void set_rgblum(uint8_t val[]) {
|
||||
// Avoid wrong parameters
|
||||
cfg.rgblum = (val[0] <= 100) ? (uint8_t)val[0] : RGBLUMINOSITY;
|
||||
@@ -422,18 +416,18 @@ static const cmd_t table[] = {
|
||||
{0x07, set_loraadr, 1}, {0x08, set_screensaver, 1},
|
||||
{0x09, set_reset, 1}, {0x0a, set_sendcycle, 1},
|
||||
{0x0b, set_wifichancycle, 1}, {0x0c, set_blescantime, 1},
|
||||
{0x0d, set_macfilter, 1}, {0x0e, set_blescan, 1},
|
||||
{0x0f, set_wifiant, 1}, {0x10, set_rgblum, 1},
|
||||
{0x11, set_monitor, 1}, {0x12, set_beacon, 7},
|
||||
{0x13, set_sensor, 2}, {0x14, set_payloadmask, 1},
|
||||
{0x15, set_bme, 1}, {0x16, set_batt, 1},
|
||||
{0x17, set_wifiscan, 1}, {0x18, set_enscount, 1},
|
||||
{0x19, set_sleepcycle, 2}, {0x20, set_loadconfig, 0},
|
||||
{0x21, set_saveconfig, 0}, {0x80, get_config, 0},
|
||||
{0x81, get_status, 0}, {0x83, get_batt, 0},
|
||||
{0x84, get_gps, 0}, {0x85, get_bme, 0},
|
||||
{0x86, get_time, 0}, {0x87, set_timesync, 0},
|
||||
{0x88, set_time, 4}, {0x99, set_flush, 0}};
|
||||
{0x0e, set_blescan, 1}, {0x0f, set_wifiant, 1},
|
||||
{0x10, set_rgblum, 1}, {0x11, set_monitor, 1},
|
||||
{0x12, set_beacon, 7}, {0x13, set_sensor, 2},
|
||||
{0x14, set_payloadmask, 1}, {0x15, set_bme, 1},
|
||||
{0x16, set_batt, 1}, {0x17, set_wifiscan, 1},
|
||||
{0x18, set_enscount, 1}, {0x19, set_sleepcycle, 2},
|
||||
{0x20, set_loadconfig, 0}, {0x21, set_saveconfig, 0},
|
||||
{0x80, get_config, 0}, {0x81, get_status, 0},
|
||||
{0x83, get_batt, 0}, {0x84, get_gps, 0},
|
||||
{0x85, get_bme, 0}, {0x86, get_time, 0},
|
||||
{0x87, set_timesync, 0}, {0x88, set_time, 4},
|
||||
{0x99, set_flush, 0}};
|
||||
|
||||
static const uint8_t cmdtablesize =
|
||||
sizeof(table) / sizeof(table[0]); // number of commands in command table
|
||||
|
||||
Reference in new issue
Block a user