@@ -357,11 +357,12 @@ typedef struct _NTRIP_SERVER_DATA
357
357
358
358
typedef enum
359
359
{
360
- ESPNOW_OFF,
360
+ ESPNOW_OFF = 0 ,
361
361
ESPNOW_BROADCASTING,
362
362
ESPNOW_PAIRING,
363
363
ESPNOW_MAC_RECEIVED,
364
364
ESPNOW_PAIRED,
365
+ ESPNOW_MAX
365
366
} ESPNOWState;
366
367
volatile ESPNOWState espnowState = ESPNOW_OFF;
367
368
@@ -1932,21 +1933,21 @@ class RTK_WIFI
1932
1933
WIFI_CHANNEL_t _channel; // Current WiFi channel number
1933
1934
WIFI_CHANNEL_t _espNowChannel; // Channel required for ESPNow, zero (0) use _channel
1934
1935
bool _espNowRunning; // ESPNow started or running
1935
- const char * _hostName; // Name of this host
1936
1936
volatile bool _scanRunning; // Scan running
1937
1937
bool _softApRunning; // Soft AP is starting or running
1938
1938
int _staAuthType; // Authorization type for the remote AP
1939
1939
bool _staConnected; // True when station is connected
1940
1940
bool _staHasIp; // True when station has IP address
1941
1941
IPAddress _staIpAddress; // IP address of the station
1942
1942
uint8_t _staIpType; // 4 or 6 when IP address is assigned
1943
- uint8_t _staMacAddress[6 ]; // MAC address of the station
1943
+ volatile uint8_t _staMacAddress[6 ]; // MAC address of the station
1944
1944
const char * _staRemoteApSsid; // SSID of remote AP
1945
1945
const char * _staRemoteApPassword; // Password of remote AP
1946
1946
volatile WIFI_ACTION_t _started; // Components that are started and running
1947
1947
WIFI_CHANNEL_t _stationChannel; // Channel required for station, zero (0) use _channel
1948
1948
bool _stationRunning; // True while station is starting or running
1949
1949
uint32_t _timer; // Reconnection timer
1950
+ bool _usingDefaultChannel; // Using default WiFi channel
1950
1951
bool _verbose; // True causes more debug output to be displayed
1951
1952
1952
1953
// Display components begin started or stopped
@@ -1985,8 +1986,8 @@ class RTK_WIFI
1985
1986
// Outputs:
1986
1987
// Returns true if successful and false upon failure
1987
1988
bool setWiFiProtocols (wifi_interface_t interface,
1988
- bool enableWiFiProtocols,
1989
- bool enableLongRangeProtocol);
1989
+ bool enableWiFiProtocols,
1990
+ bool enableLongRangeProtocol);
1990
1991
1991
1992
// Handle the soft AP events
1992
1993
// Inputs:
@@ -2125,6 +2126,11 @@ class RTK_WIFI
2125
2126
// Returns true if ESP-NOW is being started or is online
2126
2127
bool espNowRunning ();
2127
2128
2129
+ // Set the ESP-NOW channel
2130
+ // Inputs:
2131
+ // channel: New ESP-NOW channel number
2132
+ void espNowSetChannel (WIFI_CHANNEL_t channel);
2133
+
2128
2134
// Handle the WiFi event
2129
2135
// Inputs:
2130
2136
// event: Arduino ESP32 event number found on
@@ -2133,16 +2139,10 @@ class RTK_WIFI
2133
2139
// info: Additional data about the event
2134
2140
void eventHandler (arduino_event_id_t event, arduino_event_info_t info);
2135
2141
2136
- // Get the mDNS host name
2142
+ // Get the current WiFi channel
2137
2143
// Outputs:
2138
- // Returns the mDNS host name as a pointer to a zero terminated string
2139
- // of characters
2140
- const char * hostNameGet ();
2141
-
2142
- // Set the mDNS host name
2143
- // Inputs
2144
- // Address of a zero terminated string containing the mDNS host name
2145
- void hostNameSet (const char * mDnsHostName );
2144
+ // Returns the current WiFi channel number
2145
+ WIFI_CHANNEL_t getChannel ();
2146
2146
2147
2147
// Restart WiFi
2148
2148
// Inputs:
0 commit comments