diff options
author | Dylan Van Assche <me@dylanvanassche.be> | 2023-01-01 16:17:12 +0100 |
---|---|---|
committer | Dylan Van Assche <me@dylanvanassche.be> | 2023-08-12 17:20:39 +0200 |
commit | d092dc5d001e586bd24687d7864fad7c0023855d (patch) | |
tree | d75d269048e30e67ec1deda1de18944d538b4fc8 /src/libqmi-glib | |
parent | 4c92bc8f50e7fc1182666e5865330e05e88c850d (diff) |
libqmi-glib,qmicli: implement IMSP service
IMSP service is already known by libqmi but without any implementation.
Add the Get Enabler State method to retrieve the IMS registation status.
IMS is split up in multiple services: IMS, IMSA, IMSP, IMSVT, and
IMSRTP. Other IMS services will be added in other patches.
Diffstat (limited to 'src/libqmi-glib')
-rw-r--r-- | src/libqmi-glib/generated/meson.build | 3 | ||||
-rw-r--r-- | src/libqmi-glib/libqmi-glib.h | 3 | ||||
-rw-r--r-- | src/libqmi-glib/meson.build | 1 | ||||
-rw-r--r-- | src/libqmi-glib/qmi-device.c | 7 | ||||
-rw-r--r-- | src/libqmi-glib/qmi-enums-imsp.h | 58 | ||||
-rw-r--r-- | src/libqmi-glib/qmi-message.c | 5 |
6 files changed, 74 insertions, 3 deletions
diff --git a/src/libqmi-glib/generated/meson.build b/src/libqmi-glib/generated/meson.build index 4e946e9..cd6dbfd 100644 --- a/src/libqmi-glib/generated/meson.build +++ b/src/libqmi-glib/generated/meson.build @@ -68,7 +68,7 @@ gen_headers += custom_target( python, qmi_mkenums, '--enums-only', - '--fhead', '#ifndef __LIBQMI_GLIB_ENUM_TYPES_H__\n#define __LIBQMI_GLIB_ENUM_TYPES_H__\n#include "qmi-enums.h"\n#include "qmi-enums-wds.h"\n#include "qmi-enums-dms.h"\n#include "qmi-enums-nas.h"\n#include "qmi-enums-wms.h"\n#include "qmi-enums-pds.h"\n#include "qmi-enums-pdc.h"\n#include "qmi-enums-pbm.h"\n#include "qmi-enums-uim.h"\n#include "qmi-enums-sar.h"\n#include "qmi-enums-oma.h"\n#include "qmi-enums-wda.h"\n#include "qmi-enums-voice.h"\n#include "qmi-enums-loc.h"\n#include "qmi-enums-qos.h"\n#include "qmi-enums-gas.h"\n#include "qmi-enums-dsd.h"\n#include "qmi-enums-fox.h"\n#include "qmi-device.h"\n', + '--fhead', '#ifndef __LIBQMI_GLIB_ENUM_TYPES_H__\n#define __LIBQMI_GLIB_ENUM_TYPES_H__\n#include "qmi-enums.h"\n#include "qmi-enums-wds.h"\n#include "qmi-enums-dms.h"\n#include "qmi-enums-nas.h"\n#include "qmi-enums-wms.h"\n#include "qmi-enums-pds.h"\n#include "qmi-enums-pdc.h"\n#include "qmi-enums-pbm.h"\n#include "qmi-enums-uim.h"\n#include "qmi-enums-sar.h"\n#include "qmi-enums-oma.h"\n#include "qmi-enums-wda.h"\n#include "qmi-enums-voice.h"\n#include "qmi-enums-loc.h"\n#include "qmi-enums-qos.h"\n#include "qmi-enums-gas.h"\n#include "qmi-enums-dsd.h"\n#include "qmi-enums-fox.h"\n#include "qmi-enums-imsp.h"\n#include "qmi-device.h"\n', '--template', files(templates_dir / enum_types + '.h.template'), '--ftail', '#endif /* __LIBQMI_GLIB_ENUM_TYPES_H__ */\n', '@INPUT@'], @@ -240,6 +240,7 @@ services = [ 'dms', 'dpm', 'dsd', + 'imsp', 'fox', 'gas', 'gms', diff --git a/src/libqmi-glib/libqmi-glib.h b/src/libqmi-glib/libqmi-glib.h index 9193de2..55900a9 100644 --- a/src/libqmi-glib/libqmi-glib.h +++ b/src/libqmi-glib/libqmi-glib.h @@ -101,6 +101,9 @@ #include "qmi-atr.h" +#include "qmi-enums-imsp.h" +#include "qmi-imsp.h" + /* generated */ #include "qmi-error-types.h" #include "qmi-enum-types.h" diff --git a/src/libqmi-glib/meson.build b/src/libqmi-glib/meson.build index 84c8e63..08ce861 100644 --- a/src/libqmi-glib/meson.build +++ b/src/libqmi-glib/meson.build @@ -12,6 +12,7 @@ qmi_enums_headers = files( 'qmi-enums-dsd.h', 'qmi-enums-fox.h', 'qmi-enums-gas.h', + 'qmi-enums-imsp.h', 'qmi-enums-loc.h', 'qmi-enums-nas.h', 'qmi-enums-oma.h', diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c index 4c1fea0..b323b5c 100644 --- a/src/libqmi-glib/qmi-device.c +++ b/src/libqmi-glib/qmi-device.c @@ -58,6 +58,7 @@ #include "qmi-dpm.h" #include "qmi-fox.h" #include "qmi-atr.h" +#include "qmi-imsp.h" #include "qmi-utils.h" #include "qmi-helpers.h" #include "qmi-error-types.h" @@ -1319,6 +1320,11 @@ qmi_device_allocate_client (QmiDevice *self, ctx->client_type = QMI_TYPE_CLIENT_ATR; #endif break; + case QMI_SERVICE_IMSP: +#if defined HAVE_QMI_SERVICE_IMSP + ctx->client_type = QMI_TYPE_CLIENT_IMSP; +#endif + break; case QMI_SERVICE_UNKNOWN: g_assert_not_reached (); @@ -1341,7 +1347,6 @@ qmi_device_allocate_client (QmiDevice *self, case QMI_SERVICE_RFSA: case QMI_SERVICE_CSVT: case QMI_SERVICE_QCMAP: - case QMI_SERVICE_IMSP: case QMI_SERVICE_IMSVT: case QMI_SERVICE_IMSA: case QMI_SERVICE_COEX: diff --git a/src/libqmi-glib/qmi-enums-imsp.h b/src/libqmi-glib/qmi-enums-imsp.h new file mode 100644 index 0000000..781f0c9 --- /dev/null +++ b/src/libqmi-glib/qmi-enums-imsp.h @@ -0,0 +1,58 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * libqmi-glib -- GLib/GIO based library to control QMI devices + * + * 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) 2023 Dylan Van Assche <me@dylanvanassche.be> + */ + +#ifndef _LIBQMI_GLIB_QMI_ENUMS_IMSP_H_ +#define _LIBQMI_GLIB_QMI_ENUMS_IMSP_H_ + +#if !defined (__LIBQMI_GLIB_H_INSIDE__) && !defined (LIBQMI_GLIB_COMPILATION) +#error "Only <libqmi-glib.h> can be included directly." +#endif + +/** + * SECTION: qmi-enums-imsp + * @title: IMSP enumerations and flags + * @short_description: Enumerations and flags in the IMSP service. + * + * This section defines enumerations and flags used in the IMSP service + * interface. + */ + +/** + * QmiImspEnablerState: + * @QMI_IMSP_ENABLER_STATE_UNINITIALIZED: IMS is not initialized yet. + * @QMI_IMSP_ENABLER_STATE_INITIALIZED: IMS is initialized, but not registered yet with the network IMS service. + * @QMI_IMSP_ENABLER_STATE_AIRPLANE: IMS is initialized but device is in airplane mode. + * @QMI_IMSP_ENABLER_STATE_REGISTERED: IMS is initialized and registered. + * + * IMS Presence enabler state. + * + * Since: 1.34 + */ +typedef enum { /*< since=1.34 >*/ + QMI_IMSP_ENABLER_STATE_UNINITIALIZED = 0x01, + QMI_IMSP_ENABLER_STATE_INITIALIZED = 0x02, + QMI_IMSP_ENABLER_STATE_AIRPLANE = 0x03, + QMI_IMSP_ENABLER_STATE_REGISTERED = 0x04, +} QmiImspEnablerState; + +#endif /* _LIBQMI_GLIB_QMI_ENUMS_IMSP_H_ */ + diff --git a/src/libqmi-glib/qmi-message.c b/src/libqmi-glib/qmi-message.c index 1f09360..c036276 100644 --- a/src/libqmi-glib/qmi-message.c +++ b/src/libqmi-glib/qmi-message.c @@ -1737,6 +1737,10 @@ qmi_message_get_printable_full (QmiMessage *self, #if defined HAVE_QMI_SERVICE_ATR contents = __qmi_message_atr_get_printable (self, context, line_prefix); #endif + case QMI_SERVICE_IMSP: +#if defined HAVE_QMI_SERVICE_IMSP + contents = __qmi_message_imsp_get_printable (self, context, line_prefix); +#endif break; case QMI_SERVICE_UNKNOWN: @@ -1761,7 +1765,6 @@ qmi_message_get_printable_full (QmiMessage *self, case QMI_SERVICE_RFSA: case QMI_SERVICE_CSVT: case QMI_SERVICE_QCMAP: - case QMI_SERVICE_IMSP: case QMI_SERVICE_IMSVT: case QMI_SERVICE_IMSA: case QMI_SERVICE_COEX: |