Rev 3912 | Rev 4350 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3912 | Rev 4243 | ||
|---|---|---|---|
| Line 41... | Line 41... | ||
| 41 | #include "modules.h" |
41 | #include "modules.h" |
| 42 | 42 | ||
| 43 | #define MODULE_WAIT_TIME 10000 |
43 | #define MODULE_WAIT_TIME 10000 |
| 44 | 44 | ||
| 45 | int connect_to_service( services_t need ){ |
45 | int connect_to_service( services_t need ){ |
| 46 | ipcarg_t phone; |
46 | int phone; |
| 47 | int res; |
47 | int res; |
| 48 | 48 | ||
| 49 | res = async_req_3_5( PHONE_NS, IPC_M_CONNECT_ME_TO, need, 0, 0, NULL, NULL, NULL, NULL, & phone ); |
49 | res = async_req_3_5( PHONE_NS, IPC_M_CONNECT_ME_TO, need, 0, 0, NULL, NULL, NULL, NULL, ( ipcarg_t * ) & phone ); |
| 50 | while(( res < 0 ) || ( phone < 0 )){ |
50 | while(( res < 0 ) || ( phone < 0 )){ |
| 51 | usleep( MODULE_WAIT_TIME ); |
51 | usleep( MODULE_WAIT_TIME ); |
| 52 | res = async_req_3_5( PHONE_NS, IPC_M_CONNECT_ME_TO, need, 0, 0, NULL, NULL, NULL, NULL, & phone ); |
52 | res = async_req_3_5( PHONE_NS, IPC_M_CONNECT_ME_TO, need, 0, 0, NULL, NULL, NULL, NULL, ( ipcarg_t * ) & phone ); |
| 53 | } |
53 | } |
| 54 | return phone; |
54 | return phone; |
| 55 | } |
55 | } |
| 56 | 56 | ||
| 57 | int bind_service( services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver ){ |
57 | int bind_service( services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver ){ |
| 58 | ERROR_DECLARE; |
58 | ERROR_DECLARE; |
| 59 | 59 | ||
| 60 | ipcarg_t phone; |
60 | int phone; |
| 61 | ipcarg_t phonehash; |
61 | ipcarg_t phonehash; |
| 62 | 62 | ||
| 63 | phone = connect_to_service( need ); |
63 | phone = connect_to_service( need ); |
| 64 | if( phone >= 0 ){ |
64 | if( phone >= 0 ){ |
| 65 | if( ERROR_OCCURRED( ipc_connect_to_me( phone, arg1, arg2, arg3, & phonehash ))){ |
65 | if( ERROR_OCCURRED( ipc_connect_to_me( phone, arg1, arg2, arg3, & phonehash ))){ |