esptest.network.nic module

class esptest.network.nic.Nic(iface)[source]

Bases: object

Parameters:

iface (str)

reset_nic()[source]
Return type:

None

iface_up(sudo=True)[source]
Parameters:

sudo (bool)

Return type:

None

iface_down(sudo=True)[source]
Parameters:

sudo (bool)

Return type:

None

dhcp_start(sudo=True)[source]
Parameters:

sudo (bool)

Return type:

None

static kill_wpa_supplicant()[source]
Return type:

None

send(packet, count, inter, verbose=False)[source]
start_capture(**kwargs)[source]
stop_capture(join=True)[source]
class esptest.network.nic.WiFiNic(iface)[source]

Bases: Nic

Parameters:

iface (str)

reset_nic()[source]
Return type:

None

static get_phy_info(phy, country='')[source]
Parameters:
Return type:

str

property phy_info: str
property supported_modes: List[str]
is_ap_supported()[source]
Return type:

bool

is_he_supported()[source]
Return type:

bool

property channels: Dict[str, Set[int]]
property send_channels: List[int]
property capture_channels: List[int]
iw_set_type(if_type)[source]

Set interface type: managed, monitor, etc…

Parameters:

if_type (str)

Return type:

None

set_channel(channel, bw='')[source]

Start wifi nic channel, bw can be [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]

Parameters:
Return type:

None

set_rate(rate, short_gi=False)[source]
Parameters:
Return type:

None

nic_ready(channel, rate=0, short_gi=False, bw='')[source]
Parameters:
Return type:

None

monitor_ready(channel, bw='')[source]

Start wifi nic to monitor mode

Parameters:
  • channel (int) – monitor channel to set

  • bw (str, optional) – [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]. Defaults to ‘HT20’.

Return type:

None

static iw_dev()[source]

List all network interfaces for wireless hardware.

Return type:

str

static set_country_code(country_code='')[source]

Need set country before get full supported channels

Parameters:

country_code (str)

Return type:

None

static iw_reg_get()[source]

Print out the kernel’s current regulatory domain information.

Return type:

str

static get_region_global()[source]

get global country

Return type:

str

static get_region_self_managed()[source]
Return type:

str

classmethod parse_phy_interfaces()[source]
Return type:

Dict[str, str]

classmethod get_wlan_interfaces()[source]
Return type:

List[str]

classmethod get_tx_and_rx_iface_pair(channel, country='')[source]

Get a pair of interface for send/monitor

Parameters:
Return type:

Tuple[str, str]

classmethod get_first_interface(mode, channel=0, country='')[source]

Get interface, mode: ap, send, capture, he

Parameters:
Return type:

str