RDK Documentation (Open Sourced RDK Components)
Wi-Fi Client HAL API List

Description

Wi-Fi Client HAL provides an interface (data structures and API) to interact with underlying Wi-Fi driver and enabling the client to be connected with an Access Point.

Data Structures

struct  _wifi_telemetry_ops_t
 Telemetry callback functions. More...
 

Typedefs

typedef INT(* wifi_disconnectEndpoint_callback) (INT ssidIndex, CHAR *AP_SSID, wifiStatusCode_t *error)
 This call back should be registered by Wi-Fi manager to receive status updates from HAL in case of a connection/disconnection event. More...
 
typedef INT(* wifi_connectEndpoint_callback) (INT ssidIndex, CHAR *AP_SSID, wifiStatusCode_t *error)
 This call back will be invoked when client automatically connect to Access Point. More...
 
typedef struct _wifi_telemetry_ops_t wifi_telemetry_ops_t
 Telemetry callback functions.
 

Functions

INT wifi_getCliWpsEnable (INT ssidIndex, BOOL *output_bool)
 This API checks WPS(Wi-Fi Protected Setup) functionality is enabled for this access point. More...
 
INT wifi_setCliWpsEnable (INT ssidIndex, BOOL enableValue)
 This API enables or disables WPS functionality for this access point. More...
 
INT wifi_getCliWpsDevicePIN (INT ssidIndex, ULONG *output_ulong)
 This API is used to read the device PIN required for making a WPS connection. More...
 
INT wifi_setCliWpsDevicePIN (INT ssidIndex, ULONG pin)
 This API sets the WPS Device pin to the Wi-Fi hal. More...
 
INT wifi_getCliWpsConfigMethodsSupported (INT ssidIndex, CHAR *methods)
 This API is used to get WPS configuration methods supported by the device. More...
 
INT wifi_getCliWpsConfigMethodsEnabled (INT ssidIndex, CHAR *output_string)
 This function indicates WPS configuration methods enabled on the device. More...
 
INT wifi_setCliWpsConfigMethodsEnabled (INT ssidIndex, CHAR *methodString)
 This API sets the active WPS method. More...
 
INT wifi_getCliWpsConfigurationState (INT ssidIndex, CHAR *output_string)
 This API is used to get the WPS config status, whether "configured" or "not configured". More...
 
INT wifi_setCliWpsEnrolleePin (INT ssidIndex, CHAR *EnrolleePin)
 This API sets the PIN to connect. User get the EnrolleePin (device pin from AP device) give to hostapd for pairing. More...
 
INT wifi_setCliWpsButtonPush (INT ssidIndex)
 Start the Push button pairing. More...
 
INT wifi_cancelCliWPS (INT ssidIndex)
 Stop the WPS process. More...
 
INT wifi_connectEndpoint (INT ssidIndex, CHAR *AP_SSID, wifiSecurityMode_t AP_security_mode, CHAR *AP_security_WEPKey, CHAR *AP_security_PreSharedKey, CHAR *AP_security_KeyPassphrase, int saveSSID, CHAR *eapIdentity, CHAR *carootcert, CHAR *clientcert, CHAR *privatekey)
 This API starts the connection process from client with an AP. More...
 
INT wifi_disconnectEndpoint (INT ssidIndex, CHAR *AP_SSID)
 This API disconnects the access point specified. More...
 
INT wifi_clearSSIDInfo (INT ssidIndex)
 
void wifi_disconnectEndpoint_callback_register (wifi_disconnectEndpoint_callback callback_proc)
 Callback registration function. More...
 
void wifi_connectEndpoint_callback_register (wifi_connectEndpoint_callback callback_proc)
 Callback registration function. More...
 
void wifi_telemetry_callback_register (wifi_telemetry_ops_t *telemetry_ops)
 
INT wifi_lastConnected_Endpoint (wifi_pairedSSIDInfo_t *pairedSSIDInfo)
 This call will give the last saved AP's ssid. More...
 

Data Structure Documentation

◆ _wifi_telemetry_ops_t

struct _wifi_telemetry_ops_t

Telemetry callback functions.

Definition at line 378 of file wifi_client_hal.h.

Collaboration diagram for _wifi_telemetry_ops_t:
Collaboration graph

Data Fields

void(* init )(char *name)
 
void(* event_s )(char *marker, char *value)
 
void(* event_d )(char *marker, int value)
 

