Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

Notification Manager


Data Structures

struct  _AlpNotifyLaunch

Defines

#define ALP_NOTIFY_EVENT_NOTIFY_REGISTER   "/alp/notify/register/"
 notification type: register notification
#define ALP_NOTIFY_EVENT_NOTIFY_INSTALL   "/alp/notify/install/"
 notification type: install notification (deprecated, please use ALP_NOTIFY_EVENT_NOTIFY_REGISTER)
#define ALP_NOTIFY_EVENT_NOTIFY_BOOT   "/alp/notify/boot/"
 notification type: boot notification
#define ALP_NOTIFY_MAX_NOTIFY_SIZE   128
 maximum size of the notification type
#define ALP_NOTIFY_MAX_DETAILS_SIZE   256
 maximum size of the notification specific data
#define ALP_NOTIFY_MAX_APPID_SIZE   64
 maximum size of the appIDs
#define ALP_NOTIFY_LAUNCH_DETAILS   "--alp-notify-details="
 command line parameter containing encoded notification details AlpNotifyLaunch
#define ALP_NOTIFY_LAUNCH_TYPE   "--alp-notify-type="
 command line parameter containing notification type
#define ALP_NOTIFY_PRIORITY_HIGH   10
 register priority: high priority notification
#define ALP_NOTIFY_PRIORITY_NORMAL   0
 register priority: normal priority notification
#define ALP_NOTIFY_PRIORITY_LOW   -10
 register priority: low priority notification
#define ALP_NOTIFY_REGISTER_FLAG_DONTSAVE   0x01
 register flags: don't save app registration (don't persist across resets)
#define ALP_NOTIFY_REGISTER_FLAG_ONETIME   0x02
 register flags: automatic unregister after first use
#define ALP_NOTIFY_QUEUE_DEFAULT   0x01
 broadcast queue: default broadcast queue
#define ALP_NOTIFY_QUEUE_STATUSGADGET   0x02
 broadcast queue: status gadget broadcast queue
#define ALP_NOTIFY_BROADCAST_FLAG_IMMEDIATE   0x01
 broadcast flags: added the broadcast to the front of the queue
#define ALP_NOTIFY_BROADCAST_FLAG_SYNC   0x02
 broadcast flags: sync broadcast, block until apps have been notified
#define ALP_NOTIFY_CALLBACK_CONTINUE   0x00
 continue the current broadcast
#define ALP_NOTIFY_CALLBACK_CANCEL   0x01
 cancel the current broadcast
#define ALP_NOTIFY_CALLBACK_COMPLETED_ALREADY   0x02
 already called the completion routine
#define ALP_NOTIFY_ERR_OUT_OF_MEMORY   (ALP_CLASS_NOTIFY | 0x00010000)
 error code: out of memory
#define ALP_NOTIFY_ERR_INVALID_CALLBACK   (ALP_CLASS_NOTIFY | 0x00020000)
 error code: invalid callback
#define ALP_NOTIFY_ERR_INVALID_APPID   (ALP_CLASS_NOTIFY | 0x00030000)
 error code: invalid appID
#define ALP_NOTIFY_ERR_INVALID_QUEUE   (ALP_CLASS_NOTIFY | 0x00040000)
 error code: invalid queue
#define ALP_NOTIFY_ERR_INVALID_PRIORITY   (ALP_CLASS_NOTIFY | 0x00050000)
 error code: invalid priority
#define ALP_NOTIFY_ERR_INVALID_NOTIFYTYPE   (ALP_CLASS_NOTIFY | 0x00060000)
 error code: invalid notification type
#define ALP_NOTIFY_ERR_INVALID_LENGTH   (ALP_CLASS_NOTIFY | 0x00070000)
 error code: invalid length
#define ALP_NOTIFY_ERR_INVALID_CMD   (ALP_CLASS_NOTIFY | 0x00080000)
 error code: invalid command
#define ALP_NOTIFY_ERR_NOT_REGISTERED   (ALP_CLASS_NOTIFY | 0x00090000)
 error code: not registered
#define ALP_NOTIFY_ERR_ALREADY_REGISTERED   (ALP_CLASS_NOTIFY | 0x000a0000)
 error code: already registered
#define ALP_NOTIFY_ERR_TOO_MANY_REGISTRATIONS   (ALP_CLASS_NOTIFY | 0x000b0000)
 error code: too many registrations
