NetBurner 3.0
NBWifi

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...
 

Variables

uint8_t NBWifi::Master::driverStatusStruct::connected
 1 if connected, 0 if disconnected
 
uint8_t NBWifi::Master::driverStatusStruct::ssidLength
 Length of the SSID string.
 
uint16_t NBWifi::Master::driverStatusStruct::txPower
 Transmit power.
 
int16_t NBWifi::Master::driverStatusStruct::rssi
 Recieved Signal Strength Indicator.
 
uint8_t NBWifi::Master::driverStatusStruct::band
 Refer to BANDSECTION for defenitions.
 
uint8_t NBWifi::Master::driverStatusStruct::channel
 802.11 channel
 
uint32_t NBWifi::Master::driverStatusStruct::maxTxRate
 Max transmit data throughput.
 
uint8_t NBWifi::Master::driverStatusStruct::security
 Security used: WEP, WPA, WPA2, open, uknown.
 
uint8_t NBWifi::Master::driverStatusStruct::cipher
 refer to OPTIONLISTCIPH for defenitions
 
MACADR NBWifi::Master::driverStatusStruct::bssid
 Basic Service Set Identifier.
 
uint8_t NBWifi::Master::driverStatusStruct::bssType
 refer to OPTIONLISTBSSTYPE for defenitions
 
char NBWifi::Master::driverStatusStruct::ssid [SSID_MAX_LEN+1]
 Placeholder for char array pointer.
 
uint32_t NBWifi::Master::driverStatusStruct::tickLastUpdated
 CPU tick count of when this struct was last updated.
 
static Master * NBWifi::Master::wifiDrivers [MAX_WIFI_INTERFACES]
 

Detailed Description

Function Documentation

◆ APIStart()

virtual int NBWifi::Master::APIStart ( )
pure virtual

Start the WiFi message processing task. This is only applicable to the NBWIFIIN module.

Returns
Constants::TaskStart_Err_NoError, if successful. Otherwise, returns NBWifi::Constants::TaskStartError if the API task is already running or has already been started.

◆ Connected()

virtual bool NBWifi::Master::Connected ( )
pure virtual

Check if the WiFi interface is currently connected to a network.

Note
performs a bus communication to query the module. This will perform more slowly than NBWifi::Master::GetLinkStatus(), which simply checks a maintained connection status variable.
Returns
TRUE, if connected. FALSE, otherwise.

◆ ConnectToAP() [1/2]

virtual int NBWifi::Master::ConnectToAP ( const char *  ssid = nullptr,
const char *  passwd = "",
uint8_t  retryCount = CONNECT_RETRIES,
uint8_t  security = DEFAULT_WIFI_SEC_ALL 
)
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.

Parameters
[in]SSIDService Set Identity (SSID), nullptr uses SSID stored in the configuration record.
[in]passwordPre-shared key to obtain access to the network; nullptr uses the key stored in the configuration record.
[in]retryCountamount of attempts to try to connect.
[in]securitytype 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.
Returns
returns the interface number, if succesful. Otherwise, returns NBWifi::Error::Connect::ConnectErrors or NBWifi::Error::GeneralErrors

◆ ConnectToAP() [2/2]

virtual int NBWifi::Master::ConnectToAP ( nbWifiConnect  connect)
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.

Parameters
[in]connect.ssidService Set Identity (SSID). nullptr uses SSID stored in the configuration record.
[in]connect.ssidLengthLength of the SSID string that was given.
[in]connect.securitytype of security of the network we are attempting to connect to, DEFAULT_WIFI_SEC_ALL to try all security types.
[in]connect.pskkey shared with access point/peer; nullptr uses the key stored in the configuration record.
[in]connect.channel802.11 channel of the access point that is being connected to, DEFAULT_WIFI_CH_ALL to try all channels.
[in]connect.retryCountamount of attempts to try to connect.
Returns
returns the interface number, if succesful. Otherwise, returns NBWifi::Error::Connect::ConnectErrors or NBWifi::Error::GeneralErrors

◆ Disconnect()

virtual void NBWifi::Master::Disconnect ( )
pure virtual

Disconnect from the network or disable software-enabled access point (softAP).

Returns
nothing

◆ enab_multicast()

virtual void NBWifi::Master::enab_multicast ( MACADR  macAddress,
BOOL  addAddress 
)
pure virtual

Enable/disable multicast filtering for a specific MAC address to receive multicast packets.

Parameters
[in]macAddressThe mac address to add/remove from the multifast filter in the form of a MACADR struct.
[in]addAddressTRUE to add the address to the multicast group. FALSE to remove the address.
Returns
nothing.

◆ GetCipher()

virtual uint8_t NBWifi::Master::GetCipher ( )
pure virtual

Get the cipher of the current connection.

