RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
https://etwiki.sys.comcast.net/display/CE/%5bShared%5d+WiFi
https://etwiki.sys.comcast.net/display/APPS/WIFI+Manager+API
In this section we will get an overview on the kind of Wifi support offered by RDK, how WPA supplicant is playing an important role on managing Wifi Driver, event notification and communication to different applications
In RDK we support integrated Wi-Fi chips as well as USB based Wi-Fi adapters. Implementation differences between on board Wi-Fi & USB Wi-Fi adapter are abstracted from Upper layers i.e. application doesn’t know what kind of Wi-Fi device or connection they are accessing.
RDK Wifi uses wpa_supplicant wireless daemon for connection management with the Wi-Fi driver. wpa_supplicant is designed to be a "daemon" that runs in the background and acts as the backend component controlling the wireless connection. wpa_supplicant also offers a control and monitoring interface to handle different wireless commands. Wi-Fi subsystem uses generic drivers such as NL80211 brings in wide range of vendor equipment's under coverage.
RDK Wi-Fi stack extensively uses commonly available Linux wireless utilities which brings most of the USB based and on-chip wireless equipment under our coverage. It provides support for diagnostics and connection management from remote and native applications. It uses IARM, which is a Linux D-BUS based communication protocol for managing Wi-Fi event notification and communication across different applications.
WiFi is a new features that is added in RDK video community devices. Recently Wi-Fi features is added to a Hardware Development (Raspberry Pi) video platform. As of now feature wise almost covered the client and access point related things, and we are continuing to work on remote management and diagnostics functionalities to be included into the Wi-Fi code.
1.Basic Feature wise R-PI Wi-Fi is almost at the same level as that of other RDK platforms.
Main difference that we can derive are:
In RPI:
In Other RDK Platform:
In this section, we will get the details on the architecture, layers, and how different RDK components interact with the wifi driver to enable Core wifi functionality.
Application:
In top of the eco-system we have wide range of application which requires wireless network access. This may be a cloud based UI application, a diagnostics webpage or a console application such as test automation kit which will be required to verify readiness of a new RDK box with respect to different component features. This can be a HTML based webpage or a native console application requesting Wi-Fi functionalities.
Service manager:
Service manager is the contact point between external applications and native RDK. It is present in RDK as a library which when plugged in to a browser such as WPE or Qt enhances its capability to make communication from web applications to native RDK components through Java script. This exposes Java Script as well as native APIs, have decision making ability to route the request to appropriate RDK component.
IARM Message Bus:
RDK provides a common message and event notification mechanism known as IARM which passes the calls from upper layer i.e. service manager to actual network manager. A D-Bus based event and messaging mechanism propagates requests from application layer to lower layers. Sends event notification from Lower (network or HAL) layer to application layer.
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:
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, 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.
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.
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,
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.
Service Manager can be used for a wide range of services but in this context we wlll focus on the wifi service only.
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 List | Descriptions |
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 |
……. | ……. |
Wifi- network manager, which takes several responsibility for managing Wifi in Video device
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.
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.
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 Call | Descriptions |
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.