#define ALP_NOTIFY_ERR_TOO_MANY_BROADCASTS   (ALP_CLASS_NOTIFY | 0x000c0000)
 error code: too many active broadcasts
#define ALP_NOTIFY_ERR_ACTIVE_BROADCAST   (ALP_CLASS_NOTIFY | 0x000d0000)
 error code: active broadcast
#define ALP_NOTIFY_ERR_IPC   (ALP_CLASS_NOTIFY | 0x000e0000)
 error code: alp ipc
#define ALP_NOTIFY_ERR_TIMEOUT   (ALP_CLASS_NOTIFY | 0x000f0000)
 error code: sync broadcast timed out
#define ALP_NOTIFY_ERR_PERMISSION_DENIED   (ALP_CLASS_NOTIFY | 0x00100000)
 error code: permission denied
#define ALP_NOTIFY_PRIORITY_HIGHEST   110
 register priority: highest priority notification
#define ALP_NOTIFY_PRIORITY_LOWEST   -110
 register priority: lowest priority notification
#define ALP_NOTIFY_BROADCAST_FORCE   0x100
 broadcast flags: override any limits
#define ALP_NOTIFY_REGISTER_FORCE   0x100
 register flags: override any limits

Typedefs

typedef _AlpNotifyLaunch AlpNotifyLaunch
typedef int( AlpNotifyCallbackProc )(const char *notifyType, void *details, int length, int *handled, const char *appID, void *userData)

Functions

alp_status_t alp_notify_register_server (const char *notifyType, AlpNotifyCallbackProc *callbackProc, void *userData, int priority, int flags)
alp_status_t alp_notify_register (const char *appID, const char *notifyType, int priority, int flags)
alp_status_t alp_notify_unregister (const char *appID, const char *notifyType, int flags)
alp_status_t alp_notify_unregister_server (const char *notifyType, int flags)
alp_status_t alp_notify_broadcast (const char *appID, const char *notifyType, const void *details, int length, int queue, int flags)
alp_status_t alp_notify_broadcast_sync (const char *appID, const char *notifyType, const void *details, int length, int queue, int flags, int timeout, int *handled)
alp_status_t alp_notify_done (const char *appID, int handled, int status)
int alp_notify_details (const char *src, AlpNotifyLaunch *dst)


Define Documentation

#define ALP_NOTIFY_BROADCAST_FLAG_IMMEDIATE   0x01
 

broadcast flags: added the broadcast to the front of the queue

#define ALP_NOTIFY_BROADCAST_FLAG_SYNC   0x02
 

broadcast flags: sync broadcast, block until apps have been notified

#define ALP_NOTIFY_BROADCAST_FORCE   0x100
 

broadcast flags: override any limits

#define ALP_NOTIFY_CALLBACK_CANCEL   0x01
 

cancel the current broadcast

#define ALP_NOTIFY_CALLBACK_COMPLETED_ALREADY   0x02
 

already called the completion routine

#define ALP_NOTIFY_CALLBACK_CONTINUE   0x00
 

continue the current broadcast

#define ALP_NOTIFY_ERR_ACTIVE_BROADCAST   (ALP_CLASS_NOTIFY | 0x000d0000)
 

error code: active broadcast

#define ALP_NOTIFY_ERR_ALREADY_REGISTERED   (ALP_CLASS_NOTIFY | 0x000a0000)
 

error code: already registered

#define ALP_NOTIFY_ERR_INVALID_APPID   (ALP_CLASS_NOTIFY | 0x00030000)
 

error code: invalid appID

#define ALP_NOTIFY_ERR_INVALID_CALLBACK   (ALP_CLASS_NOTIFY | 0x00020000)
 

error code: invalid callback

#define ALP_NOTIFY_ERR_INVALID_CMD   (ALP_CLASS_NOTIFY | 0x00080000)
 

error code: invalid command

#define ALP_NOTIFY_ERR_INVALID_LENGTH   (ALP_CLASS_NOTIFY | 0x00070000)
 

error code: invalid length

#define ALP_NOTIFY_ERR_INVALID_NOTIFYTYPE   (ALP_CLASS_NOTIFY | 0x00060000)
 

error code: invalid notification type

#define ALP_NOTIFY_ERR_INVALID_PRIORITY   (ALP_CLASS_NOTIFY | 0x00050000)
 

error code: invalid priority

#define ALP_NOTIFY_ERR_INVALID_QUEUE   (ALP_CLASS_NOTIFY | 0x00040000)
 

error code: invalid queue