Warning
This function currently is not supported on the NBWIFIAT.
Returns
OPTIONLISTCIPH, if successful.

◆ GetCurBSSID()

virtual MACADR NBWifi::Master::GetCurBSSID ( )
pure virtual

Get the basic service set identifier (BSSID) of the connected network.

Returns
A MACADR structure which contains the 48-bit BSSID value, if successful. Otherwise, returns an empty structure.

◆ GetCurChannel()

virtual uint8_t NBWifi::Master::GetCurChannel ( )
pure virtual

Get the 802.11 channel of the current connection.

Warning
This function currently is not supported on the NBWIFIAT.
Returns
802.11 channel of the current connection or 0 if the request failed.

◆ GetCurrentAP()

virtual void NBWifi::Master::GetCurrentAP ( driverStatusStruct ap)
pure virtual

Get the full status of the connected network in the form of a driverStatusStruct structure that is passed by reference.

Parameters
[out]apA pointer to a driverStatusStruct structure to be populated with the status information of the current WiFi network connection.
Returns
nothing

◆ GetCurSSID()

virtual int NBWifi::Master::GetCurSSID ( char *  buf,
int  maxlen 
)
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.

Parameters
[out]bufpointer to a buffer used by this function to store the SSID.
[in]maxlenThe size limit for writing to the buf paramter. This is usually the size of buf in bytes.
Returns
returns the length of the copied string. Otherwise, returns NBWifi::Error::GeneralErrors.

◆ GetDeviceInformation()

virtual void NBWifi::Master::GetDeviceInformation ( nbWifiDeviceInfo *  ap)
pure virtual

Get NBWifi module device information in the form of a nbWifiDeviceInfo structure.

Parameters
[out]apA pointer to a nbwifiDeviceInfo structure to be populated with the NBWIFI module device information.
Returns
nothing

◆ GetDriverByInterfaceNumber()

static Master* NBWifi::Master::GetDriverByInterfaceNumber ( int  interfaceNumber)
static

Get a pointer to the Wifi driver object.

Parameters
[in]interfaceNumberThe system interface number for the WiFi interface.
Returns
returns a pointer to the WiFi driver object of type NBWifi::Master, if successful. Otherwise, returns nullptr.
Note
See also NBWifi::Master::GetSystemInterfaceNumber().

◆ GetDriverName()

virtual const char* NBWifi::Master::GetDriverName ( )
virtual

Get the name of the Wifi interface.

Returns
Pointer to a string containing the WiFi interface's name.

◆ GetKeyFromConfig()

virtual int NBWifi::Master::GetKeyFromConfig ( char *  returnBuf,
int  maxLen 
)
pure virtual

Get the password stored in the configuration record, which is in non-volatile memory.

Parameters
[out]returnBufpointer to the buffer used by this function to store the password.
[in]maxLenThe size limit for writing to the returnBuf paramter. This is usually the size of returnBuf in bytes.
Returns
returns the length of the copied string. Otherwise, returns NBWifi::Error::GeneralErrors.

◆ GetLinkStatus()

virtual bool NBWifi::Master::GetLinkStatus ( )
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().

Returns
TRUE if connected. FALSE, if not connected.

◆ GetSecurity()

virtual uint8_t NBWifi::Master::GetSecurity ( )
pure virtual

Get the security type of the current connection.

Returns
OPTIONLISTSEC, if successful. Otherwise, returns NBWifi::Error::GeneralErrors, NBWifi::Error::Init:InitializationErrors, or NBWifi::Error::Connect::ConnectErrors.

◆ GetSignalStrength()

virtual int NBWifi::Master::GetSignalStrength ( )
pure virtual

Get the received signal strength indicator (RSSI) of the current connection.

Returns
A value between 0 and -100, if a valid RSSI value is found. The signal strength is greater as the value approaches 0.

◆ GetSSIDFromConfig()

virtual int NBWifi::Master::GetSSIDFromConfig ( char *  returnBuf,
int  maxLen 
)
pure virtual

Get the Service Set Identity (SSID) stored in the configuration record, which is in non-volatile memory.

Parameters
[out]returnBufpointer to the buffer used by this function to store the SSID.
[in]maxLenThe size limit for writing to the returnBuf paramter. This is usually the size of returnBuf in bytes.
Returns
returns the length of the copied string. Otherwise, returns NBWifi::Error::GeneralErrors.

◆ GetSystemInterfaceNumber()

virtual int NBWifi::Master::GetSystemInterfaceNumber ( ) const
pure virtual

Get driver object's system interface number.

Returns
interface number > 0, if it has been registered. Otherwise returns 0.

◆ GetWifiInterfaceNumber()

virtual int NBWifi::Master::GetWifiInterfaceNumber ( ) const
pure virtual

Get driver object's interface number within the WiFi driver.

