diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2014-03-06 12:23:40 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2014-03-06 12:59:37 +0100 |
commit | bff421b8b813be29909d05f8619b52788591f3e4 (patch) | |
tree | 36ac2e4c6efaa8205489dc8b05816bcd9484633b | |
parent | d33dc227e0a6eaf9004dee59afc86b5e8fc3a6a4 (diff) | |
download | libmbim-bff421b8b813be29909d05f8619b52788591f3e4.tar.gz |
libmbim-glib: small layer for backwards compatibility
-rw-r--r-- | docs/reference/libmbim-glib/libmbim-glib-common.sections | 8 | ||||
-rw-r--r-- | docs/reference/libmbim-glib/libmbim-glib-docs.xml | 9 | ||||
-rw-r--r-- | src/libmbim-glib/Makefile.am | 6 | ||||
-rw-r--r-- | src/libmbim-glib/libmbim-glib.h | 3 | ||||
-rw-r--r-- | src/libmbim-glib/mbim-compat.c | 83 | ||||
-rw-r--r-- | src/libmbim-glib/mbim-compat.h | 75 |
6 files changed, 178 insertions, 6 deletions
diff --git a/docs/reference/libmbim-glib/libmbim-glib-common.sections b/docs/reference/libmbim-glib/libmbim-glib-common.sections index 6059dab..59f6021 100644 --- a/docs/reference/libmbim-glib/libmbim-glib-common.sections +++ b/docs/reference/libmbim-glib/libmbim-glib-common.sections @@ -488,3 +488,11 @@ mbim_status_error_get_type mbim_utils_get_traces_enabled mbim_utils_set_traces_enabled </SECTION> + +<SECTION> +<FILE>mbim-compat</FILE> +MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBER_LIST +MBIM_REGISTRATION_FLAG_MANUAL_PACKET_SERVICE_AUTOMATIC_ATTACH +mbim_message_device_service_subscriber_list_response_parse +mbim_message_device_service_subscriber_list_set_new +</SECTION> diff --git a/docs/reference/libmbim-glib/libmbim-glib-docs.xml b/docs/reference/libmbim-glib/libmbim-glib-docs.xml index 5eb09a4..b68fb71 100644 --- a/docs/reference/libmbim-glib/libmbim-glib-docs.xml +++ b/docs/reference/libmbim-glib/libmbim-glib-docs.xml @@ -62,6 +62,11 @@ <xi:include href="xml/mbim-ms-host-shutdown.xml"/> </chapter> + <chapter> + <title>Compatibility</title> + <xi:include href="xml/mbim-compat.xml"/> + </chapter> + <chapter id="object-tree"> <title>Object Hierarchy</title> <xi:include href="xml/tree_index.sgml"/> @@ -70,10 +75,6 @@ <title>API Index</title> <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include> </index> - <index id="deprecated-api-index" role="deprecated"> - <title>Index of deprecated API</title> - <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include> - </index> <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include> </book> diff --git a/src/libmbim-glib/Makefile.am b/src/libmbim-glib/Makefile.am index b9cb8b3..0988a28 100644 --- a/src/libmbim-glib/Makefile.am +++ b/src/libmbim-glib/Makefile.am @@ -21,7 +21,8 @@ libmbim_glib_core_la_SOURCES = \ mbim-uuid.h mbim-uuid.c \ mbim-cid.h mbim-cid.c \ mbim-message-private.h mbim-message.h mbim-message.c \ - mbim-device.h mbim-device.c + mbim-device.h mbim-device.c \ + mbim-compat.h mbim-compat.c # Final installable library lib_LTLIBRARIES = libmbim-glib.la @@ -48,7 +49,8 @@ include_HEADERS = \ mbim-uuid.h \ mbim-cid.h \ mbim-message.h \ - mbim-device.h + mbim-device.h \ + mbim-compat.h EXTRA_DIST = \ mbim-version.h.in diff --git a/src/libmbim-glib/libmbim-glib.h b/src/libmbim-glib/libmbim-glib.h index f6a7d65..25e14fd 100644 --- a/src/libmbim-glib/libmbim-glib.h +++ b/src/libmbim-glib/libmbim-glib.h @@ -48,4 +48,7 @@ #include "mbim-ms-firmware-id.h" #include "mbim-ms-host-shutdown.h" +/* backwards compatibility */ +#include "mbim-compat.h" + #endif /* _LIBMBIM_GLIB_H_ */ diff --git a/src/libmbim-glib/mbim-compat.c b/src/libmbim-glib/mbim-compat.c new file mode 100644 index 0000000..ee30a48 --- /dev/null +++ b/src/libmbim-glib/mbim-compat.c @@ -0,0 +1,83 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * 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 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 Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2014 Aleksander Morgado <aleksander@aleksander.es> + */ + +#include "mbim-compat.h" + +/** + * SECTION: mbim-compat + * @title: Deprecated API + * @short_description: Types and functions flagged as deprecated. + * + * This section defines types and functions that have been deprecated. + */ + +/*****************************************************************************/ +/* 'Service Subscriber List' rename to 'Service Subscribe List' */ + +/** + * mbim_message_device_service_subscriber_list_set_new: + * @events_count: the 'EventsCount' field, given as a #guint32. + * @events: the 'Events' field, given as an array of #MbimEventEntrys. + * @error: return location for error or %NULL. + * + * Create a new request for the 'Device Service Subscribe List' set command in the 'Basic Connect' service. + * + * Returns: a newly allocated #MbimMessage, which should be freed with mbim_message_unref(). + * + * Deprecated:1.8.0: Use mbim_message_device_service_subscribe_list_set_new() instead. + */ +MbimMessage * +mbim_message_device_service_subscriber_list_set_new ( + guint32 events_count, + const MbimEventEntry *const *events, + GError **error) +{ + return (mbim_message_device_service_subscribe_list_set_new ( + events_count, + events, + error)); +} + +/** + * mbim_message_device_service_subscriber_list_response_parse: + * @message: the #MbimMessage. + * @events_count: return location for a #guint32, or %NULL if the 'EventsCount' field is not needed. + * @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(). + * @error: return location for error or %NULL. + * + * Create a new request for the 'Events' response command in the 'Basic Connect' service. + * + * Returns: %TRUE if the message was correctly parsed, %FALSE if @error is set. + * + * Deprecated:1.8.0: Use mbim_message_device_service_subscribe_list_response_parse() instead. + */ +gboolean +mbim_message_device_service_subscriber_list_response_parse ( + const MbimMessage *message, + guint32 *events_count, + MbimEventEntry ***events, + GError **error) +{ + return (mbim_message_device_service_subscribe_list_response_parse ( + message, + events_count, + events, + error)); +} diff --git a/src/libmbim-glib/mbim-compat.h b/src/libmbim-glib/mbim-compat.h new file mode 100644 index 0000000..8fbf8b8 --- /dev/null +++ b/src/libmbim-glib/mbim-compat.h @@ -0,0 +1,75 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * 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 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 Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2014 Aleksander Morgado <aleksander@aleksander.es> + */ + +#ifndef _LIBMBIM_GLIB_MBIM_COMPAT_H_ +#define _LIBMBIM_GLIB_MBIM_COMPAT_H_ + +#if !defined (__LIBMBIM_GLIB_H_INSIDE__) && !defined (LIBMBIM_GLIB_COMPILATION) +#error "Only <libmbim-glib.h> can be included directly." +#endif + +#include <glib.h> + +#include "mbim-basic-connect.h" + +G_BEGIN_DECLS + +/*****************************************************************************/ +/* Registration flags name fixup */ + +/** + * MBIM_REGISTRATION_FLAG_MANUAL_PACKET_SERVICE_AUTOMATIC_ATTACH: + * + * Modem should auto-attach to the network after registration. + * + * Deprecated:1.8.0: Use MBIM_REGISTRATION_FLAG_PACKET_SERVICE_AUTOMATIC_ATTACH instead. + */ +G_DEPRECATED_FOR (MBIM_REGISTRATION_FLAG_PACKET_SERVICE_AUTOMATIC_ATTACH) +#define MBIM_REGISTRATION_FLAG_MANUAL_PACKET_SERVICE_AUTOMATIC_ATTACH MBIM_REGISTRATION_FLAG_PACKET_SERVICE_AUTOMATIC_ATTACH + +/*****************************************************************************/ +/* 'Service Subscriber List' rename to 'Service Subscribe List' */ + +/** + * MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBER_LIST: + * + * Device service subscribe list. + * + * Deprecated:1.8.0: Use MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBE_LIST instead. + */ +G_DEPRECATED_FOR (MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBE_LIST) +#define MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBER_LIST MBIM_CID_BASIC_CONNECT_DEVICE_SERVICE_SUBSCRIBE_LIST + +G_DEPRECATED_FOR (mbim_message_device_service_subscribe_list_set_new) +MbimMessage *mbim_message_device_service_subscriber_list_set_new ( + guint32 events_count, + const MbimEventEntry *const *events, + GError **error); + +G_DEPRECATED_FOR (mbim_message_device_service_subscribe_list_response_parse) +gboolean mbim_message_device_service_subscriber_list_response_parse ( + const MbimMessage *message, + guint32 *events_count, + MbimEventEntry ***events, + GError **error); + +G_END_DECLS + +#endif /* _LIBMBIM_GLIB_MBIM_COMPAT_H_ */ |