Using Wi-Fi with io-pkt

When you're connecting to a Wireless Network in the QNX Neutrino RTOS, the first step that you need to do is to start the stack process with the appropriate driver for the installed hardware.

For information on the available drivers, see the devnp-* entries in the Utilities Reference. For this example, we'll use the fictitious driver. After a default installation, all driver binaries are installed under the staging directory /cpu/lib/dll.

Note: The io-pkt-v4 stack variant doesn't have the 802.11 layer built in, and therefore you can't use it with Wi-Fi drivers. If you attempt to load a Wi-Fi driver into io-pkt-v4, you'll see a number of unresolved symbol errors, and the driver won't work.

In this example, start the stack using one of these commands:

If the network driver is installed in a location other than /lib/dll, you'll need to specify the full path and filename of the driver on the command line.

Once you've started the stack and appropriate driver, you need to determine what wireless networks are available. If you already have the name (SSID or Service Set Identifier) of the network you want to join, you can skip these steps. You can also use these steps to determine if the network you wish to join is within range and active:

  1. To determine which wireless networks are available to join, you must first set the interface status to up:
    ifconfig abc0 up
  2. Check to see which wireless networks have advertised themselves:
    wlanctl abc0

    This command lists the available networks and their configurations. You can use this information to determine the network name (SSID), its mode of operation (ad hoc or infrastructure mode), and radio channel, for example.

  3. You can also force a manual scan of the network with this command:
    ifconfig abc0 scan

    This will cause the wireless adapter to scan for WAP stations or ad hoc nodes within range of the wireless adapter, and list the available networks, along with their configurations. You can also get scan information from the wpa_supplicant utility (described later in this document).

Once you've started the appropriate driver and located the wireless network, you'll need to choose the network mode to use (ad hoc or infrastructure mode), the authentication method to attach to the wireless network, and the encryption protocol (if any) to use.

Note: We recommend that you implement encryption on your wireless network if you aren't using any physical security solutions.

By default, most network drivers will infrastructure mode (BSS), because most wireless networks are configured to allow network access via a WAP. If you wish to implement an ad hoc network, you can change the network mode by using the ifconfig command:

For information about your driver's media options, see its entry in the Utilities Reference. When you're in ad hoc mode, you advertise your presence to other peers that are within physical range. This means that other 802.11 devices can discover you and connect to your network.

Whether you're a client in infrastructure mode, or you're using ad hoc mode, the steps to implement encryption are the same. You need to make sure that you're using the authentication method and encryption key that have been chosen for the network. If you wish to connect with your peers using an ad hoc wireless network, all peers must be using the same authentication method and encryption key. If you're a client connecting to a WAP, you must use the same authentication method and encryption key as have been configured on the WAP.