Note
The WiFi interface number only pertains to the WiFi driver and NOT the system interface values.
Returns
interface number >= 0, if the interface exists. Otherwise, returns -1.

◆ InitAP_SPI()

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.

Parameters
[in]SSIDService Set Identity (SSID), nullptr uses SSID stored in the configuration record.
[in]passwordkey shared with access point/peer; nullptr uses the key stored in the configuration record.
[in]channel802.11 channel to establish an access point on.
[in]irqNumIRQ signal used to communicate with the WiFi module.
[in]spiModuleNumSPI module number used to communicate with the WiFi module.
[in]csNumChip Select signal used for SPI communication.
[in]connectorNumphysical header number of the NetBurner module used.
[in]csGpioPinNumGPIO pin number to use if not using SPI's chip select signal.
[in]resetPinNumpin number to use as an reset signal output to the wifi module.
Returns
returns the Wifi interface number, if successful. Otherwise, returns NBWifi::Error::GeneralErrors or NBWifi::Error::Init::InitializationErrors

◆ InitWifi_Serial()

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.

Parameters
[in]SSIDService Set Identity (SSID), nullptr uses SSID stored in the configuration record.
[in]passwordkey shared with access point/peer; nullptr uses the key stored in the configuration record.
[in]portNumUART number
[in]resetPinNumpin number to use as an reset signal output to the wifi module.
[in]connectorNumphysical header number of the NetBurner module used.
Returns
returns zero if successful, otherwise returns NBWifi::Error::GeneralErrors or NBWifi::Error::Init::InitializationErrors

◆ InitWifi_SPI()

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.

Parameters
[in]SSIDService Set Identity (SSID), nullptr uses SSID stored in the configuration record.
[in]passwordkey shared with access point/peer; nullptr uses the key stored in the configuration record.
[in]irqNumIRQ signal used to communicate with the WiFi module.
[in]spiModuleNumSPI module number used to communicate with the WiFi module.
[in]csNumChip Select signal used for SPI communication.
[in]connectorNumphysical header number of the NetBurner module used.
[in]csGpioPinNumGPIO pin number to use if not using SPI's chip select signal.
[in]resetPinNumpin number to use as an reset signal output to the wifi module.
Returns
returns the Wifi interface number, if successful. Otherwise, returns NBWifi::Error::GeneralErrors or NBWifi::Error::Init::InitializationErrors

◆ isRegistered()

virtual bool NBWifi::Master::isRegistered ( ) const
pure virtual

Check if the Wifi interface has been registered with the system networking stack.

Returns
True if the Wifi interface has been registered. False if it has not ben registered.

◆ Kill()

virtual void NBWifi::Master::Kill ( )
pure virtual

Abort the WiFi task.

Note
For the NBWIFIIN module, this function will pause the WiFi receive task that is executed with the Start() function call.
Returns
nothing.

◆ Pause()

virtual void NBWifi::Master::Pause ( )
pure virtual

Pause the WiFi task.

Note
For the NBWIFIIN module, this function will pause the WiFi receive task that is executed with the Start() function call.
Returns
nothing.

◆ PrintScanResult()

void NBWifi::PrintScanResult ( nbWifiScanResult *  scanResult)

Print the results of one scan result using iprintf.

Parameters
[in]scanResultPointer to the scan result structure containing the scan result to be printed
Returns
nothing

◆ Resume()

virtual void NBWifi::Master::Resume ( )
pure virtual

Resume the WiFi task.

Note
For the NBWIFIIN module, this function will pause the WiFi receive task that is executed with the Start() function call.
Returns
nothing.

◆ Scan()

virtual nbWifiScanResult* NBWifi::Master::Scan ( const char *  ssid = nullptr,
uint8_t  optionCount = 0,
uint16_t *  optionList = nullptr 
)
pure virtual

Scan for all or requested access points. Results of Scan are valid until the next call to Scan() or FreeScanList().

Warning
Scan CANNOT be performed while in access point (AP) mode on the NBWIFIAT.
Parameters
[in]ssidService Set Identity (SSID) for network to scan for. If nullptr, scan for all access points. Otherwise, scan for this network only.
[in]optionCountCount of options used to filter scan results. This is an optional parameter unless optionList is used.
[in]optionListList 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.
Returns
returns zero if succesful, otherwise returns NBWifi::Error::Connect::ConnectErrors or NBWifi::Error::GeneralErrors.

◆ ScanAndShowNetworks()

void ScanAndShowNetworks ( )

Scan for surrounding access points and print the results via iprintf.

Returns
nothing

This function is bus interface agnostic.

◆ ScanForNetworks()

nbWifiScanResult* ScanForNetworks ( )

Scan for surrounding access points.

Returns
nbWifiScanResult Head of linked list containing the AP scan results. nullptr if scan failed or no access points were found

This function is bus interface agnostic.

