v1.2.91: enhanced RGB LED blink
This commit is contained in:
parent
42cb206789
commit
dc7f4ca90e
@ -211,6 +211,7 @@ Description of the RGB LED color (LoPy/LoPy4 and Lolin32 only):
|
||||
|
||||
- Yellow quick blink: joining LoRaWAN network in progress or pending
|
||||
- Blue blink: LoRaWAN data transmit (including waiting for receive windows) in progress or pending
|
||||
- Green each blink: seen a Wifi device, new or not, while Wifi scanning
|
||||
- Magenta each blink: seen a BLE device, new or not, while BLE scanning
|
||||
|
||||
# License
|
||||
|
@ -53,11 +53,15 @@ bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) {
|
||||
added = newmac.second; // true if hashed MAC is unique in container
|
||||
|
||||
if (sniff_type == MAC_SNIFF_WIFI ) {
|
||||
rgb_set_color(COLOR_GREEN);
|
||||
newmac = wifis.insert(hashedmac); // add hashed MAC to wifi container if new unique
|
||||
strcpy(typebuff, "WiFi");
|
||||
rgb_set_color(COLOR_NONE);
|
||||
} else if (sniff_type == MAC_SNIFF_BLE ) {
|
||||
rgb_set_color(COLOR_MAGENTA);
|
||||
newmac = bles.insert(hashedmac); // add hashed MAC to BLE container if new unique
|
||||
strcpy(typebuff, "BLE ");
|
||||
rgb_set_color(COLOR_NONE);
|
||||
}
|
||||
|
||||
if (added) { // first time seen this WIFI or BLE MAC
|
||||
@ -85,14 +89,11 @@ class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
|
||||
void onResult(BLEAdvertisedDevice advertisedDevice) {
|
||||
uint8_t *p = (uint8_t *) advertisedDevice.getAddress().getNative();
|
||||
|
||||
rgb_set_color(COLOR_MAGENTA);
|
||||
// Current devices seen on this scan session
|
||||
currentScanDevice++;
|
||||
mac_add(p, advertisedDevice.getRSSI(), MAC_SNIFF_BLE);
|
||||
u8x8.setCursor(12,3);
|
||||
u8x8.printf("%d", currentScanDevice);
|
||||
rgb_set_color(COLOR_NONE);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// program version - note: increment version after modifications to configData_t struct!!
|
||||
#define PROGVERSION "1.2.9" // use max 10 chars here!
|
||||
#define PROGVERSION "1.2.91" // use max 10 chars here!
|
||||
#define PROGNAME "PAXCNT"
|
||||
|
||||
// Verbose enables serial output
|
||||
|
Loading…
Reference in New Issue
Block a user