wifi_aggregator_register()

Register the application as a hotspot aggregator.

Synopsis:

#include <wifi/wifi_service.h>
 
WIFI_API wifi_result_t wifi_aggregator_register(wifi_service_t *wifi_service, wifi_aggregator_t **aggregator, const char *aggregator_name, bool refresh)

Arguments:

wifi_service

The Wi-Fi service handle.

aggregator

Pointer that will be set to an aggregator struct.

aggregator_name

The aggregator name to be used also as the profile name.

refresh

Flag indicating if this is the first registration attempt.

Library:

libwifi

Description:

This function registers the calling application with the Wi-Fi service library as an aggregator application. Certain events and APIs are only applicable to aggregator applications that configure profiles for the purpose of connecting on behalf of the user.

Applications must be registered prior to calling any other aggregator APIs.

If the BlackBerry device is not connected as a station to an access point (AP), scans are triggered internally by the Wi-Fi connection manager at regular intervals. When scan results are available, they will be passed to applications that receive events from the Wi-Fi service library.

The refresh parameter indicates if this is the first time the application has tried to register. If so, set refresh to false. A new empty profile is created and saved. This profile is displayed to the user as disabled and uneditable. When the application determines that there is a network it wishes to connect to (based on scan results received), the app can use one of the following functions to populate the profile:

The aggregator_name parameter is used as the UI display name for the aggregator profile, indicating to the user that an aggregator application is registered. If the name is a duplicate of an existing saved profile and refresh is false, WIFI_ERROR_AGGREGATOR_DUPLICATE is returned. If refresh is true, a check for a matching aggregator_name profile is performed. If not found, WIFI_ERROR_INVALID_PARAMETERS is returned. Otherwise, the aggregator recovers its prior profile, which is disabled at registration but can be queried or enabled by the application.

An application may register only once and must use the same aggregator_name on refresh of its registration. The Wi-Fi connection manager maintains only a single Wi-Fi profile for this aggregator at any one time, and the aggregator can use the above functions to change the profile if needed.

Returns:

A return code from wifi_result_t.

Last modified: 2013-12-21

comments powered by Disqus