WiFi specific functions

These are functions that can be used only with WiFi supported hardware and are considered as UPI candidates.

Submodules

Network fucntions

wishful_upis.wifi.net.DOT_80211_MODE = Attribute(key=DOT_80211_MODE, type=<type 'int'>, isReadonly=False)

Mode of device: STA, AP, P2P, MESH, AD-HOC

wishful_upis.wifi.net.DOT_80211_STA_BLACKLIST = Attribute(key=DOT_80211_STA_BLACKLIST, type=<type 'str'>, isReadonly=False)

List of MAC addressed of blacklisted STAs

wishful_upis.wifi.net.DOT_80211_STA_TX_POWER = Attribute(key=DOT_80211_STA_TX_POWER, type=<type 'int'>, isReadonly=False)

Per STA TX power

wishful_upis.wifi.net.DOT_80211_AP_NUMBER = Measurement(key=DOT_80211_STA_NUMBER, type=<type 'int'>)

Number of APs in communication range

wishful_upis.wifi.net.DOT_80211_STA_NUMBER = Measurement(key=DOT_80211_STA_NUMBER, type=<type 'int'>)

Number of STAs in communication range

wishful_upis.wifi.net.DOT_80211_SEEN_SSIDS = Measurement(key=DOT_80211_SEEN_SSIDS, type=<type 'str'>)

List of SSIDs seen in communication range

wishful_upis.wifi.net.DOT_80211_CONNECTED_STA_NUMBER = Measurement(key=DOT_80211_CONNECTED_STA_NUMBER, type=<type 'int'>)

Number of connected STAs to AP

wishful_upis.wifi.net.DOT_80211_STA_RSSI = Measurement(key=DOT_80211_STA_RSSI, type=<type 'str'>)

Per-STA RSSI

wishful_upis.wifi.net.DOT_80211_STA_TX_BITRATE = Measurement(key=DOT_80211_STA_TX_BITRATE, type=<type 'str'>)

Per-STA bitrate

wishful_upis.wifi.net.DOT_80211_STA_TX_BYTES = Measurement(key=DOT_80211_STA_TX_BYTES, type=<type 'str'>)

Per-STA TX bytes

wishful_upis.wifi.net.DOT_80211_STA_TX_PKTS = Measurement(key=DOT_80211_STA_TX_PKTS, type=<type 'str'>)

Per-STA TX packets

wishful_upis.wifi.net.DOT_80211_STA_RX_BYTES = Measurement(key=DOT_80211_STA_RX_BYTES, type=<type 'str'>)

Per-STA RX bytes

wishful_upis.wifi.net.DOT_80211_STA_RX_PKTS = Measurement(key=DOT_80211_STA_RX_PKTS, type=<type 'str'>)

Per-STA RX packets

wishful_upis.wifi.net.DOT_80211_STA_INACTIVE_TIME = Measurement(key=DOT_80211_STA_INACTIVE_TIME, type=<type 'str'>)

Per-STA inactivity time

wishful_upis.wifi.net.DOT_80211_STA_RETRY_NUM = Measurement(key=DOT_80211_STA_RETRY_NUM, type=<type 'str'>)

Per-STA TX retries number

wishful_upis.wifi.net.DOT_80211_STA_TX_FAILED = Measurement(key=DOT_80211_STA_TX_FAILED, type=<type 'str'>)

Per-STA number of failed transmissions

wishful_upis.wifi.net.DOT_80211_PROBE_REQUEST = Event(key=DOT_80211_PROBE_REQUEST, type=None)

Event triggered on Probe Request reception

wishful_upis.wifi.net.DOT_80211_STA_CONNECTED = Event(key=DOT_80211_STA_CONNECTED, type=None)

Event triggered on STA connection to AP

wishful_upis.wifi.net.DOT_80211_STA_DISCONNECTED = Event(key=DOT_80211_STA_DISCONNECTED, type=None)

Event triggered on STA disconnection from AP

wishful_upis.wifi.net.DOT_80211_STA_LOSS = Event(key=DOT_80211_STA_LOSS, type=None)

Event triggered when STA lost connection with AP

wishful_upis.wifi.net.DOT_80211_SCAN = Action(key=DOT_80211_SCAN, args_types=<type 'int'>, return_type=<type 'bool'>)

Perform scanning

wishful_upis.wifi.net.DOT_80211_CONNECT = Action(key=DOT_80211_CONNECT, args_types=<type 'str'>, return_type=<type 'bool'>)

Connect to network by SSID

wishful_upis.wifi.net.DOT_80211_DISCONNECT = Action(key=DOT_80211_DISCONNECT, args_types=<type 'str'>, return_type=<type 'bool'>)

Disconnect from network

wishful_upis.wifi.net.set_hostapd_conf(iface, file_path, channel, essid)[source]

