Flight Mode / Wireless Off
[Networking Services]


Detailed Description

Flight Mode (aka "Wireless Off" Mode), a system wide shortcut to turn on/off wireless engines (Telephony, Bluetooth, WiFi ...).

Flight mode is a simple API to grant applications or components to propose a shortcut to cut any wireless engine available on a device (Bluetooth, WiFi, Telephony) everywhere we have to cut such devices (hospitals, theatres, planes, ...)

aka Wireless Off Mode


Functions

void alp_flightmode_broadcast_change (void)
gboolean alp_flightmode_can_activate_wireless_silent_mode (GtkWindow *windowParentP, char *wirelessComponentNameP, gboolean force)
void alp_flightmode_change_wireless_silent_mode (GtkWindow *windowParentP, AlpFlightModeExternalStoragePtr external_storage_ptr)
void alp_flightmode_close_dialogs (AlpFlightModeExternalStoragePtr external_storage_ptr)
void alp_flightmode_enabler_state_confirmation (gboolean wireless_off_state, gboolean enabler_state)
alp_status_t alp_flightmode_fini (AlpFlightModeExternalStoragePtr *external_storage_ptr)
gboolean alp_flightmode_get_pending (AlpFlightModeExternalStoragePtr external_storage_ptr)
alp_status_t alp_flightmode_init (AlpFlightModeExternalStoragePtr *external_storage_ptr)
gboolean alp_flightmode_installed (char *version, size_t size)
alp_status_t alp_flightmode_register_callbacks (AlpFlightModeExternalStoragePtr external_storage_ptr)
alp_status_t alp_flightmode_unregister_callbacks (AlpFlightModeExternalStoragePtr external_storage_ptr)
alp_status_t alp_flightmode_wireless_active_all (AlpFlightModeExternalStoragePtr external_storage_ptr, gboolean notify)
alp_status_t alp_flightmode_wireless_deactive_all (AlpFlightModeExternalStoragePtr external_storage_ptr, gboolean notify)
alp_status_t alp_flightmode_wireless_enabler_get_activity (AlpFlightModeExternalStoragePtr external_storage_ptr, uint32_t enablerId, gboolean *state)
alp_status_t alp_flightmode_wireless_enabler_set_activity (AlpFlightModeExternalStoragePtr external_storage_ptr, uint32_t enablerId, gboolean state, gboolean notify)
alp_status_t alp_flightmode_wireless_restore_all (AlpFlightModeExternalStoragePtr external_storage_ptr, gboolean notify)
gboolean alp_flightmode_wireless_silent_get_mode (void)


Function Documentation

void alp_flightmode_broadcast_change void   ) 
 

Broadcast "has changed" notification

Should be used only once to notify a change. Should never be used under normal condition.

Should be used only by component that knows how Flight mode operates.

Parameters:
[in] external_storage_ptr externally allocated calling alp_flightmode_engine_init() or NULL
[in] previous_state previous flight mode / wireless off state
Returns:
error code

gboolean alp_flightmode_can_activate_wireless_silent_mode GtkWindow *  windowParentP,
char *  wirelessComponentNameP,
gboolean  force
 

Wireless Component Activation Confirmation

Each Wireless component, application, component has to call this function before to active or re-active its wireless engine. (Bluetooth, Wifi, Phone)

When Flight Mode is:

  • Active: a confirmation dialog is shown to users, asking users to confirm or cancel flight mode.

  • Not Active: function returns "true" telling the component can active or reactive itself safely.

Note: The Wireless component, application, component have to take appropriate actions: this function will change "flight mode", it will not change the wanted wireless device state.

Parameters:
[in] windowParentP GTK+ parent window
[in] wirelessComponentNameP Name of the component being activated (informative, should be localized)
[in] force force reactivation without asking for user confirmation (no UI)
Returns:
Tells whether or not user confirmed the activation (true) or cancel it (false).

