![]() |
NetBurner 3.0
|
Namespaces | |
NBWifi | |
NBWifi namespace that encompaces the WiFi driver. | |
Classes | |
struct | NBWifi::Master::driverStatusStruct |
struct | WifiInit_t |
Functions | |
nbWifiScanResult * | WifiInitScan_SPI (int irqNum=-1, int moduleNum=-1, int csNum=-1, int connectorNum=-1, int gpioPinNum=-1, int resetPinNum=-1) |
Initializes the WiFi hardware, initializes the driver over the SPI bus, and performs an AP scan. More... | |
int | WifiInitScanAndShow_SPI (int irqNum=-1, int moduleNum=-1, int csNum=-1, int connectorNum=-1, int gpioPinNum=-1, int resetPinNum=-1) |
Initializes the WiFi hardware, initializes the driver using the SPI bus, performs an AP scan, and prints the scan results via serial output. More... | |
int | InitWifi_SPI (const char *SSID="", const char *password="", int irqNum=-1, int moduleNum=-1, int csNum=-1, int connectorNum=-1, int gpioPinNum=-1, int resetPinNum=-1) |
Initializes the WiFi hardware, initializes the driver using the SPI bus, and attempts to establish the specified connection. More... | |
int | InitAP_SPI (const char *SSID="", const char *password="", uint8_t channel=NBWIFI_DEFAULT_WIFICHANNEL, int irqNum=-1, int moduleNum=-1, int csNum=-1, int connectorNum=-1, int gpioPinNum=-1, int resetPinNum=-1) |
Initializes the WiFi hardware, initializes the driver using the SPI bus, and attempts to establish the specified access point. More... | |
nbWifiScanResult * | WifiInitScan_Serial (int portNum=-1, int resetPinNum=-1, int connectorNum=-1) |
Initializes the WiFi hardware, initializes the driver using the UART interface, performs an AP scan, and prints the scan results via serial output. More... | |
int | WifiInitScanAndShow_Serial (int portNum=-1, int resetPinNum=-1, int connectorNum=-1) |
Initializes the WiFi hardware, initializes the driver using the UART interface, performs an AP scan, and prints the scan results via serial output. More... | |
int | InitWifi_Serial (const char *SSID="", const char *password="", int portNum=-1, int resetPinNum=-1, int connectorNum=-1) |
Initializes the WiFi hardware, initializes the driver using the UART interface, and attempts to establish the specified access point. More... | |
void | SetWifiSPISpeed (int busSpeed) |
Set SPI bus speed. More... | |
void | ScanAndShowNetworks () |
Scan for surrounding access points and print the results via iprintf. More... | |
nbWifiScanResult * | ScanForNetworks () |
Scan for surrounding access points. More... | |
void | NBWifi::PrintScanResult (nbWifiScanResult *scanResult) |
Print the results of one scan result using iprintf. More... | |
virtual int | NBWifi::Master::ConnectToAP (const char *ssid=nullptr, const char *passwd="", uint8_t retryCount=CONNECT_RETRIES, uint8_t security=DEFAULT_WIFI_SEC_ALL)=0 |
Connect to an access point. If the SSID and Pass Phrase are not specified, values from the system configuration record will be used. More... | |
virtual int | NBWifi::Master::ConnectToAP (nbWifiConnect connect)=0 |
Connect to an access point. If the SSID and Pass Phrase are not specified, values from the system configuration record will be used. More... | |
virtual int | NBWifi::Master::StartAP (const char *ssid=nullptr, const char *passwd="", uint8_t channel=DEFAULT_TABLE_LABEL_CHANNEL, uint8_t security=DEFAULT_TABLE_LABEL_SEC, uint8_t cipher=DEFAULT_TABLE_LABEL_CIPH, uint8_t ssidLen=0)=0 |
Attempts to establish the specified software enabled access point (softAP). More... | |
virtual int | NBWifi::Master::StartConfigAP (uint8_t channel=DEFAULT_TABLE_LABEL_CHANNEL)=0 |
Attempts to establish the specified software enabled access point (softAP). This softAP then hosts a DHCP server and a webpage which lists surrounding access points. The webpage also provides a means of establishing a connection with a network from the list. More... | |
virtual nbWifiScanResult * | NBWifi::Master::Scan (const char *ssid=nullptr, uint8_t optionCount=0, uint16_t *optionList=nullptr)=0 |
Scan for all or requested access points. Results of Scan are valid until the next call to Scan() or FreeScanList(). More... | |
virtual void | NBWifi::Master::Disconnect ()=0 |
Disconnect from the network or disable software-enabled access point (softAP). More... | |
static Master * | NBWifi::Master::GetDriverByInterfaceNumber (int interfaceNumber) |
Get a pointer to the Wifi driver object. More... | |
virtual bool | NBWifi::Master::isRegistered () const =0 |
Check if the Wifi interface has been registered with the system networking stack. More... | |
virtual int | NBWifi::Master::GetWifiInterfaceNumber () const =0 |
Get driver object's interface number within the WiFi driver. More... | |
virtual int | NBWifi::Master::GetSystemInterfaceNumber () const =0 |
Get driver object's system interface number. More... | |
virtual int | NBWifi::Master::StoreSSIDPWToConfig (char *ssid, char *password, int ssidLen=0)=0 |
Store an SSID and password into the configuration record, which is in non-volatile memory. More... | |
virtual const char * | NBWifi::Master::GetDriverName () |
Get the name of the Wifi interface. More... | |
virtual int | NBWifi::Master::GetSSIDFromConfig (char *returnBuf, int maxLen)=0 |
Get the Service Set Identity (SSID) stored in the configuration record, which is in non-volatile memory. More... | |
virtual int | NBWifi::Master::GetKeyFromConfig (char *returnBuf, int maxLen)=0 |
Get the password stored in the configuration record, which is in non-volatile memory. More... | |
virtual int | NBWifi::Master::GetCurSSID (char *buf, int maxlen)=0 |
Get the Service Set Identity (SSID) of the network you are currently connected to, or the SSID of the access point that is currently established. More... | |
virtual MACADR | NBWifi::Master::GetCurBSSID ()=0 |
Get the basic service set identifier (BSSID) of the connected network. More... | |
virtual void | NBWifi::Master::GetCurrentAP (driverStatusStruct *ap)=0 |
Get the full status of the connected network in the form of a driverStatusStruct structure that is passed by reference. More... | |
virtual void | NBWifi::Master::GetDeviceInformation (nbWifiDeviceInfo *ap)=0 |
Get NBWifi module device information in the form of a nbWifiDeviceInfo structure. More... | |
virtual bool | NBWifi::Master::Connected ()=0 |
Check if the WiFi interface is currently connected to a network. More... | |
virtual int | NBWifi::Master::GetSignalStrength ()=0 |
Get the received signal strength indicator (RSSI) of the current connection. More... | |
virtual uint8_t | NBWifi::Master::GetCurChannel ()=0 |
Get the 802.11 channel of the current connection. More... | |
virtual uint8_t | NBWifi::Master::GetSecurity ()=0 |
Get the security type of the current connection. More... | |
virtual uint8_t | NBWifi::Master::GetCipher ()=0 |
Get the cipher of the current connection. More... | |
virtual void | NBWifi::Master::TransmitBuffer (PoolPtr txBuffer)=0 |
Transmit a buffer via the WiFi interface. More... | |
virtual bool | NBWifi::Master::GetLinkStatus ()=0 |
Get the connection/link status of the WiFi interface. This function simply checks a maintained connection status variable instead of polling the Wifi module. This function is faster than NBWifi::Connected(). More... | |
virtual void | NBWifi::Master::enab_multicast (MACADR macAddress, BOOL addAddress)=0 |
Enable/disable multicast filtering for a specific MAC address to receive multicast packets. More... | |
virtual int | NBWifi::Master::APIStart ()=0 |
Start the WiFi message processing task. This is only applicable to the NBWIFIIN module. More... | |
virtual int | NBWifi::Master::Start ()=0 |
For the NBWIFIIN module, this function begins the WiFi receive task. For the NBWIFIAT module, this function begins the dedicated WiFi transmit/receive/message processing task. More... | |
virtual void | NBWifi::Master::Pause ()=0 |
Pause the WiFi task. More... | |
virtual void | NBWifi::Master::Resume ()=0 |
Resume the WiFi task. More... | |
virtual void | NBWifi::Master::Kill ()=0 |
Abort the WiFi task. More... | |
|
pure virtual |
Start the WiFi message processing task. This is only applicable to the NBWIFIIN module.
|
pure virtual |
Check if the WiFi interface is currently connected to a network.
|
pure virtual |
Connect to an access point. If the SSID and Pass Phrase are not specified, values from the system configuration record will be used.
[in] | SSID | Service Set Identity (SSID), nullptr uses SSID stored in the configuration record. |
[in] | password | Pre-shared key to obtain access to the network; nullptr uses the key stored in the configuration record. |
[in] | retryCount | amount of attempts to try to connect. |
[in] | security | type of security of the network we are attempting to connect to. The options are DEFAULT_WIFI_SEC_ALL, SEC_VALUE_OPEN, SEC_VALUE_WEP, SEC_VALUE_WPA, SEC_VALUE_WPA2, SEC_VALUE_WPS. |
|
pure virtual |
Connect to an access point. If the SSID and Pass Phrase are not specified, values from the system configuration record will be used.
[in] | connect.ssid | Service Set Identity (SSID). nullptr uses SSID stored in the configuration record. |
[in] | connect.ssidLength | Length of the SSID string that was given. |
[in] | connect.security | type of security of the network we are attempting to connect to, DEFAULT_WIFI_SEC_ALL to try all security types. |
[in] | connect.psk | key shared with access point/peer; nullptr uses the key stored in the configuration record. |
[in] | connect.channel | 802.11 channel of the access point that is being connected to, DEFAULT_WIFI_CH_ALL to try all channels. |
[in] | connect.retryCount | amount of attempts to try to connect. |
|
pure virtual |
Disconnect from the network or disable software-enabled access point (softAP).
|
pure virtual |
Enable/disable multicast filtering for a specific MAC address to receive multicast packets.
[in] | macAddress | The mac address to add/remove from the multifast filter in the form of a MACADR struct. |
[in] | addAddress | TRUE to add the address to the multicast group. FALSE to remove the address. |
|
pure virtual |
Get the cipher of the current connection.
|
pure virtual |
Get the basic service set identifier (BSSID) of the connected network.
|
pure virtual |
Get the 802.11 channel of the current connection.
|
pure virtual |
Get the full status of the connected network in the form of a driverStatusStruct structure that is passed by reference.
[out] | ap | A pointer to a driverStatusStruct structure to be populated with the status information of the current WiFi network connection. |
|
pure virtual |
Get the Service Set Identity (SSID) of the network you are currently connected to, or the SSID of the access point that is currently established.
[out] | buf | pointer to a buffer used by this function to store the SSID. |
[in] | maxlen | The size limit for writing to the buf paramter. This is usually the size of buf in bytes. |
|
pure virtual |
Get NBWifi module device information in the form of a nbWifiDeviceInfo structure.
[out] | ap | A pointer to a nbwifiDeviceInfo structure to be populated with the NBWIFI module device information. |
|
static |
Get a pointer to the Wifi driver object.
[in] | interfaceNumber | The system interface number for the WiFi interface. |
|
virtual |
Get the name of the Wifi interface.
|
pure virtual |
Get the password stored in the configuration record, which is in non-volatile memory.
[out] | returnBuf | pointer to the buffer used by this function to store the password. |
[in] | maxLen | The size limit for writing to the returnBuf paramter. This is usually the size of returnBuf in bytes. |
|
pure virtual |
Get the connection/link status of the WiFi interface. This function simply checks a maintained connection status variable instead of polling the Wifi module. This function is faster than NBWifi::Connected().
|
pure virtual |
Get the security type of the current connection.
|
pure virtual |
Get the received signal strength indicator (RSSI) of the current connection.
|
pure virtual |
Get the Service Set Identity (SSID) stored in the configuration record, which is in non-volatile memory.
[out] | returnBuf | pointer to the buffer used by this function to store the SSID. |
[in] | maxLen | The size limit for writing to the returnBuf paramter. This is usually the size of returnBuf in bytes. |
|
pure virtual |
Get driver object's system interface number.
|
pure virtual |
Get driver object's interface number within the WiFi driver.
int InitAP_SPI | ( | const char * | SSID = "" , |
const char * | password = "" , |
||
uint8_t | channel = NBWIFI_DEFAULT_WIFICHANNEL , |
||
int | irqNum = -1 , |
||
int | moduleNum = -1 , |
||
int | csNum = -1 , |
||
int | connectorNum = -1 , |
||
int | gpioPinNum = -1 , |
||
int | resetPinNum = -1 |
||
) |
Initializes the WiFi hardware, initializes the driver using the SPI bus, and attempts to establish the specified access point.
[in] | SSID | Service Set Identity (SSID), nullptr uses SSID stored in the configuration record. |
[in] | password | key shared with access point/peer; nullptr uses the key stored in the configuration record. |
[in] | channel | 802.11 channel to establish an access point on. |
[in] | irqNum | IRQ signal used to communicate with the WiFi module. |
[in] | spiModuleNum | SPI module number used to communicate with the WiFi module. |
[in] | csNum | Chip Select signal used for SPI communication. |
[in] | connectorNum | physical header number of the NetBurner module used. |
[in] | csGpioPinNum | GPIO pin number to use if not using SPI's chip select signal. |
[in] | resetPinNum | pin number to use as an reset signal output to the wifi module. |
int InitWifi_Serial | ( | const char * | SSID = "" , |
const char * | password = "" , |
||
int | portNum = -1 , |
||
int | resetPinNum = -1 , |
||
int | connectorNum = -1 |
||
) |
Initializes the WiFi hardware, initializes the driver using the UART interface, and attempts to establish the specified access point.
Serial functions pertaining to WiFi are only available for the NBWIFIIN.
[in] | SSID | Service Set Identity (SSID), nullptr uses SSID stored in the configuration record. |
[in] | password | key shared with access point/peer; nullptr uses the key stored in the configuration record. |
[in] | portNum | UART number |
[in] | resetPinNum | pin number to use as an reset signal output to the wifi module. |
[in] | connectorNum | physical header number of the NetBurner module used. |
int InitWifi_SPI | ( | const char * | SSID = "" , |
const char * | password = "" , |
||
int | irqNum = -1 , |
||
int | moduleNum = -1 , |
||
int | csNum = -1 , |
||
int | connectorNum = -1 , |
||
int | gpioPinNum = -1 , |
||
int | resetPinNum = -1 |
||
) |
Initializes the WiFi hardware, initializes the driver using the SPI bus, and attempts to establish the specified connection.
[in] | SSID | Service Set Identity (SSID), nullptr uses SSID stored in the configuration record. |
[in] | password | key shared with access point/peer; nullptr uses the key stored in the configuration record. |
[in] | irqNum | IRQ signal used to communicate with the WiFi module. |
[in] | spiModuleNum | SPI module number used to communicate with the WiFi module. |
[in] | csNum | Chip Select signal used for SPI communication. |
[in] | connectorNum | physical header number of the NetBurner module used. |
[in] | csGpioPinNum | GPIO pin number to use if not using SPI's chip select signal. |
[in] | resetPinNum | pin number to use as an reset signal output to the wifi module. |
|
pure virtual |
Check if the Wifi interface has been registered with the system networking stack.
|
pure virtual |
Abort the WiFi task.
|
pure virtual |
Pause the WiFi task.
void NBWifi::PrintScanResult | ( | nbWifiScanResult * | scanResult | ) |
Print the results of one scan result using iprintf.
[in] | scanResult | Pointer to the scan result structure containing the scan result to be printed |
|
pure virtual |
Resume the WiFi task.
|
pure virtual |
Scan for all or requested access points. Results of Scan are valid until the next call to Scan() or FreeScanList().
[in] | ssid | Service Set Identity (SSID) for network to scan for. If nullptr, scan for all access points. Otherwise, scan for this network only. |
[in] | optionCount | Count of options used to filter scan results. This is an optional parameter unless optionList is used. |
[in] | optionList | List of options used to filter scan results. This is an optional parameter. Passing nullptr will simply show all scan results. Option list values can be found in the following sections: OPTIONLISTSEC, OPTIONLISTCIPH, OPTIONLISTBAND, and OPTIONLISTBSSTYPE. |
void ScanAndShowNetworks | ( | ) |
Scan for surrounding access points and print the results via iprintf.
This function is bus interface agnostic.
nbWifiScanResult* ScanForNetworks | ( | ) |
Scan for surrounding access points.
This function is bus interface agnostic.
void SetWifiSPISpeed | ( | int | busSpeed | ) |
Set SPI bus speed.
[in] | busSpeed | Bus speed in Hz. |
|
pure virtual |
For the NBWIFIIN module, this function begins the WiFi receive task. For the NBWIFIAT module, this function begins the dedicated WiFi transmit/receive/message processing task.
|
pure virtual |
Attempts to establish the specified software enabled access point (softAP).
[in] | ssid | Service Set Identity (SSID) for softAP. If nullptr, uses SSID stored in the configuration record. SSID maximum length is 32 characters. Returns Error::InvalidArgument (-258) if not set properly. |
[in] | passwd | Key shared with access point/peer. If nullptr, uses the key stored in the configuration record. Password must be between 8 and 64 characters, or nullptr for an open network. returns Error::InvalidArgument (-258) otherwise. |
[in] | channel | 802.11 channel to establish the access point on. |
[in] | security | Type of security of the network we are attempting to establish. The NBWIFIAT module supports only WPA/WPA2 secured and open networks. The options are SEC_VALUE_OPEN, SEC_VALUE_WEP, SEC_VALUE_WPA, SEC_VALUE_WPA2, SEC_VALUE_WPS. |
[in] | cipher | Cipher used to encrypt data transmitted over 802.11. Option not available on the NBWIFIAT module. The options are CIPH_VALUE_NONE, CIPH_VALUE_TKIP, CIPH_VALUE_AES, CIPH_VALUE_MIXED. |
[in] | ssidLen | Length of the SSID string not include the nullptr terminating char. |
|
pure virtual |
Attempts to establish the specified software enabled access point (softAP). This softAP then hosts a DHCP server and a webpage which lists surrounding access points. The webpage also provides a means of establishing a connection with a network from the list.
[in] | channel | 802.11 channel to establsh the softAP on. |
|
pure virtual |
Store an SSID and password into the configuration record, which is in non-volatile memory.
[in] | ssid | Service Set Identity (SSID) to store in the config record. Max length of SSID_MAX_LEN, defined in nbwifi/include/nbwifi/nbWificonstants.h. |
[in] | passwd | Pre-shared key. Password must be between 8 and 64 characters, or nullptr for an open network. returns Error::InvalidArgument (-258) otherwise. |
[in] | ssidLen | Length of the ssid string, not including nullptr terminating chars. |
|
pure virtual |
Transmit a buffer via the WiFi interface.
[in] | txBuffer | Buffer to be transfered over the WiFi interface |
nbWifiScanResult* WifiInitScan_Serial | ( | int | portNum = -1 , |
int | resetPinNum = -1 , |
||
int | connectorNum = -1 |
||
) |
Initializes the WiFi hardware, initializes the driver using the UART interface, performs an AP scan, and prints the scan results via serial output.
Serial functions pertaining to WiFi are only available for the NBWIFIIN.
[in] | portNum | UART number |
[in] | resetPinNum | pin number to use as an reset signal output to the wifi module. |
[in] | connectorNum | physical header number of the NetBurner module used. |
nbWifiScanResult* WifiInitScan_SPI | ( | int | irqNum = -1 , |
int | moduleNum = -1 , |
||
int | csNum = -1 , |
||
int | connectorNum = -1 , |
||
int | gpioPinNum = -1 , |
||
int | resetPinNum = -1 |
||
) |
Initializes the WiFi hardware, initializes the driver over the SPI bus, and performs an AP scan.
[in] | irqNum | IRQ signal used to communicate with the WiFi module. |
[in] | spiModuleNum | SPI module number used to communicate with the WiFi module. |
[in] | csNum | Chip Select signal used for SPI communication. |
[in] | connectorNum | physical header number of the NetBurner module used. |
[in] | csGpioPinNum | GPIO pin number to use if not using SPI's chip select signal. |
[in] | resetPinNum | pin number to use as an reset signal output to the wifi module. |
Initializes the WiFi Driver to communicate with the WiFi module over the SPI bus and performs a scan for surrounding access points (AP). The result of the scan is returned as the head of a linked list that contains the scan results. If the WiFi driver has already been initialized by a previous call to one of the WifiInit function variations, then only a scan will be performed.
int WifiInitScanAndShow_Serial | ( | int | portNum = -1 , |
int | resetPinNum = -1 , |
||
int | connectorNum = -1 |
||
) |
Initializes the WiFi hardware, initializes the driver using the UART interface, performs an AP scan, and prints the scan results via serial output.
Serial functions pertaining to WiFi are only available for the NBWIFIIN.
[in] | portNum | UART number |
[in] | resetPinNum | pin number to use as an reset signal output to the wifi module. |
[in] | connectorNum | physical header number of the NetBurner module used. |
int WifiInitScanAndShow_SPI | ( | int | irqNum = -1 , |
int | moduleNum = -1 , |
||
int | csNum = -1 , |
||
int | connectorNum = -1 , |
||
int | gpioPinNum = -1 , |
||
int | resetPinNum = -1 |
||
) |
Initializes the WiFi hardware, initializes the driver using the SPI bus, performs an AP scan, and prints the scan results via serial output.
[in] | irqNum | IRQ signal used to communicate with the WiFi module. |
[in] | spiModuleNum | SPI module number used to communicate with the WiFi module. |
[in] | csNum | Chip Select signal used for SPI communication. |
[in] | connectorNum | physical header number of the NetBurner module used. |
[in] | csGpioPinNum | GPIO pin number to use if not using SPI's chip select signal. |
[in] | resetPinNum | pin number to use as an reset signal output to the wifi module. |
|
static |
Array of WiFi driver objects