Set hostapd configuration, provide functionality to setting Access Point station

wishful_upis.wifi.net.start_hostapd(file_path)[source]

Start hostapd, provide functionality to run Access Point

wishful_upis.wifi.net.stop_hostapd()[source]

Stop hostapd, provide functionality to stop Access Point

wishful_upis.wifi.net.connect_to_network(iface, ssid)[source]

Connects a given interface to some network

e.g. WiFi network identified by SSID.

wishful_upis.wifi.net.network_dump(iface)[source]

Return the connection information a given interface to some network

wishful_upis.wifi.net.add_device_to_blacklist(iface, device_mac_addr)[source]

Add the given device to the blacklist

  • 802.11 AP: the device is a client and the result of blacklisting is that the client cannot associate with this node.
  • Other??
wishful_upis.wifi.net.remove_device_from_blacklist(iface, device_mac_addr)[source]

Remove the given device from the blacklist

  • 802.11 AP: the device is a client and the result of unblacklisting is that the client can associate with this node.
  • Other??
wishful_upis.wifi.net.disconnect_device(iface, device_mac_addr)[source]

Disconnects the given device from this node

  • 802.11 AP: send dissassociation request to client device
  • 802.11 adhoc: no meaning
  • Other?
wishful_upis.wifi.net.register_new_device(iface, sta_mac_addr)[source]

Register the given device

  • 802.11 AP: the device is associated with this AP.
  • Other??
wishful_upis.wifi.net.trigger_channel_switch_in_device(iface, device_mac_addr, target_channel, serving_channel, **kwargs)[source]

Trigger a channel switch in the device connected to this node

  • 802.11 AP: send channel switch announcement to client STA,
  • other??
wishful_upis.wifi.net.get_info_of_connected_devices()[source]

Returns information about associated devices

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_inactivity_time_of_connected_devices()[source]

Returns information about associated devices - inactivity time

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_avg_sigpower_of_connected_devices()[source]

Returns information about associated devices - link average signal power

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_sigpower_of_connected_devices()[source]

Returns information about associated devices - link signal power

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_tx_retries_of_connected_devices()[source]

Returns information about associated devices - tx retries

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_tx_packets_of_connected_devices()[source]

Returns information about associated devices - tx packets

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_tx_failed_of_connected_devices()[source]

Returns information about associated devices - tx failed

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_tx_bytes_of_connected_devices()[source]

Returns information about associated devices - tx bytes

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_tx_bitrate_of_connected_devices()[source]

Returns information about associated devices - tx bitrate

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_rx_bytes_of_connected_devices()[source]

Returns information about associated devices - rx bytes

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_rx_packets_of_connected_devices()[source]

Returns information about associated devices - rx packets

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_authorized_connected_device()[source]

Returns information about associated devices - is authorized

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_authenticated_connected_device()[source]

Returns information about associated devices - is authenticated

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_used_preamble_connected_device()[source]

Returns information about associated devices - preamble used

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_mfp_connected_device()[source]

Returns information about associated devices - MFP

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_wmm_wme_connected_device()[source]

Returns information about associated devices - WMM/WME

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??
wishful_upis.wifi.net.get_tdls_peer_connected_device()[source]

Returns information about associated devices - TDLS peer

  • 802.11 AP: info about the associated client devices of that AP.
  • Other??

Radio functions

wishful_upis.wifi.radio.DOT_80211_PHY_ANI = Attribute(key=DOT_80211_PHY_ANI, type=<type 'int'>, isReadonly=False)

Adaptive Noise Immunity (ANI)

wishful_upis.wifi.radio.DOT_80211_STANDARDS = Attribute(key=DOT_80211_STANDARDS, type=<type 'int'>, isReadonly=False)

Supported 802.11 standards

wishful_upis.wifi.radio.DOT_80211_PHY_CHANNEL = Attribute(key=DOT_80211_PHY_CHANNEL, type=<type 'int'>, isReadonly=False)

PHY channel

wishful_upis.wifi.radio.DOT_80211_PHY_RATE = Attribute(key=DOT_80211_PHY_RATE, type=<type 'int'>, isReadonly=False)

Rate index value

wishful_upis.wifi.radio.DOT_80211_PHY_MCS = Attribute(key=DOT_80211_PHY_MCS, type=<type 'int'>, isReadonly=False)

Modulation and Coding Scheme (MCS) index value

wishful_upis.wifi.radio.DOT_80211_PHY_CCA = Attribute(key=DOT_80211_PHY_CCA, type=<type 'int'>, isReadonly=False)

Clear channel assessment (CCA) threshold

