forked from maemo-leste/libcmtspeechdata
/
cmtspeech_null.c
207 lines (166 loc) · 4.41 KB
/
cmtspeech_null.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
/*
* This file is part of libcmtspeechdata.
*
* Copyright (C) 2010 Nokia Corporation.
*
* Contact: Kai Vehmanen <kai.vehmanen@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
/** @file cmtspeech_null.c
*
* A libcmtspeechdata backend implementation that demonstrates
* how to add a new modem backend to the build scripts. This
* 'null' backend does not do anything (it can be built, but
* has not functionality).
*
* See 'dummy-backend/' for a backend that simulates a modem.
*/
#include <errno.h>
#include "cmtspeech.h"
/* Interfaces: Core I/O
* -------------------- */
void cmtspeech_init(void)
{
}
cmtspeech_t* cmtspeech_open(void)
{
return NULL;
}
int cmtspeech_close(cmtspeech_t *context)
{
return -1;
}
int cmtspeech_descriptor(cmtspeech_t *context)
{
return -1;
}
int cmtspeech_check_pending(cmtspeech_t *context, int *flags)
{
return -1;
}
int cmtspeech_read_event(cmtspeech_t *context, cmtspeech_event_t *event)
{
return -1;
}
/* Interfaces: Event parsing
* ------------------------- */
int cmtspeech_event_to_state_transition(const cmtspeech_t *context, const cmtspeech_event_t *event)
{
return CMTSPEECH_TR_INVALID;
}
/* Interfaces: Runtime configuration
* --------------------------------- */
int cmtspeech_set_wb_preference(cmtspeech_t *context, bool enabled)
{
return -1;
}
/* Interfaces: State management
* ---------------------------- */
int cmtspeech_protocol_state(cmtspeech_t* context)
{
return CMTSPEECH_STATE_INVALID;
}
bool cmtspeech_is_ssi_connection_enabled(cmtspeech_t *context)
{
return false;
}
bool cmtspeech_is_active(cmtspeech_t *context)
{
return false;
}
int cmtspeech_state_change_call_status(cmtspeech_t *context, bool state)
{
return false;
}
int cmtspeech_state_change_call_connect(cmtspeech_t *context, bool state)
{
return false;
}
int cmtspeech_state_change_error(cmtspeech_t *context)
{
return false;
}
/* Interfaces: Buffer management
* -------------------------------------- */
int cmtspeech_ul_buffer_acquire(cmtspeech_t *context, cmtspeech_buffer_t **buf)
{
return -EINVAL;
}
int cmtspeech_ul_buffer_release(cmtspeech_t *context, cmtspeech_buffer_t *buf)
{
return -EINVAL;
}
int cmtspeech_dl_buffer_acquire(cmtspeech_t *context, cmtspeech_buffer_t **buf)
{
return -EINVAL;
}
int cmtspeech_dl_buffer_release(cmtspeech_t *context, cmtspeech_buffer_t *buf)
{
return -EINVAL;
}
cmtspeech_buffer_t *cmtspeech_dl_buffer_find_with_data(cmtspeech_t *context, uint8_t *data)
{
return NULL;
}
cmtspeech_buffer_t *cmtspeech_dl_buffer_find_with_payload(cmtspeech_t *context, uint8_t *payload)
{
return NULL;
}
/* Interfaces: Implementation version information
* ---------------------------------------------------- */
const char* cmtspeech_version_str(void)
{
return VERSION;
}
int cmtspeech_protocol_version(void)
{
return LIBCMTSPEECHDATA_PROTOCOL_VERSION;
}
/* Interfaces: Access to backend specific functionality
* ---------------------------------------------------- */
const char* cmtspeech_backend_name(cmtspeech_t* context)
{
return "null";
}
int cmtspeech_backend_message(cmtspeech_t *self, int type, int args, ...)
{
return -1;
}
int cmtspeech_buffer_codec_sample_rate(cmtspeech_buffer_t *context)
{
return CMTSPEECH_SAMPLE_RATE_NONE;
}
int cmtspeech_buffer_sample_rate(cmtspeech_buffer_t *context)
{
return CMTSPEECH_SAMPLE_RATE_NONE;
}
/* Interfaces: Low level message handling
* -------------------------------------- */
int cmtspeech_send_timing_request(cmtspeech_t *context)
{
return -1;
}
int cmtspeech_send_ssi_config_request(cmtspeech_t *context, bool active)
{
return -1;
}
/* Interfaces: Test interface
* -------------------------- */
int cmtspeech_test_data_ramp_req(cmtspeech_t *context, uint8_t rampstart, uint8_t ramplen)
{
return -1;
}