#define ALP_NOTIFY_ERR_IPC   (ALP_CLASS_NOTIFY | 0x000e0000)
 

error code: alp ipc

#define ALP_NOTIFY_ERR_NOT_REGISTERED   (ALP_CLASS_NOTIFY | 0x00090000)
 

error code: not registered

#define ALP_NOTIFY_ERR_OUT_OF_MEMORY   (ALP_CLASS_NOTIFY | 0x00010000)
 

error code: out of memory

#define ALP_NOTIFY_ERR_PERMISSION_DENIED   (ALP_CLASS_NOTIFY | 0x00100000)
 

error code: permission denied

#define ALP_NOTIFY_ERR_TIMEOUT   (ALP_CLASS_NOTIFY | 0x000f0000)
 

error code: sync broadcast timed out

#define ALP_NOTIFY_ERR_TOO_MANY_BROADCASTS   (ALP_CLASS_NOTIFY | 0x000c0000)
 

error code: too many active broadcasts

#define ALP_NOTIFY_ERR_TOO_MANY_REGISTRATIONS   (ALP_CLASS_NOTIFY | 0x000b0000)
 

error code: too many registrations

#define ALP_NOTIFY_EVENT_NOTIFY_BOOT   "/alp/notify/boot/"
 

notification type: boot notification

#define ALP_NOTIFY_EVENT_NOTIFY_INSTALL   "/alp/notify/install/"
 

notification type: install notification (deprecated, please use ALP_NOTIFY_EVENT_NOTIFY_REGISTER)

#define ALP_NOTIFY_EVENT_NOTIFY_REGISTER   "/alp/notify/register/"
 

notification type: register notification

#define ALP_NOTIFY_LAUNCH_DETAILS   "--alp-notify-details="
 

command line parameter containing encoded notification details AlpNotifyLaunch

#define ALP_NOTIFY_LAUNCH_TYPE   "--alp-notify-type="
 

command line parameter containing notification type

#define ALP_NOTIFY_MAX_APPID_SIZE   64
 

maximum size of the appIDs

#define ALP_NOTIFY_MAX_DETAILS_SIZE   256
 

maximum size of the notification specific data

#define ALP_NOTIFY_MAX_NOTIFY_SIZE   128
 

maximum size of the notification type

#define ALP_NOTIFY_PRIORITY_HIGH   10
 

register priority: high priority notification

#define ALP_NOTIFY_PRIORITY_HIGHEST   110
 

register priority: highest priority notification

#define ALP_NOTIFY_PRIORITY_LOW   -10
 

register priority: low priority notification

#define ALP_NOTIFY_PRIORITY_LOWEST   -110
 

register priority: lowest priority notification

#define ALP_NOTIFY_PRIORITY_NORMAL   0
 

register priority: normal priority notification

#define ALP_NOTIFY_QUEUE_DEFAULT   0x01
 

broadcast queue: default broadcast queue

#define ALP_NOTIFY_QUEUE_STATUSGADGET   0x02
 

broadcast queue: status gadget broadcast queue

#define ALP_NOTIFY_REGISTER_FLAG_DONTSAVE   0x01
 

register flags: don't save app registration (don't persist across resets)

#define ALP_NOTIFY_REGISTER_FLAG_ONETIME   0x02
 

register flags: automatic unregister after first use

#define ALP_NOTIFY_REGISTER_FORCE   0x100
 

register flags: override any limits


Typedef Documentation

typedef int( AlpNotifyCallbackProc)(const char *notifyType, void *details, int length, int *handled, const char *appID, void *userData)
 

Notification handler callback

Parameters:
[in] notifyType the type of notification (card inserted, vfs mounted, etc)
[in] details notification specific data
[in] length size of notification specific data
[in,out] handled advisory handled flag. Notification handlers can set an advisory handled flag indicating that the notification has been handled. Setting the handled flags does not cancel notification but rather informs subsequent handlers that the notification has already been handled. The value of the handled flag is only valid for a single instance of the notification (that is the value is not passed on to the next broadcast of the same notification).
[in] appID application that broadcasted the notification
[in] userData pointer to user data supplied at the registration of the callback
Returns:
ALP_NOTIFY_CALLBACK_CONTINUE continue

ALP_NOTIFY_CALLBACK_CANCEL cancel this broadcast

