OLD | NEW |
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | 1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 /* | 2 /* |
3 * This program is free software; you can redistribute it and/or modify | 3 * This program is free software; you can redistribute it and/or modify |
4 * it under the terms of the GNU General Public License as published by | 4 * it under the terms of the GNU General Public License as published by |
5 * the Free Software Foundation; either version 2 of the License, or | 5 * the Free Software Foundation; either version 2 of the License, or |
6 * (at your option) any later version. | 6 * (at your option) any later version. |
7 * | 7 * |
8 * This program is distributed in the hope that it will be useful, | 8 * This program is distributed in the hope that it will be useful, |
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 * GNU General Public License for more details: | 11 * GNU General Public License for more details: |
12 * | 12 * |
13 * Copyright (C) 2008 Novell, Inc. | 13 * Copyright (C) 2008 Novell, Inc. |
14 * Copyright (C) 2009 Red Hat, Inc. | 14 * Copyright (C) 2009 Red Hat, Inc. |
15 */ | 15 */ |
16 | 16 |
17 #include <string.h> | 17 #include <string.h> |
18 #include <dbus/dbus-glib.h> | 18 #include <dbus/dbus-glib.h> |
19 #include "mm-modem-cdma.h" | 19 #include "mm-modem-cdma.h" |
20 #include "mm-errors.h" | 20 #include "mm-errors.h" |
21 #include "mm-callback-info.h" | 21 #include "mm-callback-info.h" |
22 #include "mm-marshal.h" | 22 #include "mm-marshal.h" |
23 #include "mm-auth-provider.h" | 23 #include "mm-auth-provider.h" |
24 | 24 |
25 static void impl_modem_cdma_get_signal_quality (MMModemCdma *modem, DBusGMethodI
nvocation *context); | 25 static void impl_modem_cdma_get_signal_quality (MMModemCdma *modem, DBusGMethodI
nvocation *context); |
26 static void impl_modem_cdma_get_esn (MMModemCdma *modem, DBusGMethodInvocation *
context); | 26 static void impl_modem_cdma_get_esn (MMModemCdma *modem, DBusGMethodInvocation *
context); |
27 static void impl_modem_cdma_get_serving_system (MMModemCdma *modem, DBusGMethodI
nvocation *context); | 27 static void impl_modem_cdma_get_serving_system (MMModemCdma *modem, DBusGMethodI
nvocation *context); |
28 static void impl_modem_cdma_get_registration_state (MMModemCdma *modem, DBusGMet
hodInvocation *context); | 28 static void impl_modem_cdma_get_registration_state (MMModemCdma *modem, DBusGMet
hodInvocation *context); |
29 static void impl_modem_cdma_activate (MMModemCdma *modem, DBusGMethodInvocation
*context); | 29 static void impl_modem_cdma_activate (MMModemCdma *modem, DBusGMethodInvocation
*context); |
| 30 static void impl_modem_cdma_activate_manual (MMModemCdma *modem, DBusGMethodInvo
cation *context); |
| 31 static void impl_modem_cdma_activate_manual_debug (MMModemCdma *modem, DBusGMeth
odInvocation *context); |
30 | 32 |
31 #include "mm-modem-cdma-glue.h" | 33 #include "mm-modem-cdma-glue.h" |
32 | 34 |
33 enum { | 35 enum { |
34 SIGNAL_QUALITY, | 36 SIGNAL_QUALITY, |
35 REGISTRATION_STATE_CHANGED, | 37 REGISTRATION_STATE_CHANGED, |
36 | 38 |
37 LAST_SIGNAL | 39 LAST_SIGNAL |
38 }; | 40 }; |
39 | 41 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 else | 265 else |
264 uint_op_not_supported (MM_MODEM (self), callback, user_data); | 266 uint_op_not_supported (MM_MODEM (self), callback, user_data); |
265 } | 267 } |
266 | 268 |
267 static void impl_modem_cdma_activate(MMModemCdma *modem, | 269 static void impl_modem_cdma_activate(MMModemCdma *modem, |
268 DBusGMethodInvocation *context) | 270 DBusGMethodInvocation *context) |
269 { | 271 { |
270 mm_modem_cdma_activate (modem, uint_call_done, context); | 272 mm_modem_cdma_activate (modem, uint_call_done, context); |
271 } | 273 } |
272 | 274 |
| 275 |
| 276 void mm_modem_cdma_activate_manual(MMModemCdma *self, MMModemUIntFn callback, |
| 277 gpointer user_data) { |
| 278 g_return_if_fail (MM_IS_MODEM_CDMA (self)); |
| 279 g_return_if_fail (callback != NULL); |
| 280 if (MM_MODEM_CDMA_GET_INTERFACE (self)->activate_manual) |
| 281 MM_MODEM_CDMA_GET_INTERFACE (self)->activate_manual(self, callback, user
_data); |
| 282 else |
| 283 uint_op_not_supported (MM_MODEM (self), callback, user_data); |
| 284 } |
| 285 static void impl_modem_cdma_activate_manual (MMModemCdma *modem, |
| 286 DBusGMethodInvocation *context) { |
| 287 mm_modem_cdma_activate_manual(modem, uint_call_done, context); |
| 288 } |
| 289 |
| 290 void mm_modem_cdma_activate_manual_debug(MMModemCdma *self, MMModemUIntFn callba
ck, |
| 291 gpointer user_data) { |
| 292 g_return_if_fail (MM_IS_MODEM_CDMA (self)); |
| 293 g_return_if_fail (callback != NULL); |
| 294 if (MM_MODEM_CDMA_GET_INTERFACE (self)->activate_manual_debug) |
| 295 MM_MODEM_CDMA_GET_INTERFACE (self)->activate_manual_debug(self, callback
, user_data); |
| 296 else |
| 297 uint_op_not_supported (MM_MODEM (self), callback, user_data); |
| 298 } |
| 299 static void impl_modem_cdma_activate_manual_debug (MMModemCdma *modem, |
| 300 DBusGMethodInvocation *context) { |
| 301 mm_modem_cdma_activate_manual_debug(modem, uint_call_done, context); |
| 302 } |
| 303 |
| 304 |
273 /*****************************************************************************/ | 305 /*****************************************************************************/ |
274 | 306 |
275 static void | 307 static void |
276 get_registration_state_call_done (MMModemCdma *self, | 308 get_registration_state_call_done (MMModemCdma *self, |
277 MMModemCdmaRegistrationState cdma_1x_reg_state
, | 309 MMModemCdmaRegistrationState cdma_1x_reg_state
, |
278 MMModemCdmaRegistrationState evdo_reg_state, | 310 MMModemCdmaRegistrationState evdo_reg_state, |
279 GError *error, | 311 GError *error, |
280 gpointer user_data) | 312 gpointer user_data) |
281 { | 313 { |
282 DBusGMethodInvocation *context = (DBusGMethodInvocation *) user_data; | 314 DBusGMethodInvocation *context = (DBusGMethodInvocation *) user_data; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 "MMModemCdma", | 417 "MMModemCdma", |
386 &modem_info, 0); | 418 &modem_info, 0); |
387 | 419 |
388 g_type_interface_add_prerequisite (modem_type, MM_TYPE_MODEM); | 420 g_type_interface_add_prerequisite (modem_type, MM_TYPE_MODEM); |
389 | 421 |
390 dbus_g_object_type_install_info (modem_type, &dbus_glib_mm_modem_cdma_ob
ject_info); | 422 dbus_g_object_type_install_info (modem_type, &dbus_glib_mm_modem_cdma_ob
ject_info); |
391 } | 423 } |
392 | 424 |
393 return modem_type; | 425 return modem_type; |
394 } | 426 } |
OLD | NEW |