XU XUv0.13.1
EN

#embedded/wifi/session

导入方式: #embedded/wifi/session

公开 API: 11 函数, 0 方法, 4 类型, 0 常量, 0 方法集

标准库包 `#embedded/wifi/session`。

struct Keys

XuAPI
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
}

用途

承载 valid、tk、gtk、gtk_index、tx_pn 等属性的结构体。

公开字段

valid bool
字段(bool)
tk string
字段(string)
gtk string
字段(string)
gtk_index int
字段(int)
tx_pn string
字段(string)
rx_unicast []string
字段([]string)
rx_group []string
字段([]string)

struct Datagram

XuAPI
pub struct Datagram {
    pub source string
    pub payload string
}

用途

承载 source、payload 等属性的结构体。

公开字段

source string
字段(string)
payload string
字段(string)

struct TcpInbox

XuAPI
pub struct TcpInbox {
    pub port int
    pub peer string
    pub mac string
    pub packets []Datagram
}

用途

承载 port、peer、mac、packets 等属性的结构体。

公开字段

port int
端口
peer string
字段(string)
mac string
字段(string)
packets []Datagram
字段([]Datagram)

empty_tcp

XuAPI
pub fn empty_tcp() TcpInbox

用途

执行 empty tcp 操作。

参数

无需传入参数。

返回值

TcpInbox — 该类型的值

struct State

XuAPI
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
}

用途

承载 ready、linked、status、error、mac 等属性的结构体。

公开字段

ready bool
字段(bool)
linked bool
字段(bool)
status int
字段(int)
error int
字段(int)
mac string
字段(string)
channel int
字段(int)
ap wifi.StationAp
字段(wifi.StationAp)
ap_rsn string
字段(string)
handshake wifi.Wpa2Handshake
字段(wifi.Wpa2Handshake)
keys Keys
字段(Keys)
client ipv4.Client
字段(ipv4.Client)
sequence int
字段(int)
rx_cursor int
字段(int)
rx_tail int
字段(int)
rx_pending []string
字段([]string)
lease_clock int
字段(int)
lease_left string
字段(string)
gateway_mac string
字段(string)
echo_next int
字段(int)
echo_waiting int
字段(int)
echo_replies int
字段(int)
last_receive int
字段(int)
rx_packets int
字段(int)
rx_valid int
字段(int)
rx_authenticated int
字段(int)
tx_packets int
字段(int)
rx_status int
字段(int)
tcp TcpInbox
字段(TcpInbox)

copy

XuAPI
pub fn copy(bytes &string) string

用途

拷贝。

参数

bytes &string
bytes(只读借用,调用方仍持有原值;类型 &string)

返回值

string — 结果字符串

empty_keys

XuAPI
pub fn empty_keys() Keys

用途

执行 empty keys 操作。

参数

无需传入参数。

返回值

Keys — 该类型的值

fresh_keys

XuAPI
pub fn fresh_keys() Keys

用途

执行 fresh keys 操作。

参数

无需传入参数。

返回值

Keys — 该类型的值

create

XuAPI
pub fn create() State

用途

创建新的文件、目录或资源。

参数

无需传入参数。

返回值

State — 该类型的值

capture_tcp

XuAPI
pub fn capture_tcp(state $&State, frame &string, payload &string)

用途

执行 capture tcp 操作。

参数

state $&State
state(独占借用,可修改原值;类型 $&State)
frame &string
frame(只读借用,调用方仍持有原值;类型 &string)
payload &string
payload(只读借用,调用方仍持有原值;类型 &string)

返回值

不返回值。

take_tcp

XuAPI
pub fn take_tcp(state $&State) Datagram

用途

执行 take tcp 操作。

参数

state $&State
state(独占借用,可修改原值;类型 $&State)

返回值

Datagram — 该类型的值

leased

XuAPI
pub fn leased(state &State) bool

用途

执行 leased 处理。

参数

state &State
state(只读借用,调用方仍持有原值;类型 &State)

返回值

bool — 是否成立

ip_text

XuAPI
pub fn ip_text(ip &string) string

用途

执行 ip text 操作。

参数

ip &string
ip(只读借用,调用方仍持有原值;类型 &string)

返回值

string — 结果字符串

elapsed

XuAPI
pub fn elapsed(now int, before int) int

用途

执行 elapsed 处理。

参数

now int
now(int)
before int
before(int)

返回值

int — 该类型的值

lease_tick

XuAPI
pub fn lease_tick(left &string, seconds int) string

用途

执行 lease tick 操作。

参数

left &string
left(只读借用,调用方仍持有原值;类型 &string)
seconds int
seconds(int)

返回值

string — 结果字符串