void alp_flightmode_change_wireless_silent_mode GtkWindow *  windowParentP,
AlpFlightModeExternalStoragePtr  external_storage_ptr
 

Change current Flight Mode / WirelessOff state

When "Flight Mode"/ "WirelessOff" state is :

-Active: Opens the Active Wireless Window, That grants user to activate all wireless components previously active or a new set using checkboxes

-Not active: Opens the Deactive Wireless Window, that grants user to : 1 - Save the state of currently active wireless components 2 - Deactive all wireless components 3 - Shows the Deactive Wireless mode status gadget in the status bar

both cases: set flight mode /Wireless Off appropriately, eventually sending the Has changed notification and progress information

Parameters:
[in] windowParentP GTK+ parent window
[in] external_storage_ptr externally allocated calling alp_flightmode_engine_init() or NULL

void alp_flightmode_close_dialogs AlpFlightModeExternalStoragePtr  external_storage_ptr  ) 
 

Close any opened Fligth Mode dialog

This function should be used when flight mode caller is receiving a VObject or Incoming call as well as any other possible issue when flight mode dialog should be closed

Parameters:
[in] external_storage_ptr externally allocated calling alp_flightmode_engine_init() or NULL

void alp_flightmode_enabler_state_confirmation gboolean  wireless_off_state,
gboolean  enabler_state
 

to be called on ALP_FLIGHTMODE_ENABLER_STATE_CONFIRMATION reception

For Internal Use Only.

Confirm or not last wireless off state changes depending on last enablers states changes the notification is sent by wireless enablers once their received their new state

Sometimes a flight mode enabler plug in cannot respond instantly for states changes activating or deactivating a wireless device.

In this case plug ins have to wait ofor the last wanted chage to be confirmed. This notification should be sent by the code that is waiting for this confirmation.

In the , the flight mode was set accordingly to the original request, this means that when the internal confirmation is received the fligth mode state could be invalidated if one of the wireless component did not succeeded to change.

Parameters:
[in] wireless_off_state current state for wireless mode
[in] enabler_state last enabler state

alp_status_t alp_flightmode_fini AlpFlightModeExternalStoragePtr external_storage_ptr  ) 
 

Free Flight Mode data structure storage kept by caller Should be called by any Flight Mode client that previously initializes an external storage calling alp_flightmode_init(...)

Parameters:
[in,out] external_storage_ptr pointer to storage - mandatory
Returns:
error code

gboolean alp_flightmode_get_pending AlpFlightModeExternalStoragePtr  external_storage_ptr  ) 
 

Retrieve Pending state for each wireless enabler

For Internal Use Only. To be called only by flight mode status gadget.

Parameters:
[in] external_storage_ptr externally allocated calling alp_flightmode_engine_init() or NULL
Returns:
pending state (true or false)

alp_status_t alp_flightmode_init AlpFlightModeExternalStoragePtr external_storage_ptr  ) 
 

Initialize Flight mode data structure in order to be kept by caller

Parameters:
[in,out] external_storage_ptr pointer to storage - mandatory
Returns:
error code

gboolean alp_flightmode_installed char *  version,
size_t  size
 

Check for flight mode / Wireless Off availability

Version can be NULL if client if tou are not interested in checking version. Returns true when flight mode was installed, false if not.

This function should be called before further use of Flight Mode API.

Parameters:
[in] version a storage address for flight version string - can be NULL if you are not interested in getting the version vallue
[in] size tells the size for the sersion string when you are getting version
Returns:
true if flight mode is installed

alp_status_t alp_flightmode_register_callbacks AlpFlightModeExternalStoragePtr  external_storage_ptr  ) 
 

Request flight mode wireless enablers to registers their callbacks

For Internal Use Only. To be called only by flight mode status gadget

Parameters:
[in] external_storage_ptr externally allocated calling alp_flightmode_engine_init() or NULL
Returns:
error code

