| 1 |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 3 |
/* |
| 4 |
* Copyright (C) 2014-2021 Aleksander Morgado <[email protected]> |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef _LIBMBIM_GLIB_MBIM_COMPAT_H_ |
| 8 |
#define _LIBMBIM_GLIB_MBIM_COMPAT_H_ |
| 9 |
|
| 10 |
#if !defined (__LIBMBIM_GLIB_H_INSIDE__) && !defined (LIBMBIM_GLIB_COMPILATION) |
| 11 |
#error "Only <libmbim-glib.h> can be included directly." |
| 12 |
#endif |
| 13 |
|
| 14 |
#include <glib.h> |
| 15 |
|
| 16 |
#include "mbim-basic-connect.h" |
| 17 |
#include "mbim-ms-basic-connect-extensions.h" |
| 18 |
#include "mbim-cid.h" |
| 19 |
|
| 20 |
G_BEGIN_DECLS |
| 21 |
|
| 22 |
/** |
| 23 |
* SECTION: mbim-compat |
| 24 |
* @title: Deprecated API |
| 25 |
* @short_description: Types and functions flagged as deprecated. |
| 26 |
* |
| 27 |
* This section defines types and functions that have been deprecated. |
| 28 |
*/ |
| 29 |
|
| 30 |
#ifndef MBIM_DISABLE_DEPRECATED |
| 31 |
|
| 32 |
/*****************************************************************************/ |
| 33 |
/* Registration flags name fixup */ |
| 34 |
|
| 35 |
/* The following type exists just so that we can get deprecation warnings */ |
| 36 |
G_DEPRECATED |
| 37 |
typedef int MbimDeprecatedRegistrationFlag; |
| 38 |
|
| 39 |
/** |
| 40 |
* MBIM_REGISTRATION_FLAG_MANUAL_PACKET_SERVICE_AUTOMATIC_ATTACH: |
| 41 |
* |
| 42 |
* Modem should auto-attach to the network after registration. |
| 43 |
* |
| 44 |
* Since: 1.0 |
| 45 |
* Deprecated: 1.8: Use MBIM_REGISTRATION_FLAG_PACKET_SERVICE_AUTOMATIC_ATTACH instead. |
| 46 |
*/ |
| 47 |
#define MBIM_REGISTRATION_FLAG_MANUAL_PACKET_SERVICE_AUTOMATIC_ATTACH (MbimDeprecatedRegistrationFlag) MBIM_REGISTRATION_FLAG_PACKET_SERVICE_AUTOMATIC_ATTACH |
| 48 |
|
| 49 |
/*****************************************************************************/ |
| 50 |
/* 'Service Subscriber List' rename to 'Service Subscribe List' */ |
| 51 |
|
| 52 |
/* The following type exists just so that we can get deprecation warnings */ |
| 53 |
#if defined(__clang__) |
| 54 |
# pragma clang diagnostic push |
| 55 |
# pragma clang diagnostic ignored "-Wtypedef-redefinition" |
| 56 |
#endif |
| 57 |
G_DEPRECATED |
| 58 |
typedef int MbimDeprecatedCidBasicConnect; |
| 59 |
#if defined(__clang__) |
| 60 |
# pragma clang diagnostic pop |
| 61 |
#endif |
| 62 |
|
| 63 |
/** |
| 64 |
* MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBER_LIST: |
| 65 |
* |
| 66 |
* Device service subscribe list. |
| 67 |
* |
| 68 |
* Since: 1.0 |
| 69 |
* Deprecated: 1.8: Use MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBE_LIST instead. |
| 70 |
*/ |
| 71 |
#define MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBER_LIST (MbimDeprecatedCidBasicConnect) MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBE_LIST |
| 72 |
|
| 73 |
/** |
| 74 |
* mbim_message_device_service_subscriber_list_set_new: |
| 75 |
* @events_count: the 'EventsCount' field, given as a #guint32. |
| 76 |
* @events: the 'Events' field, given as an array of #MbimEventEntrys. |
| 77 |
* @error: return location for error or %NULL. |
| 78 |
* |
| 79 |
* Create a new request for the 'Device Service Subscribe List' set command in the 'Basic Connect' service. |
| 80 |
* |
| 81 |
* Returns: a newly allocated #MbimMessage, which should be freed with mbim_message_unref(). |
| 82 |
* |
| 83 |
* Since: 1.0 |
| 84 |
* Deprecated: 1.8: Use mbim_message_device_service_subscribe_list_set_new() instead. |
| 85 |
*/ |
| 86 |
G_DEPRECATED_FOR (mbim_message_device_service_subscribe_list_set_new) |
| 87 |
MbimMessage *mbim_message_device_service_subscriber_list_set_new ( |
| 88 |
guint32 events_count, |
| 89 |
const MbimEventEntry *const *events, |
| 90 |
GError **error); |
| 91 |
|
| 92 |
/** |
| 93 |
* mbim_message_device_service_subscriber_list_response_parse: |
| 94 |
* @message: the #MbimMessage. |
| 95 |
* @events_count: return location for a #guint32, or %NULL if the 'EventsCount' field is not needed. |
| 96 |
* @events: return location for a newly allocated array of #MbimEventEntrys, or %NULL if the 'Events' field is not needed. Free the returned value with mbim_event_entry_array_free(). |
| 97 |
* @error: return location for error or %NULL. |
| 98 |
* |
| 99 |
* Create a new request for the 'Events' response command in the 'Basic Connect' service. |
| 100 |
* |
| 101 |
* Returns: %TRUE if the message was correctly parsed, %FALSE if @error is set. |
| 102 |
* |
| 103 |
* Since: 1.0 |
| 104 |
* Deprecated: 1.8: Use mbim_message_device_service_subscribe_list_response_parse() instead. |
| 105 |
*/ |
| 106 |
G_DEPRECATED_FOR (mbim_message_device_service_subscribe_list_response_parse) |
| 107 |
gboolean mbim_message_device_service_subscriber_list_response_parse ( |
| 108 |
const MbimMessage *message, |
| 109 |
guint32 *events_count, |
| 110 |
MbimEventEntry ***events, |
| 111 |
GError **error); |
| 112 |
|
| 113 |
/*****************************************************************************/ |
| 114 |
/* 'LTE Attach Status' rename to 'LTE Attach Info', to avoid the unneeded |
| 115 |
* MbimLteAttachStatus struct */ |
| 116 |
|
| 117 |
/* The following type exists just so that we can get deprecation warnings */ |
| 118 |
#if defined(__clang__) |
| 119 |
# pragma clang diagnostic push |
| 120 |
# pragma clang diagnostic ignored "-Wtypedef-redefinition" |
| 121 |
#endif |
| 122 |
G_DEPRECATED |
| 123 |
typedef int MbimDeprecatedCidMsBasicConnectExtensions; |
| 124 |
#if defined(__clang__) |
| 125 |
# pragma clang diagnostic pop |
| 126 |
#endif |
| 127 |
|
| 128 |
/** |
| 129 |
* MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_LTE_ATTACH_STATUS: |
| 130 |
* |
| 131 |
* LTE attach info. |
| 132 |
* |
| 133 |
* Since: 1.18 |
| 134 |
* Deprecated: 1.26: Use MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_LTE_ATTACH_INFO instead. |
| 135 |
*/ |
| 136 |
#define MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_LTE_ATTACH_STATUS (MbimDeprecatedCidMsBasicConnectExtensions)MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_LTE_ATTACH_INFO |
| 137 |
|
| 138 |
/** |
| 139 |
* MbimLteAttachStatus: |
| 140 |
* @lte_attach_state: a #guint32. |
| 141 |
* @ip_type: a #guint32. |
| 142 |
* @access_string: a string. |
| 143 |
* @user_name: a string. |
| 144 |
* @password: a string. |
| 145 |
* @compression: a #guint32. |
| 146 |
* @auth_protocol: a #guint32. |
| 147 |
* |
| 148 |
* LTE attach status information. |
| 149 |
* |
| 150 |
* Since: 1.18 |
| 151 |
* Deprecated: 1.26 |
| 152 |
*/ |
| 153 |
|
| 154 |
/* The following type exists just so that we don't getdeprecation warnings on |
| 155 |
* our own methods */ |
| 156 |
typedef struct { |
| 157 |
guint32 lte_attach_state; |
| 158 |
guint32 ip_type; |
| 159 |
gchar *access_string; |
| 160 |
gchar *user_name; |
| 161 |
gchar *password; |
| 162 |
guint32 compression; |
| 163 |
guint32 auth_protocol; |
| 164 |
} MbimDeprecatedLteAttachStatus; |
| 165 |
|
| 166 |
G_DEPRECATED |
| 167 |
typedef MbimDeprecatedLteAttachStatus MbimLteAttachStatus; |
| 168 |
|
| 169 |
/** |
| 170 |
* mbim_lte_attach_status_free: |
| 171 |
* @var: a #MbimLteAttachStatus. |
| 172 |
* |
| 173 |
* Frees the memory allocated for the #MbimLteAttachStatus. |
| 174 |
* |
| 175 |
* Since: 1.18 |
| 176 |
* Deprecated: 1.26 |
| 177 |
*/ |
| 178 |
G_DEPRECATED |
| 179 |
void mbim_lte_attach_status_free (MbimDeprecatedLteAttachStatus *var); |
| 180 |
|
| 181 |
#if defined(__clang__) || defined(__GNUC__) |
| 182 |
# pragma GCC diagnostic push |
| 183 |
# pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
| 184 |
#endif |
| 185 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MbimLteAttachStatus, mbim_lte_attach_status_free) |
| 186 |
#if defined(__clang__) || defined (__GNUC__) |
| 187 |
# pragma GCC diagnostic pop |
| 188 |
#endif |
| 189 |
|
| 190 |
/** |
| 191 |
* mbim_message_ms_basic_connect_extensions_lte_attach_status_query_new: |
| 192 |
* @error: return location for error or %NULL. |
| 193 |
* |
| 194 |
* Create a new request for the 'Lte Attach Status' query command in the 'Ms Basic Connect Extensions' service. |
| 195 |
* |
| 196 |
* Returns: a newly allocated #MbimMessage, which should be freed with mbim_message_unref(). |
| 197 |
* |
| 198 |
* Since: 1.18 |
| 199 |
* Deprecated: 1.26: Use mbim_message_ms_basic_connect_extensions_lte_attach_info_query_new() instead. |
| 200 |
*/ |
| 201 |
G_DEPRECATED_FOR (mbim_message_ms_basic_connect_extensions_lte_attach_info_query_new) |
| 202 |
MbimMessage *mbim_message_ms_basic_connect_extensions_lte_attach_status_query_new ( |
| 203 |
GError **error); |
| 204 |
|
| 205 |
/** |
| 206 |
* mbim_message_ms_basic_connect_extensions_lte_attach_status_response_parse: |
| 207 |
* @message: the #MbimMessage. |
| 208 |
* @out_lte_attach_status: (out)(optional)(transfer full): return location for a newly allocated #MbimLteAttachStatus, or %NULL if the 'LteAttachStatus' field is not needed. Free the returned value with mbim_lte_attach_status_free(). |
| 209 |
* @error: return location for error or %NULL. |
| 210 |
* |
| 211 |
* Parses and returns parameters of the 'Lte Attach Status' response command in the 'Ms Basic Connect Extensions' service. |
| 212 |
* |
| 213 |
* Returns: %TRUE if the message was correctly parsed, %FALSE if @error is set. |
| 214 |
* |
| 215 |
* Since: 1.18 |
| 216 |
* Deprecated: 1.26: Use mbim_message_ms_basic_connect_extensions_lte_attach_info_response_parse() instead. |
| 217 |
*/ |
| 218 |
G_DEPRECATED_FOR (mbim_message_ms_basic_connect_extensions_lte_attach_info_response_parse) |
| 219 |
gboolean mbim_message_ms_basic_connect_extensions_lte_attach_status_response_parse ( |
| 220 |
const MbimMessage *message, |
| 221 |
MbimDeprecatedLteAttachStatus **out_lte_attach_status, |
| 222 |
GError **error); |
| 223 |
|
| 224 |
/** |
| 225 |
* mbim_message_ms_basic_connect_extensions_lte_attach_status_notification_parse: |
| 226 |
* @message: the #MbimMessage. |
| 227 |
* @out_lte_attach_status: (out)(optional)(transfer full): return location for a newly allocated #MbimLteAttachStatus, or %NULL if the 'LteAttachStatus' field is not needed. Free the returned value with mbim_lte_attach_status_free(). |
| 228 |
* @error: return location for error or %NULL. |
| 229 |
* |
| 230 |
* Parses and returns parameters of the 'Lte Attach Status' notification command in the 'Ms Basic Connect Extensions' service. |
| 231 |
* |
| 232 |
* Returns: %TRUE if the message was correctly parsed, %FALSE if @error is set. |
| 233 |
* |
| 234 |
* Since: 1.18 |
| 235 |
* Deprecated: 1.26: Use mbim_message_ms_basic_connect_extensions_lte_attach_info_notification_parse() instead. |
| 236 |
*/ |
| 237 |
G_DEPRECATED_FOR (mbim_message_ms_basic_connect_extensions_lte_attach_info_notification_parse) |
| 238 |
gboolean mbim_message_ms_basic_connect_extensions_lte_attach_status_notification_parse ( |
| 239 |
const MbimMessage *message, |
| 240 |
MbimDeprecatedLteAttachStatus **out_lte_attach_status, |
| 241 |
GError **error); |
| 242 |
|
| 243 |
/*****************************************************************************/ |
| 244 |
/* Network errors fixup */ |
| 245 |
|
| 246 |
/* The following type exists just so that we can get deprecation warnings */ |
| 247 |
#if defined(__clang__) |
| 248 |
# pragma clang diagnostic push |
| 249 |
# pragma clang diagnostic ignored "-Wtypedef-redefinition" |
| 250 |
#endif |
| 251 |
G_DEPRECATED |
| 252 |
typedef int MbimDeprecatedNwError; |
| 253 |
#if defined(__clang__) |
| 254 |
# pragma clang diagnostic pop |
| 255 |
#endif |
| 256 |
|
| 257 |
/** |
| 258 |
* MBIM_NW_ERROR_UNKNOWN: |
| 259 |
* |
| 260 |
* Network error not set. |
| 261 |
* |
| 262 |
* Since: 1.0 |
| 263 |
* Deprecated: 1.28: Use %MBIM_NW_ERROR_NONE instead. |
| 264 |
*/ |
| 265 |
#define MBIM_NW_ERROR_UNKNOWN (MbimDeprecatedNwError) MBIM_NW_ERROR_NONE |
| 266 |
|
| 267 |
/*****************************************************************************/ |
| 268 |
/* Rename blacklist to denylist */ |
| 269 |
|
| 270 |
/* The following type exists just so that we can get deprecation warnings */ |
| 271 |
#if defined(__clang__) |
| 272 |
# pragma clang diagnostic push |
| 273 |
# pragma clang diagnostic ignored "-Wtypedef-redefinition" |
| 274 |
#endif |
| 275 |
G_DEPRECATED |
| 276 |
typedef int MbimDeprecatedCidMsBasicConnectExtensions; |
| 277 |
#if defined(__clang__) |
| 278 |
# pragma clang diagnostic pop |
| 279 |
#endif |
| 280 |
|
| 281 |
/** |
| 282 |
* MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_NETWORK_BLACKLIST: |
| 283 |
* |
| 284 |
* Network deny list. |
| 285 |
* |
| 286 |
* Since: 1.18 |
| 287 |
* Deprecated: 1.28: Use MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_NETWORK_DENYLIST instead. |
| 288 |
*/ |
| 289 |
#define MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_NETWORK_BLACKLIST (MbimDeprecatedCidMsBasicConnectExtensions) MBIM_CID_MS_BASIC_CONNECT_EXTENSIONS_NETWORK_DENYLIST |
| 290 |
|
| 291 |
/*****************************************************************************/ |
| 292 |
/* MbimSmsStatusFlag is flags, not an enum */ |
| 293 |
|
| 294 |
/** |
| 295 |
* mbim_sms_status_flag_get_string: |
| 296 |
* @val: a MbimSmsStatusFlag. |
| 297 |
* |
| 298 |
* Gets the nickname string for the #MbimSmsStatusFlag specified at @val. |
| 299 |
* |
| 300 |
* Returns: (transfer none): a string with the nickname, or %NULL if not found. Do not free the returned value. |
| 301 |
* |
| 302 |
* Since: 1.4 |
| 303 |
* Deprecated: 1.30: Use mbim_sms_status_flag_build_string_from_mask() instead. |
| 304 |
*/ |
| 305 |
G_DEPRECATED_FOR (mbim_sms_status_flag_build_string_from_mask) |
| 306 |
const gchar *mbim_sms_status_flag_get_string (MbimSmsStatusFlag val); |
| 307 |
|
| 308 |
#endif /* MBIM_DISABLE_DEPRECATED */ |
| 309 |
|
| 310 |
G_END_DECLS |
| 311 |
|
| 312 |
#endif /* _LIBMBIM_GLIB_MBIM_COMPAT_H_ */ |