Call initializers from descriptor
[platform/core/telephony/tel-plugin-at_standard.git] / src / at_sms.c
1 /*
2  * tel-plugin-at_standard
3  *
4  * Copyright (c) 2012 Intel Corporation. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <string.h>
22 #include <unistd.h>
23
24 #include <glib.h>
25
26 #include <tcore.h>
27 #include <server.h>
28 #include <plugin.h>
29 #include <core_object.h>
30 #include <co_sms.h>
31
32 #include "at_sms.h"
33
34 static TReturn send_umts_msg(CoreObject *co_sms, UserRequest *ur)
35 {
36         return TCORE_RETURN_ENOSYS;
37 }
38
39 static TReturn read_msg(CoreObject *co_sms, UserRequest *ur)
40 {
41         return TCORE_RETURN_ENOSYS;
42 }
43
44 static TReturn save_msg(CoreObject *co_sms, UserRequest *ur)
45 {
46         return TCORE_RETURN_ENOSYS;
47 }
48
49 static TReturn delete_msg(CoreObject *co_sms, UserRequest *ur)
50 {
51         return TCORE_RETURN_ENOSYS;
52 }
53
54 static TReturn get_stored_msg_cnt(CoreObject *co_sms, UserRequest *ur)
55 {
56         return TCORE_RETURN_ENOSYS;
57 }
58
59 static TReturn get_sca(CoreObject *co_sms, UserRequest *ur)
60 {
61         return TCORE_RETURN_ENOSYS;
62 }
63
64 static TReturn set_sca(CoreObject *co_sms, UserRequest *ur)
65 {
66         return TCORE_RETURN_ENOSYS;
67 }
68
69 static TReturn get_cb_config(CoreObject *co_sms, UserRequest *ur)
70 {
71         return TCORE_RETURN_ENOSYS;
72 }
73
74 static TReturn set_cb_config(CoreObject *co_sms, UserRequest *ur)
75 {
76         return TCORE_RETURN_ENOSYS;
77 }
78
79 static TReturn set_mem_status(CoreObject *co_sms, UserRequest *ur)
80 {
81         return TCORE_RETURN_ENOSYS;
82 }
83
84 static TReturn get_pref_brearer(CoreObject *co_sms, UserRequest *ur)
85 {
86         return TCORE_RETURN_ENOSYS;
87 }
88
89 static TReturn set_pref_brearer(CoreObject *co_sms, UserRequest *ur)
90 {
91         return TCORE_RETURN_ENOSYS;
92 }
93
94 static TReturn set_delivery_report(CoreObject *co_sms, UserRequest *ur)
95 {
96         return TCORE_RETURN_ENOSYS;
97 }
98
99 static TReturn set_msg_status(CoreObject *co_sms, UserRequest *ur)
100 {
101         return TCORE_RETURN_ENOSYS;
102 }
103
104 static TReturn get_sms_params(CoreObject *co_sms, UserRequest *ur)
105 {
106         return TCORE_RETURN_ENOSYS;
107 }
108
109 static TReturn set_sms_params(CoreObject *co_sms, UserRequest *ur)
110 {
111         return TCORE_RETURN_ENOSYS;
112 }
113
114 static TReturn get_paramcnt(CoreObject *co_sms, UserRequest *ur)
115 {
116         return TCORE_RETURN_ENOSYS;
117 }
118
119 static TReturn send_cdma_msg(CoreObject *co_sms, UserRequest *ur)
120 {
121         return TCORE_RETURN_ENOSYS;
122 }
123
124 static struct tcore_sms_operations sms_ops = {
125         .send_umts_msg = send_umts_msg,
126         .read_msg = read_msg,
127         .save_msg = save_msg,
128         .delete_msg = delete_msg,
129         .get_stored_msg_cnt = get_stored_msg_cnt,
130         .get_sca = get_sca,
131         .set_sca = set_sca,
132         .get_cb_config = get_cb_config,
133         .set_cb_config = set_cb_config,
134         .set_mem_status = set_mem_status,
135         .get_pref_brearer = get_pref_brearer,
136         .set_pref_brearer = set_pref_brearer,
137         .set_delivery_report = set_delivery_report,
138         .set_msg_status = set_msg_status,
139         .get_sms_params = get_sms_params,
140         .set_sms_params = set_sms_params,
141         .get_paramcnt = get_paramcnt,
142         .send_cdma_msg = send_cdma_msg,
143 };
144
145 gboolean at_sms_init(TcorePlugin *cp)
146 {
147         CoreObject *co;
148         Server *server;
149
150         co = tcore_sms_new(cp, &sms_ops, NULL);
151         if (co == NULL)
152                 return FALSE;
153
154         server = tcore_plugin_ref_server(cp);
155         tcore_server_add_template_object(server, co);
156
157         return TRUE;
158 }
159
160 void at_sms_exit(TcorePlugin *cp)
161 {
162         CoreObject *co;
163
164         if (cp == NULL)
165                 return;
166
167         co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_SMS);
168         if (co == NULL)
169                 return;
170
171         tcore_object_free(co);
172 }