GCC Code Coverage Report


Directory: ./
File: panels/wwan/cc-wwan-device.h
Date: 2024-05-04 07:58:27
Exec Total Coverage
Lines: 0 1 0.0%
Functions: 0 3 0.0%
Branches: 0 7 0.0%

Line Branch Exec Source
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* cc-wwan-device.h
3 *
4 * Copyright 2019-2020 Purism SPC
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Author(s):
20 * Mohammed Sadiq <sadiq@sadiqpk.org>
21 *
22 * SPDX-License-Identifier: GPL-3.0-or-later
23 */
24
25 #pragma once
26
27 #include <glib-object.h>
28 #include <libmm-glib.h>
29
30 #if defined(HAVE_NETWORK_MANAGER) && defined(BUILD_NETWORK)
31 # include "cc-wwan-data.h"
32 #endif
33
34 G_BEGIN_DECLS
35
36 typedef enum
37 {
38 CC_WWAN_REGISTRATION_STATE_UNKNOWN,
39 CC_WWAN_REGISTRATION_STATE_IDLE,
40 CC_WWAN_REGISTRATION_STATE_REGISTERED,
41 CC_WWAN_REGISTRATION_STATE_ROAMING,
42 CC_WWAN_REGISTRATION_STATE_SEARCHING,
43 CC_WWAN_REGISTRATION_STATE_DENIED
44 } CcWwanState;
45
46 typedef struct _CcWwanData CcWwanData;
47
48 #define CC_TYPE_WWAN_DEVICE (cc_wwan_device_get_type())
49 G_DECLARE_FINAL_TYPE (CcWwanDevice, cc_wwan_device, CC, WWAN_DEVICE, GObject)
50
51 CcWwanDevice *cc_wwan_device_new (MMObject *mm_object,
52 GObject *nm_client);
53 gboolean cc_wwan_device_has_sim (CcWwanDevice *self);
54 MMModemLock cc_wwan_device_get_lock (CcWwanDevice *self);
55 gboolean cc_wwan_device_get_sim_lock (CcWwanDevice *self);
56 guint cc_wwan_device_get_unlock_retries (CcWwanDevice *self,
57 MMModemLock lock);
58 void cc_wwan_device_enable_pin (CcWwanDevice *self,
59 const gchar *pin,
60 GCancellable *cancellable,
61 GAsyncReadyCallback callback,
62 gpointer user_data);
63 gboolean cc_wwan_device_enable_pin_finish (CcWwanDevice *self,
64 GAsyncResult *result,
65 GError **error);
66 void cc_wwan_device_disable_pin (CcWwanDevice *self,
67 const gchar *pin,
68 GCancellable *cancellable,
69 GAsyncReadyCallback callback,
70 gpointer user_data);
71 gboolean cc_wwan_device_disable_pin_finish (CcWwanDevice *self,
72 GAsyncResult *result,
73 GError **error);
74 void cc_wwan_device_send_pin (CcWwanDevice *self,
75 const gchar *pin,
76 GCancellable *cancellable,
77 GAsyncReadyCallback callback,
78 gpointer user_data);
79 gboolean cc_wwan_device_send_pin_finish (CcWwanDevice *self,
80 GAsyncResult *result,
81 GError **error);
82 void cc_wwan_device_send_puk (CcWwanDevice *self,
83 const gchar *puk,
84 const gchar *pin,
85 GCancellable *cancellable,
86 GAsyncReadyCallback callback,
87 gpointer user_data);
88 gboolean cc_wwan_device_send_puk_finish (CcWwanDevice *self,
89 GAsyncResult *result,
90 GError **error);
91 void cc_wwan_device_change_pin (CcWwanDevice *self,
92 const gchar *old_pin,
93 const gchar *new_pin,
94 GCancellable *cancellable,
95 GAsyncReadyCallback callback,
96 gpointer user_data);
97 gboolean cc_wwan_device_change_pin_finish (CcWwanDevice *self,
98 GAsyncResult *result,
99 GError **error);
100 const gchar *cc_wwan_device_get_operator_name (CcWwanDevice *self);
101 gchar *cc_wwan_device_dup_own_numbers (CcWwanDevice *self);
102 gchar *cc_wwan_device_dup_network_type_string (CcWwanDevice *self);
103 gchar *cc_wwan_device_dup_signal_string (CcWwanDevice *self);
104 const gchar *cc_wwan_device_get_manufacturer (CcWwanDevice *self);
105 const gchar *cc_wwan_device_get_model (CcWwanDevice *self);
106 const gchar *cc_wwan_device_get_firmware_version (CcWwanDevice *self);
107 const gchar *cc_wwan_device_get_identifier (CcWwanDevice *self);
108 gboolean cc_wwan_device_get_current_mode (CcWwanDevice *self,
109 MMModemMode *allowed,
110 MMModemMode *preferred);
111 gboolean cc_wwan_device_is_auto_network (CcWwanDevice *self);
112 CcWwanState cc_wwan_device_get_network_state (CcWwanDevice *self);
113 gboolean cc_wwan_device_get_supported_modes (CcWwanDevice *self,
114 MMModemMode *allowed,
115 MMModemMode *preferred);
116 void cc_wwan_device_set_current_mode (CcWwanDevice *self,
117 MMModemMode allowed,
118 MMModemMode preferred,
119 GCancellable *cancellable,
120 GAsyncReadyCallback callback,
121 gpointer user_data);
122 gboolean cc_wwan_device_set_current_mode_finish (CcWwanDevice *self,
123 GAsyncResult *result,
124 GError **error);
125 gchar *cc_wwan_device_get_string_from_mode (CcWwanDevice *self,
126 MMModemMode allowed,
127 MMModemMode preferred);
128 void cc_wwan_device_scan_networks (CcWwanDevice *self,
129 GCancellable *cancellable,
130 GAsyncReadyCallback callback,
131 gpointer user_data);
132 GList *cc_wwan_device_scan_networks_finish (CcWwanDevice *self,
133 GAsyncResult *result,
134 GError **error);
135 void cc_wwan_device_register_network (CcWwanDevice *self,
136 const gchar *network_id,
137 GCancellable *cancellable,
138 GAsyncReadyCallback callback,
139 gpointer user_data);
140 gboolean cc_wwan_device_register_network_finish (CcWwanDevice *self,
141 GAsyncResult *result,
142 GError **error);
143 const gchar *cc_wwan_device_get_simple_error (CcWwanDevice *self);
144 GSList *cc_wwan_device_get_apn_list (CcWwanDevice *self);
145 gboolean cc_wwan_device_is_nm_device (CcWwanDevice *self,
146 GObject *nm_device);
147 const gchar *cc_wwan_device_get_path (CcWwanDevice *self);
148 CcWwanData *cc_wwan_device_get_data (CcWwanDevice *self);
149 gboolean cc_wwan_device_pin_valid (const gchar *password,
150 MMModemLock lock);
151
152 G_END_DECLS
153