qwf_wifi_SetHostapdOptions()

Updated: October 26, 2022

Set optional hostapd parameters for a Wi-Fi access point

Synopsis:

#include <qwf/qwf_wifi.h>
qwf_wifi_Results_e qwf_wifi_SetHostapdOptions(qwf_Context_t *pCtx,
                                              int channelNum,
                                              qwf_wifi_VhtOperChanWidth_e vhtOperChWidth,
                                              uint8_t vhtOperCenterFreqSeg0,
                                              uint8_t vhtOperCenterFreqSeg1,
                                              char *pCountryCode,
                                              char *pHtCapabilities,
                                              char *pVhtCapabilities,
                                              char *pAssocVse,
                                              char *pVendorElements)

Arguments:

pCtx
A pointer to the QWF service context
channelNum
The channel number to use for this access point. The maximum is 200. This value can be QWF_WIFI_AUTO_AP_CHANNEL to let the Wi-Fi Manager service assign the channel number.
vhtOperChWidth
A qwf_wifi_VhtOperChanWidth_e constant indicating the VHT operating channel width
vhtOperCenterFreqSeg0
For a 20, 40, 80, or 160 MHz channel width, this value specifies the index of the channel center frequency. For an 80+80 MHz width, it specifies the center frequency index of segment 0, which is the segment that contains the primary channel. The valid range is 0 to 173, with 0 meaning the Wi-Fi supplicant will use its default. See the hostapd.conf file for a calculation of the center frequency using this index.
vhtOperCenterFreqSeg1
For a 20, 40, 80, or 160 MHz channel width, this value should be set to 0. For an 80+80 MHz width, this value specifies the center frequency index of segment 1, which is the segment that does not contain the primary channel. The valid range is 0 to 173, with 0 meaning the Wi-Fi supplicant will use its default. See the hostapd.conf file for a calculation of the center frequency using this index.
pCountryCode
A two-character string specifying the short country code. This can be NULL.
pHtCapabilities
A string specifying the HT capabilities. This string has a maximum length of QWF_WIFI_MAX_CAPABILTIES_LEN characters, and is formatted as specified in the hostapd configuration file (e.g., [HT40-][SHORT-GI-20][SHORT-GI-40]). This parameter can be NULL if HT capabilities aren't used.
pVhtCapabilities
A string specifying the VHT capabilities. This string has a maximum length of QWF_WIFI_MAX_CAPABILTIES_LEN characters, and is formatted as specified in the hostapd configuration file (e.g., [SHORT-GI-80][HTC-VHT]). This parameter can be NULL if VHT capabilities aren't used.
pAssocVse
A string containing the Association Vendor Specific Element (VSE) of the Access Point. This string has a maximum length of QWF_WIFI_MAX_HOSTAPD_VSE_LEN characters, and is used as a filter for the VSE of an incoming Association Request (or Re-Association Request). This means that hostapd allows connection only to clients whose VSE contains this “association VSE”. This setting is Wi-Fi driver-specific; see the driver documentation for details. This argument can be NULL if the Association VSE isn't used.
pVendorElements
A string containing one or more Vendor Specific Elements (VSEs) to be used by hostapd when broadcasting a Beacon or Probe. This string has a maximum length of QWF_WIFI_MAX_HOSTAPD_VSE_LEN characters. See the vendor_elements parameter in the hostapd configuration file for usage information. This argument can be NULL if VSEs aren't used.

Library:

qwf_interface

Description:

This function sets optional parameters used by hostapd when the device is acting as an access point. This function may be called before starting or updating an access point with qwf_wifi_StartAccessPoint() or qwf_wifi_UpdateAccessPoint().

Note:

The hostapd parameter settings provided in the input arguments should be based on the sample hostapd.conf configuration file included in the wireless software package. You may refer to this sample file for further descriptions of these optional parameters.

Returns:

WIFI_OK Successful result

WIFI_ERR_INACTIVE The QWF Wi-Fi Manager service is inactive or not ready

WIFI_ERR_INT The QWF Wi-Fi Manager service couldn't issue the request or read the response

WIFI_ERR_PARAM pCtx is NULL, channelNum, vhtOperCenterFreqSeg0, or vhtOperCenterFreqSeg1 is greater than the maximum channel number, or pCountryCode, pHtCapabilities, or pVhtCapabilities is too long a string