|
SWILIB API (SG)
|
General Bus System API
Usage: #include <swilib.h> or #include <swilib/gbs.h>
Data Structures | |
| struct | GBS_MSG |
| GBS Message. More... | |
| struct | MOPI_MSG |
| MOPI message header, the payload follows it. More... | |
| struct | GBSTMR |
| GBS Timer. More... | |
| struct | IPC_REQ |
| Message for MSG_IPC. More... | |
| struct | PGROUP |
| Process group definition. More... | |
Typedefs | |
| typedef struct GBS_MSG | GBS_MSG |
| typedef struct MOPI_MSG | MOPI_MSG |
| typedef struct GBSTMR | GBSTMR |
| typedef struct IPC_REQ | IPC_REQ |
| typedef struct PGROUP | PGROUP |
| typedef void(* | GBSTMR_CALLBACK) (GBSTMR *) |
| typedef void(* | GBS_PROC_CALLBACK) () |
Enumerations | |
| enum | GbsCepID { MMI_CEPID = 0x4209 , LCD_DISPLAYQUEUE_CEPID = 0x4200 , IDM_PROCESS_CEPID = 0x403D , HELPER_CEPID = 0x4407 } |
| GBS CEP IDs. More... | |
| enum | GbsMsgID { MSG_INCOMMING_CALL = 0x08 , MSG_STATE_OF_CALL = 0x0B , MSG_END_CALL = 0x0D , MSG_HELPER_TRANSLATOR = 0x3F0 , MSG_RECONFIGURE_REQ = 0x3F1 , MSG_IPC = 0x3F2 , MSG_SMS_TX = 0xC1 , MSG_SMS_RX = 0xC2 , MSG_USSD_RX = 0x42 , MSG_AUTOUSSD_RX = 0x45 , MSG_PLAYFILE_REPORT = 0x167 , MSG_CSM_DESTROYED = 0x93 , MSG_CSM_DESTROY_NOTIFY = 0x92 , MSG_GUI_DESTROYED = 0x98 , MSG_IDLETMR_EXPIRED = 0x95 } |
| Common GBS message IDs. More... | |
Timers | |
| int | GBS_GetCurCepid (void) |
| Get current CEPID. | |
| void | GBS_StartTimerProc (GBSTMR *timer, long ticks, GBSTMR_CALLBACK callback) |
| Start GBS timer with callback. | |
| void | GBS_StartTimer (GBSTMR *timer, int ticks, int msg_id, int unk, int cepid) |
Start GBS timer that sends a message to cepid when it expires. | |
| int | IsTimerProc (GBSTMR *timer) |
| Check if timer is not yet expired. | |
| void | GBS_StopTimer (GBSTMR *timer) |
| Stop active timer. | |
| void | GBS_DelTimer (GBSTMR *timer) |
| Delete timer. | |
Messages | |
| void | GBS_SendMessage (int cepid, int msg,...) |
| Send message to the GBS event processor. | |
| int | GBS_ReciveMessage (GBS_MSG *msg) |
| Receive GBS message inside GBS processor. | |
| int | GBS_RecActDstMessage (GBS_MSG *msg) |
| Receive a message from the queue without auto-ACK. | |
| void * | GBS_GetMsgPayload (GBS_MSG *msg) |
| Get the payload of a received GBS message. | |
| PGROUP * | GBS_GetProcGroup (int cepid) |
| Find a GBS process group. | |
| void * | MOPI_CreateMessage (MOPI_MSG **msg, int cepid_to, int msg_id, int size) |
| Create a MOPI message. | |
| void | MOPI_PostMessage (MOPI_MSG **msg) |
| Post a message created with MOPI_CreateMessage to its destination (sets the handle to NULL). | |
| void * | GBS_CreateMsg (void **msg, int cepid_to, int msg_id, int size) |
| Create a MOPI message. | |
| void | GBS_PostMsg (void **msg) |
| Post a message created with MOPI_CreateMessage to its destination (sets the handle to NULL). | |
| void | GBS_AcceptMessage (void) |
| ACK message received with GBS_RecActDstMessage. | |
| void | GBS_ClearMessage (void) |
| Clear the message queue of the current GBS process. | |
| void | GBS_PendMessage (const GBS_MSG *msg) |
| Pend the message for future processing. | |
| void | GBS_DestroyMessage (GBS_MSG *msg) |
| Destroy GSB_MSG object. | |
| int | GBS_WaitForMsg (const int *msg_list, int msgs_num, GBS_MSG *msgs, int timeout_ms) |
| Wait for the GBS messages. | |
Event processors | |
| void | CreateGBSproc (int cepid, const char *name, GBS_PROC_CALLBACK callback, int prio, int unk) |
| Create GBS Event Processor. | |
| void | KillGBSproc (int cepid) |
| Delete GBS Event Processor. | |
| void * | GetGBSProcAddress (short cepid) |
| Get address of the GBS event processor. | |
| void | CreateICL (PGROUP *pgroup) |
| Create new GBS Process Group. | |
| void * | GBS_CreateProcessGroupResource (int mask, int unk_zero, PGROUP *pgroup, int size) |
| Create new GBS Process Group Resource. | |
| void * | GBS_GetCurrentTask () |
| Get current GBS task. | |
| void * | MemMBPAlloc (void *pool, int size) |
| Alloc memory in the given memory pool. | |
| void | MemMBPFree (void *pool, void *ptr) |
| Free memory allocated with MemMBPAlloc. | |
| void * | RamMopiResourcePool () |
| Pointer to the MOPI memory pool. | |
| struct GBS_MSG |
| struct MOPI_MSG |
| struct GBSTMR |
| struct IPC_REQ |
| struct PGROUP |
| enum GbsCepID |
| enum GbsMsgID |
Common GBS message IDs.
| Enumerator | |
|---|---|
| MSG_INCOMMING_CALL | Incoming call. |
| MSG_STATE_OF_CALL | State of the call. |
| MSG_END_CALL | End of the call. |
| MSG_HELPER_TRANSLATOR | Translated msg from HELPER to MMI. |
| MSG_RECONFIGURE_REQ | Config chaged (BCFG Editor) |
| MSG_IPC | ELFs IPC message. |
| MSG_SMS_TX | Outgoint SMS. |
| MSG_SMS_RX | Incoming SMS. |
| MSG_USSD_RX | USSD result. |
| MSG_AUTOUSSD_RX | USSD result (???) |
| MSG_PLAYFILE_REPORT | PlayFile status reporting. |
| MSG_CSM_DESTROYED | CSM destroyed. |
| MSG_CSM_DESTROY_NOTIFY | CSM will be destroyed. |
| MSG_GUI_DESTROYED | GUI destroyed. |
| MSG_IDLETMR_EXPIRED | IDLE timer expired. |
| int GBS_GetCurCepid | ( | void | ) |
Get current CEPID.
| void GBS_StartTimerProc | ( | GBSTMR * | timer, |
| long | ticks, | ||
| GBSTMR_CALLBACK | callback ) |
Start GBS timer with callback.
| timer | pointer to the GBS timer |
| ticks | number of ticks to expire the timer (1 tick - 4.615 ms) |
| callback | timer expire callback |
| void GBS_StartTimer | ( | GBSTMR * | timer, |
| int | ticks, | ||
| int | msg_id, | ||
| int | unk, | ||
| int | cepid ) |
Start GBS timer that sends a message to cepid when it expires.
| timer | pointer to the GBS timer |
| ticks | number of ticks to expire the timer (1 tick - 4.615 ms) |
| msg_id | ID of the GBS message that will be sent when the timer expires |
| unk | unknown |
| cepid | destination CEPID |
| int IsTimerProc | ( | GBSTMR * | timer | ) |
Check if timer is not yet expired.
| timer | pointer to the GBS timer |
| void GBS_StopTimer | ( | GBSTMR * | timer | ) |
Stop active timer.
| timer | pointer to the GBS timer |
| void GBS_DelTimer | ( | GBSTMR * | timer | ) |
Delete timer.
| timer | pointer to the GBS timer |
| void GBS_SendMessage | ( | int | cepid, |
| int | msg, | ||
| ... ) |
Send message to the GBS event processor.
You can pass up to 3 additional parameters (submsg, data0, data1 - see GBS_MSG).
| cepid | destination CEPID. |
| msg | ID of the message |
| int GBS_ReciveMessage | ( | GBS_MSG * | msg | ) |
Receive GBS message inside GBS processor.
| msg | pointer where the received message will be stored |
| int GBS_RecActDstMessage | ( | GBS_MSG * | msg | ) |
Receive a message from the queue without auto-ACK.
| msg | pointer where the received message will be stored |
| void * GBS_GetMsgPayload | ( | GBS_MSG * | msg | ) |
Get the payload of a received GBS message.
| msg | received GBS message |
| PGROUP * GBS_GetProcGroup | ( | int | cepid | ) |
Find a GBS process group.
| cepid | CEPID whose group (cepid & 0xFF00) is looked up |
| void * MOPI_CreateMessage | ( | MOPI_MSG ** | msg, |
| int | cepid_to, | ||
| int | msg_id, | ||
| int | size ) |
Create a MOPI message.
| [out] | msg | message handle, pass it to MOPI_PostMessage |
| cepid_to | destination CEPID | |
| msg_id | message id | |
| size | payload size in bytes |
| void MOPI_PostMessage | ( | MOPI_MSG ** | msg | ) |
Post a message created with MOPI_CreateMessage to its destination (sets the handle to NULL).
| msg | message handle |
| void * GBS_CreateMsg | ( | void ** | msg, |
| int | cepid_to, | ||
| int | msg_id, | ||
| int | size ) |
Create a MOPI message.
| [out] | msg | message handle, pass it to MOPI_PostMessage |
| cepid_to | destination CEPID | |
| msg_id | message id | |
| size | payload size in bytes |
| void GBS_PostMsg | ( | void ** | msg | ) |
Post a message created with MOPI_CreateMessage to its destination (sets the handle to NULL).
| msg | message handle |
| void GBS_AcceptMessage | ( | void | ) |
ACK message received with GBS_RecActDstMessage.
| void GBS_ClearMessage | ( | void | ) |
Clear the message queue of the current GBS process.
Pend the message for future processing.
| msg | pointer to the GBS_MSG |
| void GBS_DestroyMessage | ( | GBS_MSG * | msg | ) |
Destroy GSB_MSG object.
| msg | pointer to the GBS_MSG |
Wait for the GBS messages.
| msg_list | list of message IDs to wait for |
| msgs_num | count message IDs in msg_list |
| msgs | pointer where the received messages will be stored (array of msgs_num items) |
| timeout_ms | timeout in milliseconds |
| void CreateGBSproc | ( | int | cepid, |
| const char * | name, | ||
| GBS_PROC_CALLBACK | callback, | ||
| int | prio, | ||
| int | unk ) |
Create GBS Event Processor.
| cepid | CEPID of this event processor |
| name | name of the event processor |
| callback | callback for the message |
| prio | priority of the event processor |
| unk | set to 0 |
| void KillGBSproc | ( | int | cepid | ) |
Delete GBS Event Processor.
| cepid | CEPID of event processor for deletion |
| void * GetGBSProcAddress | ( | short | cepid | ) |
Get address of the GBS event processor.
| cepid | CEPID of event processor |
| void CreateICL | ( | PGROUP * | pgroup | ) |
Create new GBS Process Group.
| pgroup | process group definition |
| void * GBS_CreateProcessGroupResource | ( | int | mask, |
| int | unk_zero, | ||
| PGROUP * | pgroup, | ||
| int | size ) |
Create new GBS Process Group Resource.
| mask | resource mask (???) |
| unk_zero | set to 0 |
| pgroup | process group config |
| size | size of the resource |
| void * GBS_GetCurrentTask | ( | ) |
Get current GBS task.
| void * MemMBPAlloc | ( | void * | pool, |
| int | size ) |
Alloc memory in the given memory pool.
| pool | memory pool |
| size | requested memory size |
| void MemMBPFree | ( | void * | pool, |
| void * | ptr ) |
Free memory allocated with MemMBPAlloc.
| pool | memory pool |
| ptr | pointer to the allocated memory |
| void * RamMopiResourcePool | ( | ) |
Pointer to the MOPI memory pool.