| 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 Aleksander Morgado <[email protected]> |
| 5 |
*/ |
| 6 |
|
| 7 |
#include "mbim-compat.h" |
| 8 |
|
| 9 |
#ifndef MBIM_DISABLE_DEPRECATED |
| 10 |
|
| 11 |
/*****************************************************************************/ |
| 12 |
/* 'Service Subscriber List' rename to 'Service Subscribe List' */ |
| 13 |
|
| 14 |
MbimMessage * |
| 15 |
mbim_message_device_service_subscriber_list_set_new ( |
| 16 |
guint32 events_count, |
| 17 |
const MbimEventEntry *const *events, |
| 18 |
GError **error) |
| 19 |
{ |
| 20 |
return (mbim_message_device_service_subscribe_list_set_new ( |
| 21 |
events_count, |
| 22 |
events, |
| 23 |
error)); |
| 24 |
} |
| 25 |
|
| 26 |
gboolean |
| 27 |
mbim_message_device_service_subscriber_list_response_parse ( |
| 28 |
const MbimMessage *message, |
| 29 |
guint32 *events_count, |
| 30 |
MbimEventEntry ***events, |
| 31 |
GError **error) |
| 32 |
{ |
| 33 |
return (mbim_message_device_service_subscribe_list_response_parse ( |
| 34 |
message, |
| 35 |
events_count, |
| 36 |
events, |
| 37 |
error)); |
| 38 |
} |
| 39 |
|
| 40 |
/*****************************************************************************/ |
| 41 |
/* 'LTE Attach Status' rename to 'LTE Attach Info', to avoid the unneeded |
| 42 |
* MbimLteAttachStatus struct */ |
| 43 |
|
| 44 |
void |
| 45 |
mbim_lte_attach_status_free (MbimDeprecatedLteAttachStatus *var) |
| 46 |
{ |
| 47 |
if (!var) |
| 48 |
return; |
| 49 |
|
| 50 |
g_free (var->access_string); |
| 51 |
g_free (var->user_name); |
| 52 |
g_free (var->password); |
| 53 |
g_free (var); |
| 54 |
} |
| 55 |
|
| 56 |
MbimMessage * |
| 57 |
mbim_message_ms_basic_connect_extensions_lte_attach_status_query_new (GError **error) |
| 58 |
{ |
| 59 |
return mbim_message_ms_basic_connect_extensions_lte_attach_info_query_new (error); |
| 60 |
} |
| 61 |
|
| 62 |
gboolean |
| 63 |
mbim_message_ms_basic_connect_extensions_lte_attach_status_response_parse ( |
| 64 |
const MbimMessage *message, |
| 65 |
MbimDeprecatedLteAttachStatus **out_lte_attach_status, |
| 66 |
GError **error) |
| 67 |
{ |
| 68 |
g_autoptr(MbimLteAttachStatus) var = NULL; |
| 69 |
|
| 70 |
var = g_new0 (MbimDeprecatedLteAttachStatus, 1); |
| 71 |
if (!mbim_message_ms_basic_connect_extensions_lte_attach_info_response_parse ( |
| 72 |
message, |
| 73 |
&var->lte_attach_state, |
| 74 |
&var->ip_type, |
| 75 |
&var->access_string, |
| 76 |
&var->user_name, |
| 77 |
&var->password, |
| 78 |
&var->compression, |
| 79 |
&var->auth_protocol, |
| 80 |
error)) |
| 81 |
return FALSE; |
| 82 |
|
| 83 |
*out_lte_attach_status = g_steal_pointer (&var); |
| 84 |
return TRUE; |
| 85 |
} |
| 86 |
|
| 87 |
gboolean |
| 88 |
mbim_message_ms_basic_connect_extensions_lte_attach_status_notification_parse ( |
| 89 |
const MbimMessage *message, |
| 90 |
MbimDeprecatedLteAttachStatus **out_lte_attach_status, |
| 91 |
GError **error) |
| 92 |
{ |
| 93 |
g_autoptr(MbimLteAttachStatus) var = NULL; |
| 94 |
|
| 95 |
var = g_new0 (MbimDeprecatedLteAttachStatus, 1); |
| 96 |
if (!mbim_message_ms_basic_connect_extensions_lte_attach_info_notification_parse ( |
| 97 |
message, |
| 98 |
&var->lte_attach_state, |
| 99 |
&var->ip_type, |
| 100 |
&var->access_string, |
| 101 |
&var->user_name, |
| 102 |
&var->password, |
| 103 |
&var->compression, |
| 104 |
&var->auth_protocol, |
| 105 |
error)) |
| 106 |
return FALSE; |
| 107 |
|
| 108 |
*out_lte_attach_status = g_steal_pointer (&var); |
| 109 |
return TRUE; |
| 110 |
} |
| 111 |
|
| 112 |
/*****************************************************************************/ |
| 113 |
/* MbimSmsStatusFlag is flags, not an enum */ |
| 114 |
|
| 115 |
const gchar * |
| 116 |
mbim_sms_status_flag_get_string (MbimSmsStatusFlag val) |
| 117 |
{ |
| 118 |
const gchar *sms_status_flag_values[] = { |
| 119 |
[MBIM_SMS_STATUS_FLAG_NONE] = "none", |
| 120 |
[MBIM_SMS_STATUS_FLAG_MESSAGE_STORE_FULL] = "message-store-full", |
| 121 |
[MBIM_SMS_STATUS_FLAG_NEW_MESSAGE] = "new-message", |
| 122 |
}; |
| 123 |
|
| 124 |
return ((guint)val < G_N_ELEMENTS (sms_status_flag_values)) ? sms_status_flag_values[val] : NULL; |
| 125 |
} |
| 126 |
|
| 127 |
#endif /* MBIM_DISABLE_DEPRECATED */ |