IBatteryNotifier is the notifier class with which applications can register for battery notifications in following ways:
1. Using application MIF 2. Using ISHELL_RegisterNotify()
Applications are not required and can't create an instance of IBatteryNotifier.
Following are the notification masks supported by IBatteryNotifier:
#define NMASK_BATTERY_STATUS_CHANGE 0x0001 An EVT_NOTIFY event with NMASK_BATTERY_STATUS_CHANGE mask is sent when there is a change in the battery status as reported by IBATTERY_GetBatteryStatus(). ((AEENotify*)dwParam)->pData contains the new battery status. Note: A battery status of AEEBATTERY_STATUS_POWERDOWN may occur even when external power is present, if external power fails to provide sufficient power to maintain a voice call. #define NMASK_BATTERY_LEVEL_CHANGE 0x0002 An EVT_NOTIFY event with NMASK_BATTERY_LEVEL_CHANGE mask is sent when there is a change in the battery level as reported by IBATTERY_GetBatteryLevel(). ((AEENotify*)dwParam)->pData contains the new battery level. #define NMASK_BATTERY_CHARGERSTATUS_CHANGE 0x0004 An EVT_NOTIFY event with NMASK_BATTERY_CHARGERSTATUS_CHANGE mask is sent when there is a change in the battery charger status as reported by IBATTERY_GetBatteryChargerStatus(). ((AEENotify*)dwParam)->pData contains the new battery charger status. #define NMASK_BATTERY_EXTPWR_CHANGE 0x0008 An EVT_NOTIFY event with NMASK_BATTERY_EXTPWR_CHANGE mask is sent when there is a change in the external power state. ((AEENotify*)dwParam)->pData is TRUE if external power is currently present and is FALSE if external power is currently not present.
An AppA with class ID AEECLSID_APPA can register for NMASK_BATTERY_EXTPWR_CHANGE notification with the help of ISHELL_RegisterNotify as shown below -
ISHELL_RegisterNotify(pIShell, AEECLSID_APPA, AEECLSID_BATTERYNOTIFIER, NMASK_BATTERY_EXTPWR_CHANGE);
Whenever there is change in the external power state, AppA will receive an event EVT_NOTIFY as the notification for change in the external power state.