Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Some of major API details are provided which is available under the header include/services/wifimanagerservice.h. Generally in case of each service, there are two common API for registering and un-registering particular service. When we register a service, we are making it available to the other application. And when we un-register it will no longer be accessible to the upper layer application.

  

Service Manager API ListDescriptions

WifiManagerService()

Constructor, which will register for Wi-Fi service

WifiManagerService::registerForEvents()

Register events for Wi-Fi manager service.

WifiManagerService::unregisterEvents()

Unregister events for Wi-Fi manager service

WifiManagerService::notifyEvent()

Notify the events received from netSrvMgr.

WifiManagerService::getAvailableSSIDs()

Retrieves the array of strings representing SSIDs

WifiManagerService::getCurrentState()

Retrieves the current state

WifiManagerService::getPairedSSID()

Returns the paired SSIDs as string

WifiManagerService::connect()

Connect with given or saved SSID and passphrase

…….

…….

Wi-Fi Network Manager

Wifi- network manager, which takes several responsibility for managing Wifi in Video device

...

  • Any state change that either the state changed from Connected to Disconnected or Vice Versa.
  • when settop boots with WiFi capability.
  • when WiFi network is successfully established.
  • when connection to WiFi network is lost.
  • when WiFi driver failure is detected.
  • By notifying about all the discussed events, it helps the other application to do some decision making or display some information in the screen.
  • For example, when a video is being played from internet and in-between wireless connection is lost.
  • In this case the video player will receive a disconnection event from the network manager and can show on screen error message.


Wi-Fi Network Manager - IARM Event & Calls

Lets see how the event notification mechanism works. Basically all the event related activity are done through a D-Bus messaging extension known as IARM. In our case the network manager will register few event names and their corresponding event handler function. When an application is interested to receive that event, he will be register as a listen to that event. Whenever the event occurs all the register listener that are connected to IARM will be able to receive the notification.

IARM CallDescriptions

IARM_BUS_WIFI_MGR_API_getAvailableSSIDs

Retrieves the List of available APs

IARM_BUS_WIFI_MGR_API_getConnectedSSID

Returns the properties of the currently connected SSID

IARM_BUS_WIFI_MGR_API_setEnabled

Enable the WIFI adapter on the box

IARM_BUS_WIFI_MGR_API_connect

Connect with given or saved SSID and passphrase

IARM_BUS_WIFI_MGR_API_getConnectionType

Retrieves the type based on active network interface

IARM_BUS_WIFI_MGR_API_getRadioStatsProps

Retrieve the get radio stats properties


IARM Call implementation:

...

RDK Wifi Specification mentions, all communication from network manager to the Wifi Driver has to be through WPA supplicant. So the basic requirement is to add WPA supplicant and its related packages such as netlink library and wireless tools. When all the dependency are added to the platform, we have to write a Wi-Fi HAL customized in our platform. Then we have to add the Wifi support in build framework via adding appropriate packages in image recipe as well as machine configuration file.

Code Walk-through in RPI Platform

Folder structure

Image Added

Looking at the below folder structure of the wifi HAL code in reference wifi & device specific wifi, We can see both follow similar naming conventions. We have 2 common files: wifi_common_hal.c and wifi_client_hal.c

...

  • It Mainly defines the internal state management functions, threads for monitoring the events coming from wpa_supplicant and connection related functions.
  • It also defines call back functions for sending back the state changes and error events to wifi manager
  • In generic wifi HAL, we have 3 header functions for defining AP, client & common APIs.
  • In Raspberry Pi, the device specific HAL has dependency of WPA client library and libnl.

...

Wi-Fi HAL APIs

TODO

Debugging and Log analysis

...