wishful_upis.wifi.radio.DOT_80211_RTS_CTS_THRESHOLD = Attribute(key=DOT_80211_RTS_CTS_THRESHOLD, type=<type 'int'>, isReadonly=False)
wishful_upis.wifi.radio.DOT_80211_FRAGMENTATION_THRESHOLD = Attribute(key=DOT_80211_RTS_CTS_THRESHOLD, type=<type 'int'>, isReadonly=False)
wishful_upis.wifi.radio.DOT_80211_RETRY_SHORT = Attribute(key=DOT_80211_RETRY_SHORT, type=<type 'int'>, isReadonly=False)

Retry short is the number of transmission attempts before change the modulation rate

wishful_upis.wifi.radio.DOT_80211_RETRY_LONG = Attribute(key=DOT_80211_RETRY_LONG, type=<type 'int'>, isReadonly=False)

Retry short is the number of transmission attempts after change the modulation rate

wishful_upis.wifi.radio.DOT_80211_MAC_STATE_SAMPLING_INTERVAL = Attribute(key=DOT_80211_MAC_STATE_SAMPLING_INTERVAL, type=<type 'int'>, isReadonly=False)

MAC state sampling interval in ms

wishful_upis.wifi.radio.DOT_80211_MAC_EDCA_AIFS = Attribute(key=DOT_80211_MAC_EDCA_AIFS, type=<type 'int'>, isReadonly=False)

EDCA Arbitrated Interframe Space value

wishful_upis.wifi.radio.DOT_80211_MAC_EDCA_CW_MIN = Attribute(key=DOT_80211_MAC_EDCA_CW_MIN, type=<type 'int'>, isReadonly=False)

EDCA Contention Window Min value

wishful_upis.wifi.radio.DOT_80211_MAC_EDCA_CW_MAX = Attribute(key=DOT_80211_MAC_EDCA_CW_MAX, type=<type 'int'>, isReadonly=False)

EDCA Contention Window Max value

wishful_upis.wifi.radio.DOT_80211_MAC_EDCA_TX_OP = Attribute(key=DOT_80211_MAC_EDCA_TX_OP, type=<type 'int'>, isReadonly=False)

EDCA Transmit Opportunity value

wishful_upis.wifi.radio.DOT_80211_PHY_REGURATORY_DOMAIN = Attribute(key=DOT_80211_PHY_REGURATORY_DOMAIN, type=<type 'str'>, isReadonly=False)

Reguratory domain information

wishful_upis.wifi.radio.DOT_80211_POWER_MANAGEMENT = Attribute(key=DOT_80211_POWER_MANAGEMENT, type=<type 'int'>, isReadonly=False)

Power Managemenet Scheme: Fixed, Auto

wishful_upis.wifi.radio.DOT_80211_MAC_STATE_IDLE_TIME = Measurement(key=DOT_80211_MAC_STATE_IDLE_TIME, type=<type 'int'>)

Time MAC spent in idle state in last sampling interval

wishful_upis.wifi.radio.DOT_80211_MAC_STATE_IDLE_RATIO = Measurement(key=DOT_80211_MAC_STATE_IDLE_RATIO, type=<type 'float'>)

Ratio of time that MAC spent in idle state in last sampling interval

wishful_upis.wifi.radio.DOT_80211_MAC_STATE_BUSY_TIME = Measurement(key=DOT_80211_MAC_STATE_BUSY_TIME, type=<type 'int'>)

Time MAC spent in busy state in last sampling interval

wishful_upis.wifi.radio.DOT_80211_MAC_STATE_BUSY_RATIO = Measurement(key=DOT_80211_MAC_STATE_BUSY_RATIO, type=<type 'float'>)

Ratio of time that MAC spent in busy state in last sampling interval

wishful_upis.wifi.radio.DOT_80211_MAC_STATE_TX_TIME = Measurement(key=DOT_80211_MAC_STATE_TX_TIME, type=<type 'int'>)

Time MAC spent in TX state in last sampling interval

wishful_upis.wifi.radio.DOT_80211_MAC_STATE_TX_RATIO = Measurement(key=DOT_80211_MAC_STATE_TX_RATIO, type=<type 'float'>)

Ratio of time that MAC spent in TX state in last sampling interval

wishful_upis.wifi.radio.DOT_80211_MAC_STATE_RX_TIME = Measurement(key=DOT_80211_MAC_STATE_RX_TIME, type=<type 'int'>)

Time MAC spent in RX state in last sampling interval

wishful_upis.wifi.radio.DOT_80211_MAC_STATE_RX_RATIO = Measurement(key=DOT_80211_MAC_STATE_RX_RATIO, type=<type 'float'>)

Ratio of time that MAC spent in RX state in last sampling interval

wishful_upis.wifi.radio.DOT_80211_MAC_STATE_ED_TIME = Measurement(key=DOT_80211_MAC_STATE_ED_TIME, type=<type 'int'>)

