wifi

package
v0.0.0-...-91df8d1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package wifi implements an interface to the WiFi coprocessor.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConnectToAP  = errors.New("failed to connect to access point")
	ErrNoIPAddress  = errors.New("could not obtain IP address from access point")
	ErrNotConnected = errors.New("not connected to access point")
)

Functions

This section is empty.

Types

type WiFi

type WiFi struct {
	// contains filtered or unexported fields
}

WiFi wraps the WiFiNINA device driver.

func New

func New() (*WiFi, error)

New returns a new WiFi using the default peripherals and GPIO pins. The SPI interface connected to the WiFi coprocessor is also initialized and configured for use. This method will always return a nil WiFi or a nil error. It will never return nil or non-nil for both WiFi and error.

func (*WiFi) Connect

func (w *WiFi) Connect(ap network.AP) error

Connect establishes an AP connection using given SSID and passphrase. An error is returned if the AP could not be reached or an IP not obtained.

func (*WiFi) GetHostByName

func (w *WiFi) GetHostByName(name string) (net.IP, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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