ALP_NOTIFY_CALLBACK_COMPLETED_ALREADY completion has already been called (don't call again)

typedef struct _AlpNotifyLaunch AlpNotifyLaunch
 

notification launch data


Function Documentation

alp_status_t alp_notify_broadcast const char *  appID,
const char *  notifyType,
const void *  details,
int  length,
int  queue,
int  flags
 

broadcasts the specified notification

Parameters:
[in] appID application that broadcasts the notification the notification (must be non-null)
[in] notifyType the type of notification (card inserted, vfs mounted, etc) (must be non-null)
[in] details notification specific data
[in] length size of notification specific data
[in] queue broadcast queue (use ALP_NOTIFY_QUEUE_DEFAULT as the default) (must be non-zero)
[in] flags (0 for default and see ALP_NOTIFY_BROADCAST_IMMEDIATE and ALP_NOTIFY_BROADCAST_FLAG_SYNC to change the default behavior)
Returns:
ALP_OK success

ALP_NOTIFY_ERR_OUT_OF_MEMORY out of memory to perform the broadcast

ALP_NOTIFY_ERR_INVALID_APPID invalid appID

ALP_NOTIFY_ERR_INVALID_NOTIFYTYPE invalid notifyType

ALP_NOTIFY_ERR_INVALID_LENGTH invalid length

ALP_NOTIFY_ERR_INVALID_QUEUE invalid queue

ALP_NOTIFY_ERR_TOO_MANY_BROADCASTS too many active broadcasts

ALP_NOTIFY_ERR_IPC ipc error

Remarks:
The default behavior is to broadcast each queue in a serial FIFO order. Using the ALP_NOTIFY_BROADCAST_FLAG place the broadcast at the front of the queue. Different broadcast queues are broadcast in parallel.

Use ALP_NOTIFY_BROADCAST_FLAG_SYNC to block until the all registered clients have been notified. Also see the alp_notify_broadcast_sync() API to block with a specified timeout or to get the handled flag. The default behavior is to not block.

alp_status_t alp_notify_broadcast_sync const char *  appID,
const char *  notifyType,
const void *  details,
int  length,
int  queue,
int  flags,
int  timeout,
int *  handled
 

broadcasts the specified notification synchronously

Parameters:
[in] appID application that broadcasts the notification the notification (must be non-null)
[in] notifyType the type of notification (card inserted, vfs mounted, etc) (must be non-null)
[in] details notification specific data
[in] length size of notification specific data
[in] queue broadcast queue (use ALP_NOTIFY_QUEUE_DEFAULT as the default) (must be non-zero)
[in] flags (0 for default and see ALP_NOTIFY_BROADCAST_IMMEDIATE to change the default behavior)
[in] timeout timeout in seconds, use 0 for infinite timeout
[out] handled value of the handled flag
Returns:
ALP_OK success

ALP_NOTIFY_ERR_OUT_OF_MEMORY out of memory to perform the broadcast

ALP_NOTIFY_ERR_INVALID_APPID invalid appID

ALP_NOTIFY_ERR_INVALID_NOTIFYTYPE invalid notifyType

ALP_NOTIFY_ERR_INVALID_LENGTH invalid length

ALP_NOTIFY_ERR_INVALID_QUEUE invalid queue

ALP_NOTIFY_ERR_TOO_MANY_BROADCASTS too many active broadcasts

ALP_NOTIFY_ERR_IPC ipc error

ALP_NOTIFY_ERR_TIMEOUT timed out

Remarks:
The default behavior is to broadcast each queue in a serial FIFO order. Using the ALP_NOTIFY_BROADCAST_FLAG place the broadcast at the front of the queue. Different broadcast queues are broadcast in parallel.

int alp_notify_details const char *  src,
AlpNotifyLaunch dst
 

decodes argv details parameter

Parameters:
[in] src argv encoded AlpNotifyLaunch launch data
[out] dst decoded AlpNotifyLaunch launch data
Returns:
number of bytes

alp_status_t alp_notify_done const char *  appID,
int  handled,
int  status
 

notification handler completion routine for applications

Parameters:
[in] appID application that broadcasts the notification the notification (may be null)
[in] handled handled flag
[in] status status of the notification
Returns:
ALP_OK success

ALP_NOTIFY_ERR_OUT_OF_MEMORY out of memory to perform the completion

ALP_NOTIFY_ERR_INVALID_APPID invalid appID

ALP_NOTIFY_ERR_IPC ipc error

Remarks:
appID maybe be null to specific the current running application.

alp_status_t alp_notify_register const char *  appID,
const char *  notifyType,
int  priority,
int  flags
 

Registers an application to receive the specified notification

Parameters:
[in] appID application to receive the notification (must be non-null)
[in] notifyType the type of notification (card inserted, vfs mounted, etc) (must be non-null)
[in] priority priority in which the receiver is called (default is ALP_NOTIFY_PRIORITY_NORMAL)
[in] flags (0 for default and see ALP_NOTIFY_REGISTER_DONTSAVE and ALP_NOTIFY_REGISTER_FLAG_ONETIME to change the default behavior)
Returns:
ALP_OK success

ALP_NOTIFY_ERR_OUT_OF_MEMORY out of memory to perform the register

ALP_NOTIFY_ERR_INVALID_APPID invalid appID

ALP_NOTIFY_ERR_INVALID_NOTIFYTYPE invalid notifyType

ALP_NOTIFY_ERR_INVALID_PRIORITY invalid priority

ALP_NOTIFY_ERR_ALREADY_REGISTERED specified appID and notifyType is already registered

ALP_NOTIFY_ERR_TOO_MANY_REGISTRATIONS too many registered registrations

ALP_NOTIFY_ERR_IPC ipc error

Remarks:
The default behavior is that the registration is persistent until the device hard resets or the notification is unregistered (see flags to change the default behavior). The application is launch or relaunched to handle the notification.

alp_status_t alp_notify_register_server const char *  notifyType,
AlpNotifyCallbackProc callbackProc,
void *  userData,
int  priority,
int  flags
 

Registers to receive the specified notification

Parameters:
[in] notifyType the type of notification (card inserted, vfs mounted, etc) (must be non-null)
[in] callbackProc function pointer to callback function for running process (must be non-null)
[in] userData user supplied data pointer to be used by callback function (may be NULL)
[in] priority priority in which the receiver is called (default is ALP_NOTIFY_PRIORITY_NORMAL)
[in] flags (0 for default and see ALP_NOTIFY_REGISTER_FLAG_ONETIME to change the default behavior)
Returns:
ALP_OK success

ALP_NOTIFY_ERR_OUT_OF_MEMORY out of memory to perform the register

ALP_NOTIFY_ERR_INVALID_CALLBACK invalid callbackProc

ALP_NOTIFY_ERR_INVALID_NOTIFYTYPE invalid notifyType

ALP_NOTIFY_ERR_INVALID_PRIORITY invalid priority

ALP_NOTIFY_ERR_ALREADY_REGISTERED specified notifyType is already registered

ALP_NOTIFY_ERR_TOO_MANY_REGISTRATIONS too many registered registrations

ALP_NOTIFY_ERR_IPC ipc error

Remarks:
The default behavior is that the registration is persistent until the process exists or the notification is unregistered (see flags to change the default behavior). The callback function is called to handle the notification.

alp_status_t alp_notify_unregister const char *  appID,
const char *  notifyType,
int  flags
 

unregisters the specified notification

Parameters:
[in] appID application previously registered to receive the notification (must be non-null)
[in] notifyType the type of notification (card inserted, vfs mounted, etc) (must be non-null)
[in] flags reserved for future use
Returns:
ALP_OK success

ALP_NOTIFY_ERR_OUT_OF_MEMORY out of memory to perform the unregister

ALP_NOTIFY_ERR_INVALID_APPID invalid appID

ALP_NOTIFY_ERR_INVALID_NOTIFYTYPE invalid notifyType

ALP_NOTIFY_ERR_NOT_REGISTERED specified appID and notifyType are not registered

ALP_NOTIFY_ERR_ACTIVE_BROADCAST failed because of active broadcast

ALP_NOTIFY_ERR_IPC ipc error

alp_status_t alp_notify_unregister_server const char *  notifyType,
int  flags
 

unregisters the specified notification

Parameters:
[in] notifyType the type of notification (card inserted, vfs mounted, etc) (must be non-null)
[in] flags reserved for future use
Returns:
ALP_OK success

ALP_NOTIFY_ERR_OUT_OF_MEMORY out of memory to perform the unregister

ALP_NOTIFY_ERR_INVALID_NOTIFYTYPE invalid notifyType

ALP_NOTIFY_ERR_NOT_REGISTERED specified notifyType is not registered

ALP_NOTIFY_ERR_ACTIVE_BROADCAST failed because of active broadcast

ALP_NOTIFY_ERR_IPC ipc error


Generated on Sat Dec 16 20:29:50 2006 for hiker-0.9 by  doxygen 1.4.4