wifi

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
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

View Source
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 HostByName

func HostByName(hostname string, addr string) int

HostByName ...

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

func (c *Client) Connect(host string, port int) bool

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

func (c *Client) Println(data interface{}) int

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

func (c *Client) Write(data interface{}) int

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

type IPAddress

type IPAddress struct {
	A int
	B int
	C int
	D int
}

IPAddress ...

func LocalIP

func LocalIP() *IPAddress

LocalIP gets the WiFi shield's IP address. @see: https://www.arduino.cc/en/Reference/WiFiLocalIP

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL