Skip to content

WiFiS3 and WiFIC3 Add wl definitions #439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions libraries/WiFiS3/src/WiFi.h
Original file line number Diff line number Diff line change
@@ -17,9 +17,7 @@
#define DEFAULT_GW_AP_ADDRESS IPAddress(192,168,1,1)
#define DEFAULT_NM_AP_ADDRESS IPAddress(255,255,255,0)


#define WIFI_FIRMWARE_LATEST_VERSION "0.4.1"
#define WL_MAC_ADDR_LENGTH 6

class CAccessPoint {
public:
46 changes: 28 additions & 18 deletions libraries/WiFiS3/src/WiFiTypes.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
#ifndef WIFI_S3_TYPES_H
#define WIFI_S3_TYPES_H

// Maximum size of a SSID
#define WL_SSID_MAX_LENGTH 32
// Length of passphrase. Valid lengths are 8-63.
#define WL_WPA_KEY_MAX_LENGTH 63
// Length of key in bytes. Valid values are 5 and 13.
#define WL_WEP_KEY_MAX_LENGTH 13
// Size of a MAC-address or BSSID
#define WL_MAC_ADDR_LENGTH 6
// Size of a IP4 address
#define WL_IPV4_LENGTH 4

typedef enum {
WL_NO_SHIELD = 255,
WL_NO_MODULE = WL_NO_SHIELD,
WL_IDLE_STATUS = 0,
WL_NO_SSID_AVAIL,
WL_SCAN_COMPLETED,
WL_CONNECTED,
WL_CONNECT_FAILED,
WL_CONNECTION_LOST,
WL_DISCONNECTED,
WL_AP_LISTENING,
WL_AP_CONNECTED,
WL_AP_FAILED
WL_NO_SHIELD = 255,
WL_NO_MODULE = WL_NO_SHIELD,
WL_IDLE_STATUS = 0,
WL_NO_SSID_AVAIL,
WL_SCAN_COMPLETED,
WL_CONNECTED,
WL_CONNECT_FAILED,
WL_CONNECTION_LOST,
WL_DISCONNECTED,
WL_AP_LISTENING,
WL_AP_CONNECTED,
WL_AP_FAILED
} wl_status_t;

/* Encryption modes */
@@ -27,15 +38,14 @@ enum wl_enc_type {
ENC_TYPE_WPA3,
ENC_TYPE_NONE,
ENC_TYPE_AUTO,

ENC_TYPE_UNKNOWN = 255
};

typedef enum {
WL_PING_DEST_UNREACHABLE = -1,
WL_PING_TIMEOUT = -2,
WL_PING_UNKNOWN_HOST = -3,
WL_PING_ERROR = -4
} wl_ping_result_t;
WL_PING_DEST_UNREACHABLE = -1,
WL_PING_TIMEOUT = -2,
WL_PING_UNKNOWN_HOST = -3,
WL_PING_ERROR = -4
}wl_ping_result_t;

#endif
6 changes: 3 additions & 3 deletions libraries/lwIpWrapper/src/CNetIf.cpp
Original file line number Diff line number Diff line change
@@ -537,17 +537,17 @@ int CLwipIf::getMacAddress(NetIfType_t type, uint8_t* mac)
MAC.mode = WIFI_MODE_STA;
if (CEspControl::getInstance().getWifiMacAddress(MAC) == ESP_CONTROL_OK) {
CNetUtilities::macStr2macArray(mac, MAC.mac);
rv = MAC_ADDRESS_DIM;
rv = WL_MAC_ADDR_LENGTH;
}
} else if (type == NI_WIFI_SOFTAP) {
MAC.mode = WIFI_MODE_AP;
if (CEspControl::getInstance().getWifiMacAddress(MAC) == ESP_CONTROL_OK) {
CNetUtilities::macStr2macArray(mac, MAC.mac);
rv = MAC_ADDRESS_DIM;
rv = WL_MAC_ADDR_LENGTH;
}
} else {
eth_get_mac_address(mac);
rv = MAC_ADDRESS_DIM;
rv = WL_MAC_ADDR_LENGTH;
}

CLwipIf::getInstance().restartAsyncRequest();
11 changes: 9 additions & 2 deletions libraries/lwIpWrapper/src/CNetIf.h
Original file line number Diff line number Diff line change
@@ -34,14 +34,21 @@
#endif

#define MAX_SOFAT_CONNECTION_DEF 5

#define MAC_ADDRESS_DIM 6
#define NETWORK_INTERFACES_MAX_NUM 3
#define MAX_HOSTNAME_DIM 253

#define WIFI_INIT_TIMEOUT_MS 10000

// Maximum size of a SSID
#define WL_SSID_MAX_LENGTH 32
// Length of passphrase. Valid lengths are 8-63.
#define WL_WPA_KEY_MAX_LENGTH 63
// Length of key in bytes. Valid values are 5 and 13.
#define WL_WEP_KEY_MAX_LENGTH 13
// Size of a MAC-address or BSSID
#define WL_MAC_ADDR_LENGTH 6
// Size of a IP4 address
#define WL_IPV4_LENGTH 4

/* DEFAULT ADDRESS FOR ETHERNET CONFIGURATION */