Fix build error and do Boiler Plate.
[profile/ivi/tel-plugin-imc.git] / include / s_common.h
1 /*\r
2  * tel-plugin-imc\r
3  *\r
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
5  *\r
6  * Contact: Hayoon Ko <hayoon.ko@samsung.com>\r
7  *\r
8  * Licensed under the Apache License, Version 2.0 (the "License");\r
9  * you may not use this file except in compliance with the License.\r
10  * You may obtain a copy of the License at\r
11  *\r
12  * http://www.apache.org/licenses/LICENSE-2.0\r
13  *\r
14  * Unless required by applicable law or agreed to in writing, software\r
15  * distributed under the License is distributed on an "AS IS" BASIS,\r
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
17  * See the License for the specific language governing permissions and\r
18  * limitations under the License.\r
19  */\r
20 \r
21 \r
22 #ifndef __S_COMMON_H__\r
23 #define __S_COMMON_H__\r
24 \r
25 #include <tcore.h>\r
26 #include <glib.h>\r
27 #include <user_request.h>\r
28 \r
29 \r
30 #define EVENT_SYS_NOTI_MODEM_POWER          "system_power"\r
31 #define EVENT_NOTI_MODEM_POWER          "modem_power"\r
32 #define EVENT_NOTI_MODEM_PHONE_STATE    "modem_phone_state"\r
33 #define EVENT_NOTI_MODEM_PIN_CTRL          "ps_pin_control"\r
34 \r
35 #define EVENT_NOTI_CALL_STATUS                  "call_status"\r
36 #define EVENT_NOTI_CALL_INCOMING                "call_incoming"\r
37 #define EVENT_NOTI_CALL_WAITING                 "call_waiting"\r
38 #define EVENT_NOTI_CALL_SOUND_WBAMR_REPORT "call_sound_wbamr_report"\r
39 #define EVENT_NOTI_CALL_SOUND_TWO_MIC   "call_sound_two_mic"\r
40 #define EVENT_NOTI_CALL_SOUND_DHA               "call_sound_dha"\r
41 \r
42 #define EVENT_NOTI_SS_INFO                              "ss_info"\r
43 #define EVENT_NOTI_SS_USSD                              "ss_ussd"\r
44 \r
45 #define EVENT_NOTI_PS_CALL_STATUS       "ps_call_status"\r
46 #define EVENT_NOTI_PS_DATA_COUNTER      "ps_data_counter"\r
47 #define EVENT_NOTI_PS_IPCONFIGURATION   "ps_ipconfiguration"\r
48 #define EVENT_NOTI_PS_HSDPA_STATUS      "ps_hsdpa_status"\r
49 #define EVENT_NOTI_PS_ATTACH_DETACH     "ps_attach_detach"\r
50 #define EVENT_NOTI_PS_EXTERNAL_CALL     "ps_external_call"\r
51 \r
52 #define EVENT_NOTI_SAP_STATUS           "sap_status"\r
53 #define EVENT_NOTI_SAP_DISCONNECT       "sap_disconnect"\r
54 \r
55 #define EVENT_NOTI_SIM_PIN_STATUS       "sim_pin_status"\r
56 \r
57 #define EVENT_NOTI_SAT_ENVELOPE_RESP       "sat_envelope_response"\r
58 #define EVENT_NOTI_SAT_REFRESH_STATUS       "sat_refresh_status"\r
59 #define EVENT_NOTI_SAT_PROACTIVE_COMMAND       "sat_proactive_command"\r
60 #define EVENT_NOTI_SAT_CONTROL_RESULT       "sat_control_result"\r
61 \r
62 #define EVENT_NOTI_NETWORK_REGISTRATION "network_regist"\r
63 #define EVENT_NOTI_NETWORK_ICON_INFO    "network_icon_info"\r
64 #define EVENT_NOTI_NETWORK_TIME_INFO    "network_time_info"\r
65 #define EVENT_NOTI_NETWORK_IDENTITY     "network_identity"\r
66 \r
67 #define EVENT_NOTI_SMS_INCOM_MSG        "sms_incom_msg"\r
68 #define EVENT_NOTI_SMS_SEND_ACK         "sms_send_ack"\r
69 #define EVENT_NOTI_SMS_MEMORY_STATUS    "sms_memory_status"\r
70 #define EVENT_NOTI_SMS_CB_INCOM_MSG     "sms_cb_incom_msg"\r
71 #define EVENT_NOTI_SMS_DELETE_MSG_CNF   "sms_delete_msg_cnf"\r
72 #define EVENT_NOTI_SMS_WRITE_MSG_CNF    "sms_write_msg_cnf"\r
73 #define EVENT_NOTI_SMS_DELIVERY_RPT_CNF "sms_deliver_rpt_cnf"\r
74 #define EVENT_NOTI_SMS_DEVICE_READY     "sms_device_ready"\r
75 \r
76 #define EVENT_NOTI_PHONEBOOK_STATUS       "phonebook_status"\r
77 #define EVENT_NOTI_PHONEBOOK_FIRST_INDEX        "phonebook_first_index"\r
78 \r
79 #define EVENT_NOTI_GPS_ASSIST_DATA       "gps_assist_data"\r
80 #define EVENT_IND_GPS_MEASURE_POSITION   "gps_measure_position"\r
81 #define EVENT_NOTI_RESET_ASSIST_DATA     "gps_reset_assist_data"\r
82 \r
83 enum direction_e {\r
84         RX,\r
85         TX\r
86 };\r
87 \r
88 struct global_data {\r
89         unsigned int msg_auto_id_current;\r
90         unsigned int msg_auto_id_start;\r
91         unsigned int msg_auto_id_end;\r
92         \r
93         TcoreHal *hal;\r
94 };\r
95 \r
96 struct work_queue_data {\r
97         unsigned int id;\r
98         UserRequest *ur;\r
99 };\r
100 \r
101 #define UTIL_ID(hdr)            ((hdr).main_cmd << 8 | (hdr).sub_cmd)\r
102 #define UTIL_IDP(hdr)           ((hdr)->main_cmd << 8 | (hdr)->sub_cmd)\r
103 \r
104 void                    hook_hex_dump(enum direction_e d, int size, const void *data);\r
105 unsigned int    util_assign_message_sequence_id(TcorePlugin *p);\r
106 gboolean                util_add_waiting_job(GQueue *queue, unsigned int id, UserRequest *ur);\r
107 UserRequest*    util_pop_waiting_job(GQueue *queue, unsigned int id);\r
108 void                    util_hex_dump(char *pad, int size, const void *data);\r
109 unsigned char   util_hexCharToInt(char c);\r
110 char*           util_hexStringToBytes(char * s);\r
111 \r
112 #endif\r