mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-19 08:52:15 +01:00
Add overloads of begin()-Add IpAddress class
This commit is contained in:
parent
58fb458101
commit
9d60bbb0dc
78
WiFi/WiFi.h
78
WiFi/WiFi.h
@ -9,24 +9,10 @@ extern "C" {
|
|||||||
#include "utility/debug.h" // only for test, not released
|
#include "utility/debug.h" // only for test, not released
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "IPAddress.h"
|
||||||
#include "Client.h"
|
#include "Client.h"
|
||||||
#include "Server.h"
|
#include "Server.h"
|
||||||
|
|
||||||
// location in EEPROM to store key information
|
|
||||||
#define EE_WIFI_DATA_ADDR 0x10
|
|
||||||
#define EE_WIFI_SSID_LEN EE_WIFI_DATA_ADDR
|
|
||||||
#define EE_WIFI_ENC_TYPE EE_WIFI_SSID_LEN + 1
|
|
||||||
#define EE_WIFI_KEY_LEN EE_WIFI_ENC_TYPE + 1
|
|
||||||
#define EE_WIFI_SSID_DATA EE_WIFI_KEY_LEN + 1
|
|
||||||
#define EE_WIFI_KEY_DATA EE_WIFI_SSID_DATA + WL_SSID_MAX_LENGTH
|
|
||||||
#define EE_WIFI_END_DATA EE_WIFI_KEY_DATA + WL_KEY_MAX_LENGTH
|
|
||||||
|
|
||||||
// Wifi Encryption selection type
|
|
||||||
#define WIFI_ENC_NONE 0
|
|
||||||
#define WIFI_ENC_WEP 1
|
|
||||||
#define WIFI_ENC_WPA 2
|
|
||||||
|
|
||||||
|
|
||||||
class WiFiClass
|
class WiFiClass
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@ -47,59 +33,51 @@ public:
|
|||||||
|
|
||||||
WiFiClass();
|
WiFiClass();
|
||||||
|
|
||||||
// Start Wifi connection
|
// Start Wifi connection with latest settings
|
||||||
void begin();
|
int begin();
|
||||||
|
|
||||||
// Set SSID name
|
// Start Wifi connection with no encryption
|
||||||
void setSSID(char* ssid);
|
int begin(char* ssid, uint8_t ssid_len);
|
||||||
|
|
||||||
// Set the encryption type: WPA, WEP or NONE
|
// Start Wifi connection with WEP encryption
|
||||||
void setEncryption(uint8_t encType);
|
int begin(char* ssid, uint8_t ssid_len, uint8_t key_idx, const char* key, const uint8_t key_len);
|
||||||
|
|
||||||
// Set the key used for the encryption
|
// Start Wifi connection with passphrase
|
||||||
void setPassword(const char *key, const uint8_t keyLen, uint8_t keyIndex);
|
// the most secure supported mode will be automatically selected
|
||||||
|
int begin(char* ssid, uint8_t ssid_len, const char *passphrase, const uint8_t len);
|
||||||
//getSock get the first socket available
|
|
||||||
static uint8_t getSocket();
|
|
||||||
|
|
||||||
// verify the completion of the scan command
|
|
||||||
wl_status_t getScanCmdStatus();
|
|
||||||
|
|
||||||
// get the result of the last operation
|
|
||||||
uint8_t getResult(uint8_t dummy = 0);
|
|
||||||
|
|
||||||
// Disconnect from the network
|
// Disconnect from the network
|
||||||
uint8_t disconnect(void);
|
int disconnect(void);
|
||||||
|
|
||||||
//Get the interface MAC address.
|
//Get the interface MAC address.
|
||||||
uint8_t* getMacAddr();
|
uint8_t* macAddress();
|
||||||
|
|
||||||
//Get the DHCP information related to IP
|
//Get the DHCP information related to IP
|
||||||
uint8_t* getIpAddr();
|
IPAddress localIp();
|
||||||
|
|
||||||
//Get the DHCP information related to IP
|
//Get the DHCP information related to subnetMask
|
||||||
uint8_t* getNetMask();
|
IPAddress subnetMask();
|
||||||
|
|
||||||
//Get the DHCP information related to IP
|
//Get the DHCP information related to gateway IP
|
||||||
uint8_t* getGatewayIp();
|
IPAddress gatewayIP();
|
||||||
|
|
||||||
// Return SSID item available
|
|
||||||
char* getSSIDListItem(uint8_t ssidListItem);
|
|
||||||
|
|
||||||
// Return the number of SSID discovered
|
|
||||||
uint8_t getSSIDListNum();
|
|
||||||
|
|
||||||
// Return the current SSID associated with the network
|
// Return the current SSID associated with the network
|
||||||
char* getSSID();
|
char* SSID();
|
||||||
|
|
||||||
// Return the current BSSID associated with the network
|
// Return the current BSSID associated with the network
|
||||||
uint8_t* getBSSID();
|
uint8_t* BSSID();
|
||||||
|
|
||||||
// Return the current RSSI associated with the network
|
// Start scan SSIDs available and return the number of SSID discovered
|
||||||
int32_t getRSSI();
|
uint8_t scanSSID();
|
||||||
|
|
||||||
|
// Return SSID item available
|
||||||
|
char* SSIDListItem(uint8_t ssidListItem);
|
||||||
|
|
||||||
// Return the current Encryption Type associated with the network
|
// Return the current Encryption Type associated with the network
|
||||||
uint8_t getCurrEncType();
|
uint8_t encType(uint8_t ssidListItem);
|
||||||
|
|
||||||
|
// Return the current RSSI /Received Signal Strength in dBm) associated with the network
|
||||||
|
int32_t RSSI(uint8_t ssidListItem);
|
||||||
|
|
||||||
friend class Client;
|
friend class Client;
|
||||||
friend class Server;
|
friend class Server;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user