Documentation
¶
Index ¶
- Constants
- Variables
- func BSSID() []int
- func Begin(ssid string)
- func BeginEncrypted(ssid, passphrase string)
- func Disconnect()
- func EncryptionType() int
- func HostByName(hostname string, addr string) int
- func RSSI() int
- func SSID() string
- func ScanNetworks() int
- func SetDNS(dns []int)
- func Status() int
- type Client
- type IPAddress
Constants ¶
const ( // EncryptionTypeAuto ... EncryptionTypeAuto = 8 // EncryptionTypeCCMP ... EncryptionTypeCCMP = 4 // EncryptionTypeNone ... EncryptionTypeNone = 7 // EncryptionTypeTKIP ... EncryptionTypeTKIP = 2 // EncryptionTypeWEP ... EncryptionTypeWEP = 5 // MaxSocketNum ... MaxSocketNum = 4096 // StatusConnected ... StatusConnected = 3 // StatusConnectionLost ... StatusConnectionLost = 4 // StatusConnectFailed ... StatusConnectFailed = 5 // StatusDisconnected ... StatusDisconnected = 6 // StatusIdle ... StatusIdle = 0 // StatusNoShield ... StatusNoShield = 255 // StatusNoSSIDAvailable ... StatusNoSSIDAvailable = 1 // StatusScanCompleted ... StatusScanCompleted = 2 )
Variables ¶
var ( // CurrentBSSID ... CurrentBSSID = []int{0, 0, 0, 0, 0, 0, 0, 0} // CurrentDNS ... CurrentDNS = []int{0, 0, 0, 0} // CurrentEncryptionType ... CurrentEncryptionType = 7 // CurrentGateway ... CurrentGateway = &IPAddress{127, 0, 0, 255} // CurrentLocalIP ... CurrentLocalIP = &IPAddress{127, 0, 0, 1} // CurrentNetworks ... CurrentNetworks = 0 // CurrentRSSI ... CurrentRSSI = -1 // CurrentSSID ... CurrentSSID = "" // CurrentStatus ... CurrentStatus = StatusIdle // SocketPort ... SocketPort = make(map[int]int, MaxSocketNum) // SocketState ... SocketState = make(map[int]int, MaxSocketNum) )
Functions ¶
func BSSID ¶
func BSSID() []int
BSSID gets the MAC address of the routher you are connected to. @see: https://www.arduino.cc/en/Reference/WiFiBSSID
func Begin ¶
func Begin(ssid string)
Begin initializes the WiFi library's network settings and provides the current status. @see: https://www.arduino.cc/en/Reference/WiFiBegin
func BeginEncrypted ¶
func BeginEncrypted(ssid, passphrase string)
BeginEncrypted initializes the WiFi library's network settings and provides the current status. @see: https://www.arduino.cc/en/Reference/WiFiBegin
func Disconnect ¶
func Disconnect()
Disconnect disconnects the WiFi shield from the current network. @see: https://www.arduino.cc/en/Reference/WiFiDisconnect
func EncryptionType ¶
func EncryptionType() int
EncryptionType gets the encryption type of the current network. @see: https://www.arduino.cc/en/Reference/WiFiEncryptionType
func RSSI ¶
func RSSI() int
RSSI gets the signal strength of the connection to the router. @see: https://www.arduino.cc/en/Reference/WiFiRSSI
func SSID ¶
func SSID() string
SSID gets the SSID of the current network. @see: https://www.arduino.cc/en/Reference/WiFiSSID
func ScanNetworks ¶
func ScanNetworks() int
ScanNetworks scans for available WiFi networks and returns the discovered number. @see: https://www.arduino.cc/en/Reference/WiFiScanNetworks
func SetDNS ¶
func SetDNS(dns []int)
SetDNS allows you to configure the DNS (Domain Name System) server. @see: https://www.arduino.cc/en/Reference/WiFiSetDns
func Status ¶
func Status() int
Status returns the connection status. @see: https://www.arduino.cc/en/Reference/WiFiStatus
Types ¶
type Client ¶
type Client struct{}
Client ...
func (*Client) Connect ¶
Connect to the IP address and port specified in the constructor. The return value indicates success or failure. connect() also supports DNS lookups when using a domain name (ex:google.com). @see: https://www.arduino.cc/en/Reference/WiFiClientConnect
func (*Client) Println ¶
Print data, followed by a carriage return and newline, to the server a client is connected to. Prints numbers as a sequence of digits, each an ASCII character (e.g. the number 123 is sent as the three characters '1', '2', '3'). @see: https://www.arduino.cc/en/Reference/WiFiClientPrintln
func (*Client) Write ¶
Write data to the server the client is connected to. Return the number of characters written. It is not necessary to read this value. @see: https://www.arduino.cc/en/Reference/WiFiClientWrite