at_ps: Add PS module skeleton
[platform/core/telephony/tel-plugin-at_standard.git] / src / at_ps.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 <hal.h>
28 #include <core_object.h>
29 #include <plugin.h>
30 #include <co_ps.h>
31
32 #include "at_ps.h"
33
34 static TReturn activate_ps_context(CoreObject *co_ps, CoreObject *ps_context,
35                                         void *user_data)
36 {
37         return TCORE_RETURN_SUCCESS;
38 }
39
40 static TReturn deactivate_ps_context(CoreObject *co_ps, CoreObject *ps_context,
41                                         void *user_data)
42 {
43         return TCORE_RETURN_SUCCESS;
44 }
45
46 static struct tcore_ps_operations ps_ops = {
47         .activate_context = activate_ps_context,
48         .deactivate_context = deactivate_ps_context
49 };
50
51 gboolean at_ps_init(TcorePlugin *p)
52 {
53         CoreObject *co_ps;
54
55         co_ps = tcore_ps_new(p, "umts_ps", &ps_ops, NULL);
56         if (NULL == co_ps)
57                 return FALSE;
58
59         return TRUE;
60 }
61
62 void at_ps_exit(TcorePlugin *p)
63 {
64         CoreObject *co_ps;
65
66         co_ps = tcore_plugin_ref_core_object(p, "umts_ps");
67         if (NULL == co_ps)
68                 return;
69
70         tcore_ps_free(co_ps);
71 }