Time MAC spent in energy detection state in last sampling interval

wishful_upis.wifi.radio.DOT_80211_MAC_STATE_ED_RATIO = Measurement(key=DOT_80211_MAC_STATE_ED_RATIO, type=<type 'float'>)

Ratio of time that MAC spent in energy detection state in last sampling interval

wishful_upis.wifi.radio.DOT_80211_MAC_STA_AIR_TIME = Measurement(key=DOT_80211_MAC_STA_AIR_TIME, type=<type 'float'>)

Per STA air-time statistics

Per STA link informations

wishful_upis.wifi.radio.DOT_80211_DATA_FRAME_LOSS = Event(key=DOT_80211_DATA_FRAME_LOSS, type=None)

Notify about data frame loss

wishful_upis.wifi.radio.DOT_80211_CONTROL_FRAME_LOSS = Event(key=DOT_80211_CONTROL_FRAME_LOSS, type=None)

Notify about control frame loss

wishful_upis.wifi.radio.DOT_80211_MGMT_FRAME_LOSS = Event(key=DOT_80211_MGMT_FRAME_LOSS, type=None)

Notify about management frame loss

wishful_upis.wifi.radio.DOT_80211_SWITCH_CHANNEL = Action(key=DOT_80211_SWITCH_CHANNEL, args_types=<type 'int'>, return_type=<type 'bool'>)

Trigger channel switch to new channel

wishful_upis.wifi.radio.DOT_80211_INJECT_L2_FRAME = Action(key=DOT_80211_INJECT_MGMT_FRAME, args_types=<type 'str'>, return_type=<type 'bool'>)

Inject L2 frame in hex format

wishful_upis.wifi.radio.DOT_80211_SNIFF_L2_FRAMES = Action(key=DOT_80211_SNIFF_L2_FRAMES, args_types=<type 'int'>, return_type=<type 'bool'>)

Sniff N L2 frames

wishful_upis.wifi.radio.set_mac_access_parameters(queueId, qParam)[source]

MAC access parameters in 802.11e: the configuration of the access categories

wishful_upis.wifi.radio.get_mac_access_parameters(queueId)[source]

MAC access parameters: in 802.11e: the configuration of the access categories

wishful_upis.wifi.radio.get_airtime_utilization()[source]

Returns the relative time the spectrum is empty.

wishful_upis.wifi.radio.perform_spectral_scanning(iface, freq_list, mode)[source]

Perform spectral scanning.

Returns:
Power value for each frequency bin.
wishful_upis.wifi.radio.set_channel(channel)[source]

Set channel, i.e. center frequency of the primary band.

Args:
channel: channel to set
wishful_upis.wifi.radio.get_channel()[source]

Get channel, i.e. center frequency of the primary band.

wishful_upis.wifi.radio.set_modulation_rate(rate_Mbps)[source]

Set rate modulation

wishful_upis.wifi.radio.configure_radio_sensitivity(phy_dev, **kwargs)[source]

Configuring the receiving sensitivity of the IEEE 802.11 radio.

wishful_upis.wifi.radio.set_per_flow_tx_power(flowId, txPower)[source]

Sets for a flow identified by an 5-tuple (IP header) the transmit power to be used.

wishful_upis.wifi.radio.clean_per_flow_tx_power_table()[source]

Remove any entries in the transmit power table.

wishful_upis.wifi.radio.get_per_flow_tx_power(flowId)[source]

Return the transmit power level used for the given flow.

wishful_upis.wifi.radio.get_per_flow_tx_power_table()[source]

Return the whole transmit power table.

wishful_upis.wifi.radio.install_mac_processor(interface, mac_profile)[source]

Install new WiFi MAC Processor

wishful_upis.wifi.radio.update_mac_processor(interface, mac_profile)[source]

Update WiFi MAC Processor

wishful_upis.wifi.radio.uninstall_mac_processor(interface, mac_profile)[source]

Uninstall WiFi MAC Processor

wishful_upis.wifi.radio.receive_csi(runt)[source]

Receives CSI samples from the ath9k driver.

wishful_upis.wifi.radio.scan_psd(runt)[source]

Receives PSD samples from the ath9k driver.

“Network OS” helpers

wishful_upis.wifi.net_func.perform_handover(interface, servingNode, targetNode, device_mac_addr, **kwargs)[source]

Performing an handover operation.

Note: this is not supported on any wireless technology.

  • 802.11 - in infrastructure mode an STA can be handovered; not supported in 802.11 adhoc
wishful_upis.wifi.net_func.is_associated_with(nodes, interface, device_mac_addr)[source]

Estimate the AP/BS with which a given device is associated.

Note: this is not supported on any wireless technology.

  • enabled on 802.11 infrastructure mode