Typedef Documentation

◆ wifi_disconnectEndpoint_callback

typedef INT(* wifi_disconnectEndpoint_callback) (INT ssidIndex, CHAR *AP_SSID, wifiStatusCode_t *error)

This call back should be registered by Wi-Fi manager to receive status updates from HAL in case of a connection/disconnection event.

Parameters
[in]ssidIndexThe index of SSID array.
[in]AP_SSIDThe ssid to disconnect.
[out]errorIndicates the Wi-Fi connection sttaus.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 347 of file wifi_client_hal.h.

◆ wifi_connectEndpoint_callback

typedef INT(* wifi_connectEndpoint_callback) (INT ssidIndex, CHAR *AP_SSID, wifiStatusCode_t *error)

This call back will be invoked when client automatically connect to Access Point.

Parameters
[in]ssidIndexThe index of SSID array.
[in]AP_SSIDThe ssid to disconnect.
[out]errorIndicates the Wi-Fi connection status.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 366 of file wifi_client_hal.h.

Function Documentation

◆ wifi_getCliWpsEnable()

INT wifi_getCliWpsEnable ( INT  ssidIndex,
BOOL *  output_bool 
)

This API checks WPS(Wi-Fi Protected Setup) functionality is enabled for this access point.

Parameters
[in]ssidIndexThe index of the SSID array.
[out]output_boolBoolean value which indicates the wps enabled status.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 867 of file wifi_client_hal.c.

◆ wifi_setCliWpsEnable()

INT wifi_setCliWpsEnable ( INT  ssidIndex,
BOOL  enableValue 
)

This API enables or disables WPS functionality for this access point.

Parameters
[in]ssidIndexThe index of the SSID array.
[in]enableValueBoolean value to enable or disable WPS.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 872 of file wifi_client_hal.c.

◆ wifi_getCliWpsDevicePIN()

INT wifi_getCliWpsDevicePIN ( INT  ssidIndex,
ULONG output_ulong 
)

This API is used to read the device PIN required for making a WPS connection.

Parameters
[in]ssidIndexThe index of the SSID array.
[out]output_ulongOutput parameter which saves the Device PIN. This value is to be printed on the device.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 877 of file wifi_client_hal.c.

◆ wifi_setCliWpsDevicePIN()

INT wifi_setCliWpsDevicePIN ( INT  ssidIndex,
ULONG  pin 
)

This API sets the WPS Device pin to the Wi-Fi hal.

Parameters
[in]ssidIndexThe index of the SSID array.
[in]pinThe PIN code to set.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 882 of file wifi_client_hal.c.

◆ wifi_getCliWpsConfigMethodsSupported()

INT wifi_getCliWpsConfigMethodsSupported ( INT  ssidIndex,
CHAR *  methods 
)

This API is used to get WPS configuration methods supported by the device.

This function provides the comma-separated list of strings, each list item is an enumeration of:

  • USBFlashDrive - User uses a USB flash drive to transfer data between the new client device and the network's access point.
  • Ethernet - If there is no WPS button, user can configure the wireless settings using ethernet on a wifi-extender
  • ExternalNFCToken - NFC Tag contains a password token to authenticate Wi-Fi connection. Uses external program to write * NDEF encapsulation data to the NFC tag using an external program.
  • IntegratedNFCToken - The NFC Tag is integrated in the device.
  • NFCInterface - User has to bring the client close to AP allowing a near field communication between the devices.
  • PushButton - User has to push a button, either an actual or virtual one, on both the access point and the new wireless * client device.
  • PIN - User has to be read the PIN from either a sticker or display on the new wireless device.

Device must support PushButton and PIN methods.

Parameters
[in]ssidIndexThe index of SSID array.
[out]methodsThe WPS supported methods.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 896 of file wifi_client_hal.c.

◆ wifi_getCliWpsConfigMethodsEnabled()

INT wifi_getCliWpsConfigMethodsEnabled ( INT  ssidIndex,
CHAR *  output_string 
)

This function indicates WPS configuration methods enabled on the device.

The API provides the comma-separated list of strings. Each list item MUST be a member of the list reported by the ConfigMethodsSupported parameter.

Parameters
[in]ssidIndexThe index of SSID array.
[out]output_stringThe current WPS method.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 909 of file wifi_client_hal.c.

◆ wifi_setCliWpsConfigMethodsEnabled()

