v1.3.97 @ Espressif 1.2.0
This commit is contained in:
		
							parent
							
								
									4a6449f363
								
							
						
					
					
						commit
						ec81293a38
					
				| @ -12,8 +12,8 @@ | ||||
| ; ---> SELECT TARGET PLATFORM HERE! <--- | ||||
| [platformio] | ||||
| ;env_default = test | ||||
| env_default = generic | ||||
| ;env_default = heltec | ||||
| ;env_default = generic | ||||
| env_default = heltec | ||||
| ;env_default = ttgov1 | ||||
| ;env_default = ttgov2 | ||||
| ;env_default = ttgov21 | ||||
|  | ||||
| @ -8,7 +8,7 @@ | ||||
| #include <esp32-hal-log.h> | ||||
| 
 | ||||
| // attn: increment version after modifications to configData_t truct!
 | ||||
| #define PROGVERSION "1.3.96" // use max 10 chars here!
 | ||||
| #define PROGVERSION "1.3.97" // use max 10 chars here!
 | ||||
| #define PROGNAME "PAXCNT" | ||||
| 
 | ||||
| // std::set for unified array functions
 | ||||
|  | ||||
| @ -15,6 +15,9 @@ | ||||
| 
 | ||||
| #define HAS_LED GPIO_NUM_21 // on board  LED
 | ||||
| #define HAS_BUTTON GPIO_NUM_39 // on board button
 | ||||
| #define HAS_RGB_LED   GPIO_NUM_0  // WS2812B RGB LED on GPIO0
 | ||||
| 
 | ||||
| #define BOARD_HAS_PSRAM // use extra 4MB extern RAM
 | ||||
| 
 | ||||
| #define HAS_GPS 1 // use if board has GPS
 | ||||
| #define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_12, GPIO_NUM_15 // UBlox NEO 6M or 7M with default configuration
 | ||||
|  | ||||
| @ -18,13 +18,11 @@ IRAM_ATTR void wifi_sniffer_packet_handler(void *buff, | ||||
|   const wifi_ieee80211_mac_hdr_t *hdr = &ipkt->hdr; | ||||
| 
 | ||||
|   if ((cfg.rssilimit) && | ||||
|       (ppkt->rx_ctrl.rssi < cfg.rssilimit)) { // rssi is negative value
 | ||||
|     ESP_LOGI(TAG, "WiFi RSSI %d -> ignoring (limit: %d)", ppkt->rx_ctrl.rssi, | ||||
|       (ppkt->rx_ctrl.rssi < cfg.rssilimit)) // rssi is negative value
 | ||||
|     ESP_LOGD(TAG, "WiFi RSSI %d -> ignoring (limit: %d)", ppkt->rx_ctrl.rssi, | ||||
|              cfg.rssilimit); | ||||
|   } else { | ||||
|     uint8_t *p = (uint8_t *)hdr->addr2; | ||||
|     mac_add(p, ppkt->rx_ctrl.rssi, MAC_SNIFF_WIFI); | ||||
|   } | ||||
|   else // count seen MAC
 | ||||
|     mac_add((uint8_t *)hdr->addr2, ppkt->rx_ctrl.rssi, MAC_SNIFF_WIFI); | ||||
| } | ||||
| 
 | ||||
| void wifi_sniffer_init(void) { | ||||
| @ -44,16 +42,6 @@ void wifi_sniffer_init(void) { | ||||
|   ESP_ERROR_CHECK(esp_wifi_set_promiscuous(true)); // now switch on monitor mode
 | ||||
| } | ||||
| 
 | ||||
| void wifi_sniffer_set_channel(uint8_t channel) { | ||||
|   esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE); | ||||
| } | ||||
| 
 | ||||
| void IRAM_ATTR ChannelSwitchIRQ() { | ||||
|   portENTER_CRITICAL(&timerMux); | ||||
|   ChannelTimerIRQ++; | ||||
|   portEXIT_CRITICAL(&timerMux); | ||||
| } | ||||
| 
 | ||||
| // Wifi channel rotation task
 | ||||
| void wifi_channel_loop(void *pvParameters) { | ||||
| 
 | ||||
| @ -67,11 +55,18 @@ void wifi_channel_loop(void *pvParameters) { | ||||
|       portEXIT_CRITICAL(&timerMux); | ||||
|       // rotates variable channel 1..WIFI_CHANNEL_MAX
 | ||||
|       channel = (channel % WIFI_CHANNEL_MAX) + 1; | ||||
|       wifi_sniffer_set_channel(channel); | ||||
|       esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE); | ||||
|       ESP_LOGD(TAG, "Wifi set channel %d", channel); | ||||
| 
 | ||||
|       vTaskDelay(1 / portTICK_PERIOD_MS); // reset watchdog
 | ||||
|     } | ||||
| 
 | ||||
|   } // end of infinite wifi channel rotation loop
 | ||||
| } | ||||
| 
 | ||||
| // IRQ handler
 | ||||
| void IRAM_ATTR ChannelSwitchIRQ() { | ||||
|   portENTER_CRITICAL(&timerMux); | ||||
|   ChannelTimerIRQ++; | ||||
|   portEXIT_CRITICAL(&timerMux); | ||||
| } | ||||
| @ -26,7 +26,6 @@ typedef struct { | ||||
| } wifi_ieee80211_packet_t; | ||||
| 
 | ||||
| void wifi_sniffer_init(void); | ||||
| void wifi_sniffer_set_channel(uint8_t channel); | ||||
| void wifi_sniffer_packet_handler(void *buff, wifi_promiscuous_pkt_type_t type); | ||||
| void ChannelSwitchIRQ(void); | ||||
| void wifi_channel_loop(void *pvParameters); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user