alp_status_t alp_flightmode_unregister_callbacks AlpFlightModeExternalStoragePtr  external_storage_ptr  ) 
 

Request flight mode wireless enablers to unregister their callbacks

For Internal Use Only.

Flight mode enabler plug ins can register callbacks in case they have to wait for a confirmation when they change their state. (activating or deactivating their wireless device)

To be called only by flight mode status gadget

Parameters:
[in] external_storage_ptr externally allocated calling alp_flightmode_engine_init() or NULL
Returns:
error code

alp_status_t alp_flightmode_wireless_active_all AlpFlightModeExternalStoragePtr  external_storage_ptr,
gboolean  notify
 

active all wireless enablers

set flight mode appropriately, eventually sending the "has changed" notification when "notify" is true

Parameters:
[in] external_storage_ptr externally allocated calling alp_flightmode_engine_init() or NULL
[in] notify do we want to broadcast the "has changed" notification ?
Returns:
error code

alp_status_t alp_flightmode_wireless_deactive_all AlpFlightModeExternalStoragePtr  external_storage_ptr,
gboolean  notify
 

Deactive all wireless enablers

Set flight mode appropriately, eventually sending the "Has changed" notification when "notify" is true

Parameters:
[in] external_storage_ptr externally allocated calling alp_flightmode_engine_init() or NULL
[in] notify do we want to broadcast the "has changed" notification ?
Returns:
error code

alp_status_t alp_flightmode_wireless_enabler_get_activity AlpFlightModeExternalStoragePtr  external_storage_ptr,
uint32_t  enablerId,
gboolean *  state
 

Get wireless enabler current activity

Get current state for a specific enabler given its enabler id.

Standard enabler ids are defined in flight mode header. To insure future compatibility use only the constant defined for enabler ids in flight mode header:

define ALP_FLIGHTMODE_PHONE_ID 0 define ALP_FLIGHTMODE_BLUETOOTH_ID 1 define ALP_FLIGHTMODE_WIFI_ID 2

Parameters:
[in] external_storage_ptr externally allocated calling alp_flightmode_engine_init() or NULL
[in] enablerId enabler key
[in,out] state retrieved state
Returns:
error code

alp_status_t alp_flightmode_wireless_enabler_set_activity AlpFlightModeExternalStoragePtr  external_storage_ptr,
uint32_t  enablerId,
gboolean  state,
gboolean  notify
 

Set wireless enabler activity

Set up the activity for a specific enabler given its enabler id. Standard enabler ids are defined in flight mode header. To insure future compatibility use only the constant defined for enabler ids in flight mode header:

define ALP_FLIGHTMODE_PHONE_ID 0 define ALP_FLIGHTMODE_BLUETOOTH_ID 1 define ALP_FLIGHTMODE_WIFI_ID 2

It broadcasts the has change notification when notify is true.

Parameters:
[in] external_storage_ptr allocated by alp_flightmode_engine_init() or NULL
[in] enablerId enabler key
[in] state new state wanted
[in] notify do we want to broadcast the "has changed" notification?
Returns:
error code

alp_status_t alp_flightmode_wireless_restore_all AlpFlightModeExternalStoragePtr  external_storage_ptr,
gboolean  notify
 

restore all wireless enablers

It uses their previous states saved last time flight mode was deactivated.

If none were saved (aka flight mode / Wireless Off was never activated) then nothing is done (no wireless enablers activates)

Set flight mode / Wireless Off appropriately, eventually sending the "Has changed" notification

Parameters:
[in] external_storage_ptr externally allocated by alp_flightmode_engine_init() or NULL
[in] notify do we want to broadcast the has changed notification
Returns:
error code

gboolean alp_flightmode_wireless_silent_get_mode void   ) 
 

Get Current Flight Mode state

When Flight Mode is:

  • Active: function returns true.

  • Not Active: function returns false.

Returns:
wireless mode state.


Generated on Wed Jul 30 07:06:42 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.