#embedded/wifi/session
Xu 0.13.1 API
import: #embedded/wifi/session
counts: 11 functions, 0 methods, 4 types, 0 constants, 0 method sets
One owning station session, carried by the device rather than mutable package globals. The hardware backend exclusively mutates this context.
struct Keys
pub struct Keys {
pub valid bool
pub tk string
pub gtk string
pub gtk_index int
pub tx_pn string
pub rx_unicast []string
pub rx_group []string
}
Purpose
One owning station session, carried by the device rather than mutable package globals. The hardware backend exclusively mutates this context.
Public fields
valid bool- field (bool)
tk string- field (string)
gtk string- field (string)
gtk_index int- field (int)
tx_pn string- field (string)
rx_unicast []string- field ([]string)
rx_group []string- field ([]string)
struct Datagram
pub struct Datagram {
pub source string
pub payload string
}
Purpose
Structure encapsulating source, payload.
Public fields
source string- field (string)
payload string- field (string)
struct TcpInbox
pub struct TcpInbox {
pub port int
pub peer string
pub mac string
pub packets []Datagram
}
Purpose
Structure encapsulating port, peer, mac, packets.
Public fields
port int- port
peer string- field (string)
mac string- field (string)
packets []Datagram- field ([]Datagram)
empty_tcp
pub fn empty_tcp() TcpInbox
Purpose
Empty TCP.
Parameters
No arguments are required.
Returns
TcpInbox — a value of this type
struct State
pub struct State {
pub ready bool
pub linked bool
pub status int
pub error int
pub mac string
pub channel int
pub ap wifi.StationAp
pub ap_rsn string
pub handshake wifi.Wpa2Handshake
pub keys Keys
pub client ipv4.Client
pub sequence int
pub rx_cursor int
pub rx_tail int
pub rx_pending []string
pub lease_clock int
pub lease_left string
pub gateway_mac string
pub echo_next int
pub echo_waiting int
pub echo_replies int
pub last_receive int
pub rx_packets int
pub rx_valid int
pub rx_authenticated int
pub tx_packets int
pub rx_status int
pub tcp TcpInbox
}
Purpose
Structure encapsulating ready, linked, status, error, mac.
Public fields
ready bool- field (bool)
linked bool- field (bool)
status int- field (int)
error int- field (int)
mac string- field (string)
channel int- field (int)
ap wifi.StationAp- field (wifi.StationAp)
ap_rsn string- field (string)
handshake wifi.Wpa2Handshake- field (wifi.Wpa2Handshake)
keys Keys- field (Keys)
client ipv4.Client- field (ipv4.Client)
sequence int- field (int)
rx_cursor int- field (int)
rx_tail int- field (int)
rx_pending []string- field ([]string)
lease_clock int- field (int)
lease_left string- field (string)
gateway_mac string- field (string)
echo_next int- field (int)
echo_waiting int- field (int)
echo_replies int- field (int)
last_receive int- field (int)
rx_packets int- field (int)
rx_valid int- field (int)
rx_authenticated int- field (int)
tx_packets int- field (int)
rx_status int- field (int)
tcp TcpInbox- field (TcpInbox)
copy
pub fn copy(bytes &string) string
Purpose
Execute copy.
Parameters
bytes &string- bytes (read-only borrow; caller keeps the original; type &string)
Returns
string — result string
empty_keys
Purpose
Empty keys.
Parameters
No arguments are required.
Returns
Keys — a value of this type
fresh_keys
Purpose
Fresh keys.
Parameters
No arguments are required.
Returns
Keys — a value of this type
create
Purpose
Create a new file, directory, or resource.
Parameters
No arguments are required.
Returns
State — a value of this type
capture_tcp
pub fn capture_tcp(state $&State, frame &string, payload &string)
Purpose
A bounded selection filter, after link authentication. TCP validation and application handlers run later, outside the radio's CCMP receive frame.
Parameters
state $&State- state (exclusive borrow; may modify the original; type $&State)
frame &string- frame (read-only borrow; caller keeps the original; type &string)
payload &string- payload (read-only borrow; caller keeps the original; type &string)
Returns
This call does not return a value.
take_tcp
pub fn take_tcp(state $&State) Datagram
Purpose
Take TCP.
Parameters
state $&State- state (exclusive borrow; may modify the original; type $&State)
Returns
Datagram — a value of this type
leased
pub fn leased(state &State) bool
Purpose
Execute leased.
Parameters
state &State- state (read-only borrow; caller keeps the original; type &State)
Returns
bool — true or false
ip_text
pub fn ip_text(ip &string) string
Purpose
IP text.
Parameters
ip &string- ip (read-only borrow; caller keeps the original; type &string)
Returns
string — result string
elapsed
pub fn elapsed(now int, before int) int
Purpose
Milliseconds modulo 2^31, matching the backend's free-running timer. Service intervals must be shorter than half the range.
Parameters
now int- now (int)
before int- before (int)
Returns
int — a value of this type
lease_tick
pub fn lease_tick(left &string, seconds int) string
Purpose
Lease seconds are unsigned big-endian bytes, including on 32-bit targets. Return a fresh countdown, or empty when the local validity budget expires.
Parameters
left &string- left (read-only borrow; caller keeps the original; type &string)
seconds int- seconds (int)
Returns
string — result string