Documentation ¶
Index ¶
- Variables
- func DhcpServer(dhcpIf string) error
- func Schedule(ctx context.Context, p time.Duration, o time.Duration, f func(time.Time))
- func ScheduleBeacon(nanc *wifi.Nan)
- func Uint64(b net.HardwareAddr) uint64
- type BLE
- type BLENode
- type DHCPHandler
- type L2
- type WPA
- type WPANetwork
- type WifiInterface
- func (c *WifiInterface) APStart()
- func (c *WifiInterface) APStop()
- func (c *WifiInterface) AddNetwork() (int, error)
- func (c *WifiInterface) Connect(meta map[string]string, ssid, pass string) error
- func (c *WifiInterface) DisableNetwork(networkId int) error
- func (c *WifiInterface) EnableNetwork(networkId int) error
- func (c *WifiInterface) GetNetworkSetting(networkId int, variable string) (string, error)
- func (c *WifiInterface) ListNetworks() ([]*WPANetwork, error)
- func (c *WifiInterface) OnP2PGroupStart(parts []string)
- func (c *WifiInterface) OnP2PGroupStop(parts []string)
- func (c *WifiInterface) P2PDiscover()
- func (i *WifiInterface) Redial() error
- func (c *WifiInterface) ReloadConfiguration() error
- func (c *WifiInterface) RemoveNetwork(networkId int) error
- func (c *WifiInterface) SaveConfiguration() error
- func (c *WifiInterface) Scan()
- func (c *WifiInterface) SelectNetwork(networkId int) error
- func (c *WifiInterface) SendCommand(command string) (string, error)
- func (c *WifiInterface) SendCommandBool(command string) error
- func (c *WifiInterface) SendCommandInt(command string) (int, error)
- func (c *WifiInterface) SendCommandP2P(command string) (string, error)
- func (c *WifiInterface) SetNetworkSettingRaw(networkId int, variable string, value string) error
- func (c *WifiInterface) SetNetworkSettingString(networkId int, variable string, value string) error
- func (c *WifiInterface) Status() map[string]string
- func (c *WifiInterface) UpdateLoop(refresh int)
Constants ¶
This section is empty.
Variables ¶
var ( EDDYSTONE16 = []byte{0xAA, 0xFE} CH_PROXY_WRITE = []byte{0xDD, 0x2A} CH_PROXY_NOTIF = []byte{0xDE, 0x2A} )
var (
AlreadyConnected = errors.New("Already connected")
)
Functions ¶
func DhcpServer ¶
Start a DHCP server on an interface.
This is at L2 because it is used to allow local devices to communicate on the same network. Android expects an IPv4 address to establish P2P connections.
func Schedule ¶
Schedule calls function `f` with a period `p` offsetted by `o`. Aligned with the duration (fixed)
func ScheduleBeacon ¶
func Uint64 ¶
func Uint64(b net.HardwareAddr) uint64
Types ¶
type BLE ¶
type BLE struct {
// contains filtered or unexported fields
}
BLE provides L2 connectivity with other nodes supporting BLE. This uses an extension of EddyStone beacon - advertising the DMesh ID. The extension consists on using the proxy characteristics (from BLE Mesh service) to also allow packet exchange.
Has a matching Android implementation as well as ESP32. When running on Android, the BLE is implemented by the Android process using the core libraries - this is used on linux hosts.
func (*BLE) CleanOlder ¶
type BLENode ¶
type BLENode struct { msgs.MsgConnection Addr ble.Addr Name string Last time.Time // contains filtered or unexported fields }
Tracks a BLE peer.
type DHCPHandler ¶
type DHCPHandler struct {
// contains filtered or unexported fields
}
type L2 ¶
type L2 struct {
// contains filtered or unexported fields
}
func (*L2) InitBLE ¶
Requires capabilities on the binary or root Uses a AF_BLUETOOTH socket and HCI.
Creates a 'serial' connection over BLE.
type WPA ¶
type WPA struct { // P2P and normal interface are separated. // Multiple wifi interfaces supported. // TODO: ESP32 or equivalent modems connected via serial or BLE, supporting // other frequencies. Interfaces map[string]*WifiInterface // contains filtered or unexported fields }
type WPANetwork ¶
Wifi network info - list of networks registered. See wifiManager.getConfiguredNetworks(), plus get current wifi.
type WifiInterface ¶
type WifiInterface struct { // Primary interface name. Interface string // Last scan results (raw). Includes known and DIRECT networks. LastScan *mesh.L2NetStatus ScanTime time.Time // Keep track of discovered P2P devices. P2PByMAC map[string]*mesh.MeshDevice P2PBySSID map[string]*mesh.MeshDevice // contains filtered or unexported fields }
func (*WifiInterface) APStart ¶
func (c *WifiInterface) APStart()
Attempt to start P2P AP, using channel 6 if possible so NAN can work
func (*WifiInterface) APStop ¶
func (c *WifiInterface) APStop()
func (*WifiInterface) AddNetwork ¶
func (c *WifiInterface) AddNetwork() (int, error)
func (*WifiInterface) Connect ¶
func (c *WifiInterface) Connect(meta map[string]string, ssid, pass string) error
func (*WifiInterface) DisableNetwork ¶
func (c *WifiInterface) DisableNetwork(networkId int) error
func (*WifiInterface) EnableNetwork ¶
func (c *WifiInterface) EnableNetwork(networkId int) error
func (*WifiInterface) GetNetworkSetting ¶
func (c *WifiInterface) GetNetworkSetting(networkId int, variable string) (string, error)
func (*WifiInterface) ListNetworks ¶
func (c *WifiInterface) ListNetworks() ([]*WPANetwork, error)
func (*WifiInterface) OnP2PGroupStart ¶
func (c *WifiInterface) OnP2PGroupStart(parts []string)
Called as result of ...
P2P-GROUP-STARTED p2p-wlp2s0-0 GO ssid="DIRECT-JF" freq=2437 passphrase="DKAcUzpO" go_dev_addr=38:ba:f8:49:d3:c0
func (*WifiInterface) OnP2PGroupStop ¶
func (c *WifiInterface) OnP2PGroupStop(parts []string)
<3>P2P-GROUP-REMOVED p2p-wlp2s0-4 GO reason=REQUESTED
func (*WifiInterface) P2PDiscover ¶
func (c *WifiInterface) P2PDiscover()
start peer discovery with DNSSD. Events will be sent, discovery will auto-terminate Uses a hard-coded time of 6 seconds ( TODO: and override )
func (*WifiInterface) Redial ¶
func (i *WifiInterface) Redial() error
func (*WifiInterface) ReloadConfiguration ¶
func (c *WifiInterface) ReloadConfiguration() error
func (*WifiInterface) RemoveNetwork ¶
func (c *WifiInterface) RemoveNetwork(networkId int) error
func (*WifiInterface) SaveConfiguration ¶
func (c *WifiInterface) SaveConfiguration() error
func (*WifiInterface) Scan ¶
func (c *WifiInterface) Scan()
func (*WifiInterface) SelectNetwork ¶
func (c *WifiInterface) SelectNetwork(networkId int) error
func (*WifiInterface) SendCommand ¶
func (c *WifiInterface) SendCommand(command string) (string, error)
PING STATUS: address, p2p_device_address RECONNECT,REASSOCIATE p2p_group_add OK <3>P2P-GROUP-STARTED p2p-wlp2s0-0 GO ssid="DIRECT-OF" freq=2437 passphrase="5BqiXAgj" go_dev_addr=cc:2f:71:c8:f3:99 <3>P2P-SERV-DISC-REQ 2437 da:50:e6:91:5b:cb 0 22 02000117 P2P_SERV_DISC_EXTERNAL 1 -> 0 means to reject disc req, 1 to respond with ...
func (*WifiInterface) SendCommandBool ¶
func (c *WifiInterface) SendCommandBool(command string) error
func (*WifiInterface) SendCommandInt ¶
func (c *WifiInterface) SendCommandInt(command string) (int, error)
func (*WifiInterface) SendCommandP2P ¶
func (c *WifiInterface) SendCommandP2P(command string) (string, error)
func (*WifiInterface) SetNetworkSettingRaw ¶
func (c *WifiInterface) SetNetworkSettingRaw(networkId int, variable string, value string) error
func (*WifiInterface) SetNetworkSettingString ¶
func (c *WifiInterface) SetNetworkSettingString(networkId int, variable string, value string) error
func (*WifiInterface) Status ¶
func (c *WifiInterface) Status() map[string]string
func (*WifiInterface) UpdateLoop ¶
func (c *WifiInterface) UpdateLoop(refresh int)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package nl80211 is an auto-generated package which contains constants and types used to access nl80211 information using generic netlink.
|
Package nl80211 is an auto-generated package which contains constants and types used to access nl80211 information using generic netlink. |