◆ SetWifiSPISpeed()

void SetWifiSPISpeed ( int  busSpeed)

Set SPI bus speed.

Parameters
[in]busSpeedBus speed in Hz.
Returns
nothing

◆ Start()

virtual int NBWifi::Master::Start ( )
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.

Returns
Constants::TaskStart_Err_NoError, if successful. Otherwise, returns NBWifi::Constants::TaskStartError if the API task is already running or has already been started

◆ StartAP()

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 
)
pure virtual

Attempts to establish the specified software enabled access point (softAP).

Warning
Scan CANNOT be performed while in access point (AP) mode on the NBWIFIAT.
Parameters
[in]ssidService 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]passwdKey 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]channel802.11 channel to establish the access point on.
[in]securityType 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]cipherCipher 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]ssidLenLength of the SSID string not include the nullptr terminating char.
Returns
returns zero if succesful, otherwise returns Configuration Errors, NBWifi::Error::Connect::ConnectErrors, or NBWifi::Error::GeneralErrors.

◆ StartConfigAP()

virtual int NBWifi::Master::StartConfigAP ( uint8_t  channel = DEFAULT_TABLE_LABEL_CHANNEL)
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.

Warning
Scan CANNOT be performed while in access point (AP) mode on the NBWIFIAT. The scan for the webpage is performed before the AP is established. Therefore, if your AP has been running for a while, the scan results may not still be valid.
Parameters
[in]channel802.11 channel to establsh the softAP on.
Returns
returns zero if succesful, otherwise returns NBWifi::Error::Connect::ConnectErrors or NBWifi::Error::GeneralErrors or 1 if a DHCP server already exists.

◆ StoreSSIDPWToConfig()

virtual int NBWifi::Master::StoreSSIDPWToConfig ( char *  ssid,
char *  password,
int  ssidLen = 0 
)
pure virtual

Store an SSID and password into the configuration record, which is in non-volatile memory.

Parameters
[in]ssidService Set Identity (SSID) to store in the config record. Max length of SSID_MAX_LEN, defined in nbwifi/include/nbwifi/nbWificonstants.h.
[in]passwdPre-shared key. Password must be between 8 and 64 characters, or nullptr for an open network. returns Error::InvalidArgument (-258) otherwise.
[in]ssidLenLength of the ssid string, not including nullptr terminating chars.
Returns
returns 1 if successful, returns 0 otherwise.

◆ TransmitBuffer()

virtual void NBWifi::Master::TransmitBuffer ( PoolPtr  txBuffer)
pure virtual

Transmit a buffer via the WiFi interface.

Parameters
[in]txBufferBuffer to be transfered over the WiFi interface
Returns
nothing

◆ WifiInitScan_Serial()

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.

Parameters
[in]portNumUART number
[in]resetPinNumpin number to use as an reset signal output to the wifi module.
[in]connectorNumphysical header number of the NetBurner module used.
Returns
nbWifiScanResult Head of linked list containing the AP scan results. nullptr if scan failed or no access points were found

◆ WifiInitScan_SPI()

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.

Parameters
[in]irqNumIRQ signal used to communicate with the WiFi module.
[in]spiModuleNumSPI module number used to communicate with the WiFi module.
[in]csNumChip Select signal used for SPI communication.
[in]connectorNumphysical header number of the NetBurner module used.
[in]csGpioPinNumGPIO pin number to use if not using SPI's chip select signal.
[in]resetPinNumpin number to use as an reset signal output to the wifi module.
Returns
nbWifiScanResult Head of linked list containing the AP scan results. nullptr if scan failed or no access points were found

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.

◆ WifiInitScanAndShow_Serial()

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.

Parameters
[in]portNumUART number
[in]resetPinNumpin number to use as an reset signal output to the wifi module.
[in]connectorNumphysical header number of the NetBurner module used.
Returns
the Wifi interface number, if successful. Otherwise, returns NBWifi::Error::GeneralErrors or NBWifi::Error::Init::InitializationErrors

◆ WifiInitScanAndShow_SPI()

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.

Parameters
[in]irqNumIRQ signal used to communicate with the WiFi module.
[in]spiModuleNumSPI module number used to communicate with the WiFi module.
[in]csNumChip Select signal used for SPI communication.
[in]connectorNumphysical header number of the NetBurner module used.
[in]csGpioPinNumGPIO pin number to use if not using SPI's chip select signal.
[in]resetPinNumpin number to use as an reset signal output to the wifi module.
Returns
returns the Wifi interface number, if successful. Otherwise, returns NBWifi::Error::GeneralErrors or NBWifi::Error::Init::InitializationErrors

Variable Documentation

◆ wifiDrivers

Master* NBWifi::Master::wifiDrivers[MAX_WIFI_INTERFACES]
static

Array of WiFi driver objects