tizen 2.3.1 release
[framework/telephony/libtcore.git] / include / type / common.h
1 /*
2  * libtcore
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Ja-young Gu <jygu@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20
21 #ifndef __TYPE_COMMON_H__
22 #define __TYPE_COMMON_H__
23
24 #include <errno.h>
25
26 #define TCORE_REQUEST        0x10000000
27 #define TCORE_RESPONSE       0x20000000
28 #define TCORE_NOTIFICATION   0x30000000
29 #define TCORE_RETURN         0x40000000
30 #define TCORE_3GPP_RETURN    0x50000000
31
32 #define TCORE_TYPE_DEFAULT   0x00100000
33 #define TCORE_TYPE_SERVER    0x00200000
34 #define TCORE_TYPE_MODEM     0x00300000
35 #define TCORE_TYPE_PENDING   0x00400000
36 #define TCORE_TYPE_HOOK      0x00500000
37 #define TCORE_TYPE_CALL      0x01000000
38 #define TCORE_TYPE_NETWORK   0x01100000
39 #define TCORE_TYPE_PS        0x01200000
40 #define TCORE_TYPE_PDP       0x01300000
41 #define TCORE_TYPE_SIM       0x01400000
42 #define TCORE_TYPE_SAT       0x01500000
43 #define TCORE_TYPE_SAP       0x01600000
44 #define TCORE_TYPE_SMS       0x01700000
45 #define TCORE_TYPE_PHONEBOOK 0x01800000
46 #define TCORE_TYPE_SS        0x01900000
47 #define TCORE_TYPE_SOUND     0x01A00000
48 #define TCORE_TYPE_GPS       0x01B00000
49 #define TCORE_TYPE_CUSTOM    0x0F000000
50
51 #define TCORE_PLUGIN_DEFAULT "default"
52
53
54 __BEGIN_DECLS
55
56 enum tcore_return {
57         TCORE_RETURN_SUCCESS = 0,
58         TCORE_RETURN_FAILURE = -1,
59         TCORE_RETURN_OPERATION_ABORTED = 1, /**< Operation Aborted */
60         TCORE_RETURN_ENOENT = ENOENT, /* No such file or directory */
61         TCORE_RETURN_EPERM = EPERM, /* Operation not permitted */
62         TCORE_RETURN_ENOMEM = ENOMEM, /* Out of memory */
63         TCORE_RETURN_EAGAIN = EAGAIN, /* Try again */
64         TCORE_RETURN_EINVAL = EINVAL, /* Invalid argument */
65         TCORE_RETURN_ENOSYS = ENOSYS, /* Function not implemented */
66         TCORE_RETURN_EALREADY = EALREADY, /* Operation already in progress */
67         TCORE_RETURN_ETIMEDOUT = ETIMEDOUT, /* Connection timed out */
68         TCORE_RETURN_EMSGSIZE = EMSGSIZE, /* Message too long */
69         TCORE_RETURN_ENODATA = ENODATA, /* No data available */
70
71         TCORE_RETURN_SERVER_WRONG_PLUGIN = TCORE_RETURN | TCORE_TYPE_SERVER,
72
73         TCORE_RETURN_PENDING_WRONG_ID = TCORE_RETURN | TCORE_TYPE_PENDING,
74
75         TCORE_RETURN_PS_NETWORK_NOT_READY = TCORE_RETURN | TCORE_TYPE_PS,
76         TCORE_RETURN_PS_CID_ERROR,
77         TCORE_RETURN_PS_ACTIVATING,
78         TCORE_RETURN_PS_ALREADY_ACTIVATED,
79         TCORE_RETURN_PS_DEACTIVATING,
80
81         TCORE_RETURN_HOOK_STOP = TCORE_RETURN | TCORE_TYPE_HOOK,
82
83         TCORE_RETURN_SIM = TCORE_RETURN | TCORE_TYPE_SIM,
84         TCORE_RETURN_SIM_DISABLED_IN_SST, /* feature in sst is disabled */
85
86         /* NETTEXT */
87         TCORE_RETURN_SMS = TCORE_RETURN | TCORE_TYPE_SMS,
88         TCORE_RETURN_SMS_DEVICE_NOT_READY, /**<Nettext device not ready */
89         TCORE_RETURN_SMS_SCADDR_NOT_SET, /**<Nettext SCA address not set */
90         TCORE_RETURN_SMS_INVALID_DATA_LEN, /**<Nettext Invalid data length */
91         TCORE_RETURN_SMS_SCADDRESS_NOT_SET, /**<Nettext SCA address not set*/
92
93         TCORE_RETURN_3GPP_ERROR = TCORE_3GPP_RETURN, /**< TCORE_3GPP_RETURN + (0x0000 ~ 0x7FFF) */
94         TCORE_RETURN_3GPP_PLMN_NOT_ALLOWED,    /* 3GPP error cause 11*/
95         TCORE_RETURN_3GPP_ROAMING_NOT_ALLOWED, /* 3GPP error cause 13 */
96
97         TCORE_RETURN_UNKNOWN = TCORE_RETURN | 0x0FFFFFFF
98 };
99
100 typedef enum tcore_return TReturn;
101
102 __END_DECLS
103
104 #endif