INT wifi_setCliWpsConfigMethodsEnabled ( INT  ssidIndex,
CHAR *  methodString 
)

This API sets the active WPS method.

Parameters
[in]ssidIndexThe index of SSID array.
[in]methodStringThe method to enable.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 920 of file wifi_client_hal.c.

◆ wifi_getCliWpsConfigurationState()

INT wifi_getCliWpsConfigurationState ( INT  ssidIndex,
CHAR *  output_string 
)

This API is used to get the WPS config status, whether "configured" or "not configured".

Parameters
[in]ssidIndexThe index of SSID array
[in]output_stringThe output paramter which holds the wps config status.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 931 of file wifi_client_hal.c.

◆ wifi_setCliWpsEnrolleePin()

INT wifi_setCliWpsEnrolleePin ( INT  ssidIndex,
CHAR *  EnrolleePin 
)

This API sets the PIN to connect. User get the EnrolleePin (device pin from AP device) give to hostapd for pairing.

Parameters
[in]ssidIndexThe index of SSID array.
[in]EnrolleePinPIN code to connect to the access point.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 937 of file wifi_client_hal.c.

◆ wifi_setCliWpsButtonPush()

INT wifi_setCliWpsButtonPush ( INT  ssidIndex)

Start the Push button pairing.

Parameters
[in]ssidIndexThe index of SSID array.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 1295 of file wifi_client_hal.c.

◆ wifi_cancelCliWPS()

INT wifi_cancelCliWPS ( INT  ssidIndex)

Stop the WPS process.

Parameters
[in]ssidIndexThe index of SSID array.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

◆ wifi_connectEndpoint()

INT wifi_connectEndpoint ( INT  ssidIndex,
CHAR *  AP_SSID,
wifiSecurityMode_t  AP_security_mode,
CHAR *  AP_security_WEPKey,
CHAR *  AP_security_PreSharedKey,
CHAR *  AP_security_KeyPassphrase,
int  saveSSID,
CHAR *  eapIdentity,
CHAR *  carootcert,
CHAR *  clientcert,
CHAR *  privatekey 
)

This API starts the connection process from client with an AP.

It uses the input parameters to connect using a supported security method and encryption standard. The security methods can make use of passphrase, public/private key pairs etc.

Parameters
[in]ssidIndexThe index of SSID array.
[in]AP_SSIDThe ssid to connect.
[in]AP_security_modeThe security mode to use.
[in]AP_security_WEPKeyThe wep key.
[in]AP_security_PreSharedKeyThe pre shared key.
[in]AP_security_KeyPassphraseThe key passphrase.
[in]saveSSIDOption to save profile in wpa supplicant.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 1348 of file wifi_client_hal.c.

◆ wifi_disconnectEndpoint()

INT wifi_disconnectEndpoint ( INT  ssidIndex,
CHAR *  AP_SSID 
)

This API disconnects the access point specified.

Parameters
[in]ssidIndexThe index of SSID array.
[in]AP_SSIDThe ssid to disconnect.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 1666 of file wifi_client_hal.c.

◆ wifi_disconnectEndpoint_callback_register()

void wifi_disconnectEndpoint_callback_register ( wifi_disconnectEndpoint_callback  callback_proc)

Callback registration function.

Parameters
[in]callback_procthe callback function to disconnect the client.

Definition at line 244 of file wifi_client_hal.c.

◆ wifi_connectEndpoint_callback_register()

void wifi_connectEndpoint_callback_register ( wifi_connectEndpoint_callback  callback_proc)

Callback registration function.

Parameters
[in]callback_procThe callback function to connect the client to the access point.

Definition at line 238 of file wifi_client_hal.c.

◆ wifi_telemetry_callback_register()

void wifi_telemetry_callback_register ( wifi_telemetry_ops_t telemetry_ops)
Parameters
[in]telemetry_opsTelemetry callback functions

Definition at line 250 of file wifi_client_hal.c.

◆ wifi_lastConnected_Endpoint()

INT wifi_lastConnected_Endpoint ( wifi_pairedSSIDInfo_t pairedSSIDInfo)

This call will give the last saved AP's ssid.

Parameters
[out]pairedSSIDInfoStructure which holds the last connected access point information.
Returns
The status of the operation.
Return values
RETURN_OKreturns O if successful, appropriate error code otherwise.

Definition at line 1555 of file wifi_client_hal.c.