Versions Compared

Key

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

...

Wi-Fi Network Manager:
      Wi-Fi network manager is a daemon which handles network states and network interfaces. It handles Wireless initialization and management. This maintains the Wi-Fi state machine, initializes Wi-Fi subsystem & manages connection & disconnection events.

Wi-Fi generic HAL:
      Provides It is an Abstraction of Wireless driver calls and various linux wireless utilities to present a set of APIs for common wireless operation. It provides a set of APIs as per RDK specification for connection, management & diagnostic related activities. Abstracts implementation details and SoC dependencies from network management layer.
Linux wireless utility:
     Tools such as wpa_supplicant or , wereless-tools, net-link library, etc. which provides support for most of the common Wi-Fi chips. 

Driver & Firmware:
     Provided by SoC/OEM manufacturer. The kernel space driver and firmware binaries will be provided by Wi-FI SOC or OEM and it should be present in the defined path in the RDK box.

Use Cases

Let us see in what types of network topology one wireless enabled RDK box can operate. We can see two use cases here,
In first case we will see a straight forward network where we will have an IP headend for TV channels, VOD,  etc.

Image Added

  • In the above picture, the data will be received by a RDK Broadband device which will be our entry point to the home network. This will act as a video gateway, an internet router as well as can be a home DVR also. The network connectivity from RDK broadband device to IP headend will be through a high speed network such as fiber optics, etc.
  • From the RDK broadband device, all clients in a home network will receive internet and video data through the wireless network. The RDK broadband device will be the access point and video devices such as Raspberry Pi will act as wifi clients.

In second use case, we wanted to show how a legacy network can be extended to operate with wifi enable devices,
In the figure, we use a RDK Video gateway to receive data from Cable media and relay to a RDK broadband device through MoCA network. In this network topology,

Image Added

RDK client devices will be able to access the QAM channel and DVR from the Video gateway and internet through the broadband device. Video and internet data will be received by the Broadband Device and sent to Wireless clients.

Wi-Fi Service Manager

Service Manager can be used for a wide range of services but in this context we wlll focus on the wifi service only.

  • ServiceManager provides a uniform mechanism for discovering and consuming Wifi service on a target device.
  • It is a Bridge between browser based application and the native RDK.
  • It Provides capability for applications to use wifi services from other applications such as HTML 5, Java scripts, etc.
  • All the service registrations are received by Service Manager and after registration, it announces the service availability to interested applications.
  • It is one of the well-known facility for cloud-based applications to gain access to device vended functionality.
  • Here the advantage is , applications need not know which other component are providing which type of services.
  • Service manager provides some callback method which is basically for handling asynchronous events that is sent through other applications.
  • for example events such as connecting to AP or disconnected from AP are generated by wifi Manager and sent to service manager.

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

  • It dynamically detect the Network interfaces, send notifications to subscribers
  • Supports diagnostics both local and cloud based applications
  • Setup and update the network routes based on priorities, wifi connection status, availability, etc
  • It also Listen to home networking updates to determine the routes for which communication to be established in outside world
  • It provide Modular approach to add/remove new network interface types and also provide support for configuring routing rules

Lets see how network manager works when a RDK device boots up, On bootup, network service manager reads a configuration file to check what all network interfaces are supported on current set-top box and accordingly it initializes and bring-up the corresponding subsystems such as wifi, moca, or Ethernet. It also sets the telemetry parameters such as logging interval and decide what information need to be logged according to the configuration sets by the user.

The WIFI Manager API provides support to client applications that wish to enable WIFI communications on a STB.

  • It Provide API to Initialize the wifi driver and runs the linux wireless daemon
  • Provides API to configure WiFi SSID and password, it is required for video device to to connect to the Access Point.
  • It provide facility to immediately try to connect to WiFi network with provided SSID and password when API is invoked.
  • It also Provides response to caller to indicate whether or not WiFi network connection was successfully established.
  • Provides API to clear previously configured SSID and password.
  • Stores/Saves WiFi SSID and password in persistent memory, which will help in automatically connecting to the AP after box reboots. 
  • Enumerates via API the available broadcasting SSIDs.
  • Wifi Manager automatically tries to connect to paired Wifi network on startup

Another important feature of the network manager is to notify other application or other listeners when a major event occurs with the Wi-Fi sub-system
Here the event may of following types.

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

IARMBus 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:
•Here we can see that for each of the possible Wi-Fi Events, we have defined a IARM Call.
•For example, we have  some remote procedure calls, which can be invoked from any application to perform some Wi-Fi related operation.
•These operation may be to get the list of available network or to connect to a particular wifi network, etc.
•IARM Events:
•Basically we have 2 types of events for Wifi Manager notifications.
1.State change notifications
•WIFI_CONNECTING : When a connection is initiated the state will change from IDEAL to CONNECTING.
•WIFI_FAILED : When a connection attempt is failed.
•WIFI_DISCONNECTED : When a AP is disconnected from client.
•WIFI_CONNECTED : This will be notified after a successful connection.
2.Error events:
•WIFI_NO_SSID: The Access point we wanted to connect is no longer available.
•WIFI_UNKNOWN : Unknown error has happened.
•WIFI_CONNECTION_LOST : connection is lost, this may indicate that an AP is no longer in range.
•WIFI_SSID_CHANGED : this indicates that we have connected to another SSID
•WIFI_CONNECTION_FAILED : When the connection is failed, it may be because of invalid credential or any other issue.
•WIFI_CONNECTION_INTERRUPTED : Connection is cancelled by user when it was in progress.

Wi-Fi Integration requirement

...