tizen 2.3.1 release
[framework/telephony/tel-plugin-imcmodem.git] / src / desc-imcmodem.c
1 /*
2  * tel-plugin-imcmodem
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Kyoungyoup Park <gynaru.park@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 #include <stdio.h>
22 #include <string.h>
23
24 #include <glib.h>
25
26 #include <tcore.h>
27 #include <server.h>
28 #include <plugin.h>
29
30 #include "imcmodem.h"
31
32 static gboolean on_load()
33 {
34         dbg("Load!!!");
35
36         return TRUE;
37 }
38
39 static gboolean on_init(TcorePlugin *plugin)
40 {
41         dbg("Init!!!");
42
43         if (plugin == NULL) {
44                 err("'plugin' is NULL");
45                 return FALSE;
46         }
47
48         return imcmodem_init(plugin);
49 }
50
51 static void on_unload(TcorePlugin *plugin)
52 {
53         dbg("Unload!!!");
54
55         if (plugin == NULL) {
56                 err("Modem Interface Plug-in is NULL");
57                 return;
58         }
59
60         imcmodem_deinit(plugin);
61         dbg("Unloaded MODEM Interface Plug-in");
62 }
63
64 /* Modem Interface Plug-in descriptor - IMC modem */
65 struct tcore_plugin_define_desc plugin_define_desc = {
66         .name = "imcmodem",
67         .priority = TCORE_PLUGIN_PRIORITY_HIGH,
68         .version = 1,
69         .load = on_load,
70         .init = on_init,
71         .unload = on_unload
72 };