1 /* $Id$ */
2 /* Copyright (c) 2013 Pierre Pronchery <khorben@defora.org> */
3 /* This file is part of DeforaOS Desktop Phone */
4 /* This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, version 3 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. */
15
16
17
18 #include <string.h>
19 #ifdef DEBUG
20 # include <stdio.h>
21 #endif
22 #include <System.h>
23 #include <Phone/modem.h>
24
25
26 /* Template */
27 /* private */
28 /* types */
29 typedef struct _ModemPlugin
30 {
31 ModemPluginHelper * helper;
32 } Template;
33
34
35 /* variables */
36 static ModemConfig _template_config[] =
37 {
38 { NULL, NULL, MCT_NONE },
39 };
40
41
42 /* prototypes */
43 /* plug-in */
44 static ModemPlugin * _template_init(ModemPluginHelper * helper);
45 static void _template_destroy(ModemPlugin * modem);
46 static int _template_start(ModemPlugin * modem, unsigned int retry);
47 static int _template_stop(ModemPlugin * modem);
48 static int _template_request(ModemPlugin * modem, ModemRequest * request);
49
50
51 /* public */
52 /* variables */
53 ModemPluginDefinition plugin =
54 {
55 "Template",
56 "applications-development",
57 _template_config,
58 _template_init,
59 _template_destroy,
60 _template_start,
61 _template_stop,
62 _template_request,
63 NULL
64 };
65
66
67 /* private */
68 /* functions */
69 /* template_init */
_template_init(ModemPluginHelper * helper)70 static ModemPlugin * _template_init(ModemPluginHelper * helper)
71 {
72 Template * template;
73
74 if((template = object_new(sizeof(*template))) == NULL)
75 return NULL;
76 memset(template, 0, sizeof(*template));
77 template->helper = helper;
78 /* FIXME implement */
79 return template;
80 }
81
82
83 /* template_destroy */
_template_destroy(ModemPlugin * modem)84 static void _template_destroy(ModemPlugin * modem)
85 {
86 Template * template = modem;
87
88 _template_stop(modem);
89 /* FIXME implement */
90 object_delete(template);
91 }
92
93
94 /* template_start */
_template_start(ModemPlugin * modem,unsigned int retry)95 static int _template_start(ModemPlugin * modem, unsigned int retry)
96 {
97 Template * template = modem;
98
99 #ifdef DEBUG
100 fprintf(stderr, "DEBUG: %s()\n", __func__);
101 #endif
102 /* FIXME implement */
103 return 0;
104 }
105
106
107 /* template_stop */
_template_stop(ModemPlugin * modem)108 static int _template_stop(ModemPlugin * modem)
109 {
110 Template * template = modem;
111
112 #ifdef DEBUG
113 fprintf(stderr, "DEBUG: %s()\n", __func__);
114 #endif
115 /* FIXME implement */
116 return 0;
117 }
118
119
120 /* template_request */
_template_request(ModemPlugin * modem,ModemRequest * request)121 static int _template_request(ModemPlugin * modem, ModemRequest * request)
122 {
123 switch(request->type)
124 {
125 /* FIXME implement */
126 #ifndef DEBUG
127 default:
128 break;
129 #endif
130 }
131 return 0;
132 }
133