at_phonebook: Add Phonebook skeleton
[platform/core/telephony/tel-plugin-at_standard.git] / src / at_network.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 <glib.h>
23
24 #include <tcore.h>
25 #include <hal.h>
26 #include <core_object.h>
27 #include <plugin.h>
28 #include <queue.h>
29 #include <co_network.h>
30 #include <server.h>
31
32 #include "at.h"
33 #include "user_request.h"
34
35 #include "at_network.h"
36
37
38 static TReturn search_network(CoreObject *co, UserRequest *ur)
39 {
40         return TCORE_RETURN_ENOSYS;
41 }
42
43 static TReturn set_plmn_selection_mode(CoreObject *co, UserRequest *ur)
44 {
45         return TCORE_RETURN_ENOSYS;
46 }
47
48 static TReturn get_plmn_selection_mode(CoreObject *co, UserRequest *ur)
49 {
50         return TCORE_RETURN_ENOSYS;
51 }
52
53 static TReturn get_serving_network(CoreObject *co, UserRequest *ur)
54 {
55         return TCORE_RETURN_ENOSYS;
56 }
57
58 static struct tcore_network_operations network_ops = {
59         .search = search_network,
60         .set_plmn_selection_mode = set_plmn_selection_mode,
61         .get_plmn_selection_mode = get_plmn_selection_mode,
62         .set_service_domain = NULL,
63         .get_service_domain = NULL,
64         .set_band = NULL,
65         .get_band = NULL,
66         .set_preferred_plmn = NULL,
67         .get_preferred_plmn = NULL,
68         .set_order = NULL,
69         .get_order = NULL,
70         .set_power_on_attach = NULL,
71         .get_power_on_attach = NULL,
72         .set_cancel_manual_search = NULL,
73         .get_serving_network = get_serving_network,
74         .set_mode = NULL,
75         .get_mode = NULL,
76 };
77
78 gboolean at_network_init(TcorePlugin *plugin)
79 {
80         CoreObject *co;
81
82         co = tcore_network_new(plugin, "umts_network", &network_ops, NULL);
83         if (NULL == co)
84                 return FALSE;
85
86         return TRUE;
87 }
88
89 void at_network_exit(TcorePlugin *plugin)
90 {
91         CoreObject *co;
92
93         if (NULL == plugin)
94                 return;
95
96         co = tcore_plugin_ref_core_object(plugin, "umts_network");
97         if (NULL == co)
98                 return;
99
100         tcore_network_free(co);
101 }