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