build: autogenerate `mm-errors-quarks.c'

We define custom nicks for each error enum, matching the DBus error entry that
we want to have with each of them.
This commit is contained in:
Aleksander Morgado
2012-03-09 17:01:13 +01:00
parent be7f499aa6
commit 961290ddd7
7 changed files with 178 additions and 331 deletions

1
.gitignore vendored
View File

@@ -57,6 +57,7 @@ include/ModemManager-names.h
libmm-common/mm-gdbus-*.[ch]
libmm-common/mm-enums-types.[ch]
libmm-common/mm-errors-types.[ch]
libmm-common/mm-errors-quarks.c
libmm-common/*.xml
libmm-common/tests/test-common-helpers

View File

@@ -134,6 +134,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define MM_DBUS_SIM_PREFIX MM_DBUS_PATH "/SIM"
#define MM_DBUS_SMS_PREFIX MM_DBUS_PATH "/SMS"
/* Prefix for DBus errors */
#define MM_DBUS_ERROR_PREFIX "org.freedesktop.ModemManager1.Error"
/**************
* Interfaces *
**************/

View File

@@ -0,0 +1,42 @@
/*** BEGIN file-header ***/
#include <gio/gio.h>
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@filename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/
#define ERROR_PREFIX @ENUMNAME@_DBUS_PREFIX
static const GDBusErrorEntry @enum_name@_entries[] = {
/*** END value-header ***/
/*** BEGIN value-production ***/
{ @VALUENAME@, ERROR_PREFIX ".@valuenick@" },
/*** END value-production ***/
/*** BEGIN value-tail ***/
};
#undef ERROR_PREFIX
GQuark
@enum_name@_quark (void)
{
static volatile gsize quark_volatile = 0;
if (!quark_volatile)
g_dbus_error_register_error_domain ("@enum_name@_quark",
&quark_volatile,
@enum_name@_entries,
G_N_ELEMENTS (@enum_name@_entries));
return (GQuark) quark_volatile;
}
/*** END value-tail ***/
/*** BEGIN file-tail ***/
/*** END file-tail ***/

View File

@@ -31,4 +31,11 @@ MMMessageError
MMMobileEquipmentError
MMSerialError
MMCdmaActivationError
<SUBSECTION Private>
MM_CDMA_ACTIVATION_ERROR_DBUS_PREFIX
MM_CONNECTION_ERROR_DBUS_PREFIX
MM_CORE_ERROR_DBUS_PREFIX
MM_MESSAGE_ERROR_DBUS_PREFIX
MM_MOBILE_EQUIPMENT_ERROR_DBUS_PREFIX
MM_SERIAL_ERROR_DBUS_PREFIX
</SECTION>

View File

@@ -17,6 +17,8 @@
#ifndef _MODEMMANAGER_ERRORS_H_
#define _MODEMMANAGER_ERRORS_H_
#include <ModemManager-names.h>
/**
* SECTION:mm-errors
* @short_description: Common errors in the API.
@@ -25,6 +27,13 @@
* ModemManager interface.
**/
#define MM_CORE_ERROR_DBUS_PREFIX MM_DBUS_ERROR_PREFIX ".Core"
#define MM_MOBILE_EQUIPMENT_ERROR_DBUS_PREFIX MM_DBUS_ERROR_PREFIX ".MobileEquipment"
#define MM_CONNECTION_ERROR_DBUS_PREFIX MM_DBUS_ERROR_PREFIX ".Connection"
#define MM_SERIAL_ERROR_DBUS_PREFIX MM_DBUS_ERROR_PREFIX ".Serial"
#define MM_MESSAGE_ERROR_DBUS_PREFIX MM_DBUS_ERROR_PREFIX ".Message"
#define MM_CDMA_ACTIVATION_ERROR_DBUS_PREFIX MM_DBUS_ERROR_PREFIX ".CdmaActivation"
/**
* MMCoreError:
* @MM_CORE_ERROR_FAILED: Operation failed.
@@ -44,19 +53,19 @@
* Common errors that may be reported by ModemManager.
*/
typedef enum { /*< underscore_name=mm_core_error >*/
MM_CORE_ERROR_FAILED = 0,
MM_CORE_ERROR_CANCELLED = 1,
MM_CORE_ERROR_ABORTED = 2,
MM_CORE_ERROR_UNSUPPORTED = 3,
MM_CORE_ERROR_NO_PLUGINS = 4,
MM_CORE_ERROR_UNAUTHORIZED = 5,
MM_CORE_ERROR_INVALID_ARGS = 6,
MM_CORE_ERROR_IN_PROGRESS = 7,
MM_CORE_ERROR_WRONG_STATE = 8,
MM_CORE_ERROR_CONNECTED = 9,
MM_CORE_ERROR_TOO_MANY = 10,
MM_CORE_ERROR_NOT_FOUND = 11,
MM_CORE_ERROR_RETRY = 12,
MM_CORE_ERROR_FAILED = 0, /*< nick=Failed >*/
MM_CORE_ERROR_CANCELLED = 1, /*< nick=Cancelled >*/
MM_CORE_ERROR_ABORTED = 2, /*< nick=Aborted >*/
MM_CORE_ERROR_UNSUPPORTED = 3, /*< nick=Unsupported >*/
MM_CORE_ERROR_NO_PLUGINS = 4, /*< nick=NoPlugins >*/
MM_CORE_ERROR_UNAUTHORIZED = 5, /*< nick=Unauthorized >*/
MM_CORE_ERROR_INVALID_ARGS = 6, /*< nick=InvalidArgs >*/
MM_CORE_ERROR_IN_PROGRESS = 7, /*< nick=InProgress >*/
MM_CORE_ERROR_WRONG_STATE = 8, /*< nick=WrongState >*/
MM_CORE_ERROR_CONNECTED = 9, /*< nick=Connected >*/
MM_CORE_ERROR_TOO_MANY = 10, /*< nick=TooMany >*/
MM_CORE_ERROR_NOT_FOUND = 11, /*< nick=NotFound >*/
MM_CORE_ERROR_RETRY = 12, /*< nick=Retry >*/
} MMCoreError;
/**
@@ -115,56 +124,56 @@ typedef enum { /*< underscore_name=mm_core_error >*/
*/
typedef enum { /*< underscore_name=mm_mobile_equipment_error >*/
/* General errors */
MM_MOBILE_EQUIPMENT_ERROR_PHONE_FAILURE = 0,
MM_MOBILE_EQUIPMENT_ERROR_NO_CONNECTION = 1,
MM_MOBILE_EQUIPMENT_ERROR_LINK_RESERVED = 2,
MM_MOBILE_EQUIPMENT_ERROR_NOT_ALLOWED = 3,
MM_MOBILE_EQUIPMENT_ERROR_NOT_SUPPORTED = 4,
MM_MOBILE_EQUIPMENT_ERROR_PH_SIM_PIN = 5,
MM_MOBILE_EQUIPMENT_ERROR_PH_FSIM_PIN = 6,
MM_MOBILE_EQUIPMENT_ERROR_PH_FSIM_PUK = 7,
MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED = 10,
MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN = 11,
MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK = 12,
MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE = 13,
MM_MOBILE_EQUIPMENT_ERROR_SIM_BUSY = 14,
MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG = 15,
MM_MOBILE_EQUIPMENT_ERROR_INCORRECT_PASSWORD = 16,
MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN2 = 17,
MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK2 = 18,
MM_MOBILE_EQUIPMENT_ERROR_MEMORY_FULL = 20,
MM_MOBILE_EQUIPMENT_ERROR_INVALID_INDEX = 21,
MM_MOBILE_EQUIPMENT_ERROR_NOT_FOUND = 22,
MM_MOBILE_EQUIPMENT_ERROR_MEMORY_FAILURE = 23,
MM_MOBILE_EQUIPMENT_ERROR_TEXT_TOO_LONG = 24,
MM_MOBILE_EQUIPMENT_ERROR_INVALID_CHARS = 25,
MM_MOBILE_EQUIPMENT_ERROR_DIAL_STRING_TOO_LONG = 26,
MM_MOBILE_EQUIPMENT_ERROR_DIAL_STRING_INVALID = 27,
MM_MOBILE_EQUIPMENT_ERROR_NO_NETWORK = 30,
MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT = 31,
MM_MOBILE_EQUIPMENT_ERROR_NETWORK_NOT_ALLOWED = 32,
MM_MOBILE_EQUIPMENT_ERROR_NETWORK_PIN = 40,
MM_MOBILE_EQUIPMENT_ERROR_NETWORK_PUK = 41,
MM_MOBILE_EQUIPMENT_ERROR_NETWORK_SUBSET_PIN = 42,
MM_MOBILE_EQUIPMENT_ERROR_NETWORK_SUBSET_PUK = 43,
MM_MOBILE_EQUIPMENT_ERROR_SERVICE_PIN = 44,
MM_MOBILE_EQUIPMENT_ERROR_SERVICE_PUK = 45,
MM_MOBILE_EQUIPMENT_ERROR_CORP_PIN = 46,
MM_MOBILE_EQUIPMENT_ERROR_CORP_PUK = 47,
MM_MOBILE_EQUIPMENT_ERROR_UNKNOWN = 100,
MM_MOBILE_EQUIPMENT_ERROR_PHONE_FAILURE = 0, /*< nick=PhoneFailure >*/
MM_MOBILE_EQUIPMENT_ERROR_NO_CONNECTION = 1, /*< nick=NoConnection >*/
MM_MOBILE_EQUIPMENT_ERROR_LINK_RESERVED = 2, /*< nick=LinkReserved >*/
MM_MOBILE_EQUIPMENT_ERROR_NOT_ALLOWED = 3, /*< nick=NotAllowed >*/
MM_MOBILE_EQUIPMENT_ERROR_NOT_SUPPORTED = 4, /*< nick=NotSupported >*/
MM_MOBILE_EQUIPMENT_ERROR_PH_SIM_PIN = 5, /*< nick=PhSimPin >*/
MM_MOBILE_EQUIPMENT_ERROR_PH_FSIM_PIN = 6, /*< nick=PhFsimPin >*/
MM_MOBILE_EQUIPMENT_ERROR_PH_FSIM_PUK = 7, /*< nick=PhFsimPuk >*/
MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED = 10, /*< nick=SimNotInserted >*/
MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN = 11, /*< nick=SimPin >*/
MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK = 12, /*< nick=SimPuk >*/
MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE = 13, /*< nick=SimFailure >*/
MM_MOBILE_EQUIPMENT_ERROR_SIM_BUSY = 14, /*< nick=SimBusy >*/
MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG = 15, /*< nick=SimWrong >*/
MM_MOBILE_EQUIPMENT_ERROR_INCORRECT_PASSWORD = 16, /*< nick=IncorrectPassword >*/
MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN2 = 17, /*< nick=SimPin2 >*/
MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK2 = 18, /*< nick=SimPuk2 >*/
MM_MOBILE_EQUIPMENT_ERROR_MEMORY_FULL = 20, /*< nick=MemoryFull >*/
MM_MOBILE_EQUIPMENT_ERROR_INVALID_INDEX = 21, /*< nick=InvalidIndex >*/
MM_MOBILE_EQUIPMENT_ERROR_NOT_FOUND = 22, /*< nick=NotFound >*/
MM_MOBILE_EQUIPMENT_ERROR_MEMORY_FAILURE = 23, /*< nick=MemoryFailure >*/
MM_MOBILE_EQUIPMENT_ERROR_TEXT_TOO_LONG = 24, /*< nick=TextTooLong >*/
MM_MOBILE_EQUIPMENT_ERROR_INVALID_CHARS = 25, /*< nick=InvalidChars >*/
MM_MOBILE_EQUIPMENT_ERROR_DIAL_STRING_TOO_LONG = 26, /*< nick=DialStringTooLong >*/
MM_MOBILE_EQUIPMENT_ERROR_DIAL_STRING_INVALID = 27, /*< nick=DialStringInvalid >*/
MM_MOBILE_EQUIPMENT_ERROR_NO_NETWORK = 30, /*< nick=NoNetwork >*/
MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT = 31, /*< nick=NetworkTimeout >*/
MM_MOBILE_EQUIPMENT_ERROR_NETWORK_NOT_ALLOWED = 32, /*< nick=NetworkNotAllowed >*/
MM_MOBILE_EQUIPMENT_ERROR_NETWORK_PIN = 40, /*< nick=NetworkPin >*/
MM_MOBILE_EQUIPMENT_ERROR_NETWORK_PUK = 41, /*< nick=NetworkPuk >*/
MM_MOBILE_EQUIPMENT_ERROR_NETWORK_SUBSET_PIN = 42, /*< nick=NetworkSubsetPin >*/
MM_MOBILE_EQUIPMENT_ERROR_NETWORK_SUBSET_PUK = 43, /*< nick=NetworkSubsetPuk >*/
MM_MOBILE_EQUIPMENT_ERROR_SERVICE_PIN = 44, /*< nick=ServicePin >*/
MM_MOBILE_EQUIPMENT_ERROR_SERVICE_PUK = 45, /*< nick=ServicePuk >*/
MM_MOBILE_EQUIPMENT_ERROR_CORP_PIN = 46, /*< nick=CorpPin >*/
MM_MOBILE_EQUIPMENT_ERROR_CORP_PUK = 47, /*< nick=CorpPuk >*/
MM_MOBILE_EQUIPMENT_ERROR_UNKNOWN = 100, /*< nick=Unknown >*/
/* GPRS related errors */
MM_MOBILE_EQUIPMENT_ERROR_GPRS_ILLEGAL_MS = 103,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_ILLEGAL_ME = 106,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_NOT_ALLOWED = 107,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_PLMN_NOT_ALLOWED = 111,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_LOCATION_NOT_ALLOWED = 112,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_ROAMING_NOT_ALLOWED = 113,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUPPORTED = 132,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUBSCRIBED = 133,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_OUT_OF_ORDER = 134,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN = 148,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_PDP_AUTH_FAILURE = 149,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_INVALID_MOBILE_CLASS = 150,
MM_MOBILE_EQUIPMENT_ERROR_GPRS_ILLEGAL_MS = 103, /*< nick=Gprs.IllegalMs >*/
MM_MOBILE_EQUIPMENT_ERROR_GPRS_ILLEGAL_ME = 106, /*< nick=Gprs.IllegalMe >*/
MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_NOT_ALLOWED = 107, /*< nick=Gprs.ServiceNotAllowed >*/
MM_MOBILE_EQUIPMENT_ERROR_GPRS_PLMN_NOT_ALLOWED = 111, /*< nick=Gprs.PlmnNotAllowed >*/
MM_MOBILE_EQUIPMENT_ERROR_GPRS_LOCATION_NOT_ALLOWED = 112, /*< nick=Gprs.LocationNotAllowed >*/
MM_MOBILE_EQUIPMENT_ERROR_GPRS_ROAMING_NOT_ALLOWED = 113, /*< nick=Gprs.RomaingNotAllowed >*/
MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUPPORTED = 132, /*< nick=Gprs.ServiceOptionNotSupported >*/
MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUBSCRIBED = 133, /*< nick=Gprs.ServiceOptionNotSubscribed >*/
MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_OUT_OF_ORDER = 134, /*< nick=Gprs.ServiceOptionOutOfOrder >*/
MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN = 148, /*< nick=Gprs.Unknown >*/
MM_MOBILE_EQUIPMENT_ERROR_GPRS_PDP_AUTH_FAILURE = 149, /*< nick=Gprs.PdpAuthFailure >*/
MM_MOBILE_EQUIPMENT_ERROR_GPRS_INVALID_MOBILE_CLASS = 150, /*< nick=Gprs.InvalidMobileClass >*/
} MMMobileEquipmentError;
/**
@@ -178,11 +187,11 @@ typedef enum { /*< underscore_name=mm_mobile_equipment_error >*/
* Connection errors that may be reported by ModemManager.
*/
typedef enum { /*< underscore_name=mm_connection_error >*/
MM_CONNECTION_ERROR_UNKNOWN = 0,
MM_CONNECTION_ERROR_NO_CARRIER = 1,
MM_CONNECTION_ERROR_NO_DIALTONE = 2,
MM_CONNECTION_ERROR_BUSY = 3,
MM_CONNECTION_ERROR_NO_ANSWER = 4,
MM_CONNECTION_ERROR_UNKNOWN = 0, /*< nick=Unknown >*/
MM_CONNECTION_ERROR_NO_CARRIER = 1, /*< nick=NoCarrier >*/
MM_CONNECTION_ERROR_NO_DIALTONE = 2, /*< nick=NoDialtone >*/
MM_CONNECTION_ERROR_BUSY = 3, /*< nick=Busy >*/
MM_CONNECTION_ERROR_NO_ANSWER = 4, /*< nick=NoAnswer >*/
} MMConnectionError;
/**
@@ -198,13 +207,13 @@ typedef enum { /*< underscore_name=mm_connection_error >*/
* Serial errors that may be reported by ModemManager.
*/
typedef enum { /*< underscore_name=mm_serial_error >*/
MM_SERIAL_ERROR_UNKNOWN = 0,
MM_SERIAL_ERROR_OPEN_FAILED = 1,
MM_SERIAL_ERROR_SEND_FAILED = 2,
MM_SERIAL_ERROR_RESPONSE_TIMEOUT = 3,
MM_SERIAL_ERROR_OPEN_FAILED_NO_DEVICE = 4,
MM_SERIAL_ERROR_FLASH_FAILED = 5,
MM_SERIAL_ERROR_NOT_OPEN = 6,
MM_SERIAL_ERROR_UNKNOWN = 0, /*< nick=Unknown >*/
MM_SERIAL_ERROR_OPEN_FAILED = 1, /*< nick=OpenFailed >*/
MM_SERIAL_ERROR_SEND_FAILED = 2, /*< nick=SendFailed >*/
MM_SERIAL_ERROR_RESPONSE_TIMEOUT = 3, /*< nick=ResponseTimeout >*/
MM_SERIAL_ERROR_OPEN_FAILED_NO_DEVICE = 4, /*< nick=OpenFailedNoDevice >*/
MM_SERIAL_ERROR_FLASH_FAILED = 5, /*< nick=FlashFailed >*/
MM_SERIAL_ERROR_NOT_OPEN = 6, /*< nick=NotOpen >*/
} MMSerialError;
/**
@@ -238,29 +247,29 @@ typedef enum { /*< underscore_name=mm_serial_error >*/
typedef enum { /*< underscore_name=mm_message_error >*/
/* 0 -> 127 per 3GPP TS 24.011 [6] clause E.2 */
/* 128 -> 255 per 3GPP TS 23.040 [3] clause 9.2.3.22 */
MM_MESSAGE_ERROR_ME_FAILURE = 300,
MM_MESSAGE_ERROR_SMS_SERVICE_RESERVED = 301,
MM_MESSAGE_ERROR_NOT_ALLOWED = 302,
MM_MESSAGE_ERROR_NOT_SUPPORTED = 303,
MM_MESSAGE_ERROR_INVALID_PDU_PARAMETER = 304,
MM_MESSAGE_ERROR_INVALID_TEXT_PARAMETER = 305,
MM_MESSAGE_ERROR_SIM_NOT_INSERTED = 310,
MM_MESSAGE_ERROR_SIM_PIN = 311,
MM_MESSAGE_ERROR_PH_SIM_PIN = 312,
MM_MESSAGE_ERROR_SIM_FAILURE = 313,
MM_MESSAGE_ERROR_SIM_BUSY = 314,
MM_MESSAGE_ERROR_SIM_WRONG = 315,
MM_MESSAGE_ERROR_SIM_PUK = 316,
MM_MESSAGE_ERROR_SIM_PIN2 = 317,
MM_MESSAGE_ERROR_SIM_PUK2 = 318,
MM_MESSAGE_ERROR_MEMORY_FAILURE = 320,
MM_MESSAGE_ERROR_INVALID_INDEX = 321,
MM_MESSAGE_ERROR_MEMORY_FULL = 322,
MM_MESSAGE_ERROR_SMSC_ADDRESS_UNKNOWN = 330,
MM_MESSAGE_ERROR_NO_NETWORK = 331,
MM_MESSAGE_ERROR_NETWORK_TIMEOUT = 332,
MM_MESSAGE_ERROR_NO_CNMA_ACK_EXPECTED = 340,
MM_MESSAGE_ERROR_UNKNOWN = 500
MM_MESSAGE_ERROR_ME_FAILURE = 300, /*< nick=MeFailure >*/
MM_MESSAGE_ERROR_SMS_SERVICE_RESERVED = 301, /*< nick=SmsServiceReserved >*/
MM_MESSAGE_ERROR_NOT_ALLOWED = 302, /*< nick=NotAllowed >*/
MM_MESSAGE_ERROR_NOT_SUPPORTED = 303, /*< nick=NotSupported >*/
MM_MESSAGE_ERROR_INVALID_PDU_PARAMETER = 304, /*< nick=InvalidPduParameter >*/
MM_MESSAGE_ERROR_INVALID_TEXT_PARAMETER = 305, /*< nick=InvalidTextParameter >*/
MM_MESSAGE_ERROR_SIM_NOT_INSERTED = 310, /*< nick=SimNotInserted >*/
MM_MESSAGE_ERROR_SIM_PIN = 311, /*< nick=SimPin >*/
MM_MESSAGE_ERROR_PH_SIM_PIN = 312, /*< nick=PhSimPin >*/
MM_MESSAGE_ERROR_SIM_FAILURE = 313, /*< nick=SimFailure >*/
MM_MESSAGE_ERROR_SIM_BUSY = 314, /*< nick=SimBusy >*/
MM_MESSAGE_ERROR_SIM_WRONG = 315, /*< nick=SimWrong >*/
MM_MESSAGE_ERROR_SIM_PUK = 316, /*< nick=SimPuk >*/
MM_MESSAGE_ERROR_SIM_PIN2 = 317, /*< nick=SimPin2 >*/
MM_MESSAGE_ERROR_SIM_PUK2 = 318, /*< nick=SimPuk2 >*/
MM_MESSAGE_ERROR_MEMORY_FAILURE = 320, /*< nick=MemoryFailure >*/
MM_MESSAGE_ERROR_INVALID_INDEX = 321, /*< nick=InvalidIndex >*/
MM_MESSAGE_ERROR_MEMORY_FULL = 322, /*< nick=MemoryFull >*/
MM_MESSAGE_ERROR_SMSC_ADDRESS_UNKNOWN = 330, /*< nick=SmscAddressUnknown >*/
MM_MESSAGE_ERROR_NO_NETWORK = 331, /*< nick=NoNetwork >*/
MM_MESSAGE_ERROR_NETWORK_TIMEOUT = 332, /*< nick=NetworkTimeout >*/
MM_MESSAGE_ERROR_NO_CNMA_ACK_EXPECTED = 340, /*< nick=NoCnmaAckExpected >*/
MM_MESSAGE_ERROR_UNKNOWN = 500 /*< nick=Unknown >*/
} MMMessageError;
/**
@@ -279,17 +288,16 @@ typedef enum { /*< underscore_name=mm_message_error >*/
* CDMA Activation errors.
*/
typedef enum { /*< underscore_name=mm_cdma_activation_error >*/
MM_CDMA_ACTIVATION_ERROR_NONE = 0,
MM_CDMA_ACTIVATION_ERROR_UNKNOWN = 1,
MM_CDMA_ACTIVATION_ERROR_ROAMING = 2,
MM_CDMA_ACTIVATION_ERROR_WRONG_RADIO_INTERFACE = 3,
MM_CDMA_ACTIVATION_ERROR_COULD_NOT_CONNECT = 4,
MM_CDMA_ACTIVATION_ERROR_SECURITY_AUTHENTICATION_FAILED = 5,
MM_CDMA_ACTIVATION_ERROR_PROVISIONING_FAILED = 6,
MM_CDMA_ACTIVATION_ERROR_NO_SIGNAL = 7,
MM_CDMA_ACTIVATION_ERROR_TIMED_OUT = 8,
MM_CDMA_ACTIVATION_ERROR_START_FAILED = 9
MM_CDMA_ACTIVATION_ERROR_NONE = 0, /*< nick=None >*/
MM_CDMA_ACTIVATION_ERROR_UNKNOWN = 1, /*< nick=Unknown >*/
MM_CDMA_ACTIVATION_ERROR_ROAMING = 2, /*< nick=Roaming >*/
MM_CDMA_ACTIVATION_ERROR_WRONG_RADIO_INTERFACE = 3, /*< nick=WrongRadioInterface >*/
MM_CDMA_ACTIVATION_ERROR_COULD_NOT_CONNECT = 4, /*< nick=CouldNotConnect >*/
MM_CDMA_ACTIVATION_ERROR_SECURITY_AUTHENTICATION_FAILED = 5, /*< nick=SecurityAuthenticationFailed >*/
MM_CDMA_ACTIVATION_ERROR_PROVISIONING_FAILED = 6, /*< nick=ProvisioningFailed >*/
MM_CDMA_ACTIVATION_ERROR_NO_SIGNAL = 7, /*< nick=NoSignal >*/
MM_CDMA_ACTIVATION_ERROR_TIMED_OUT = 8, /*< nick=TimedOut >*/
MM_CDMA_ACTIVATION_ERROR_START_FAILED = 9 /*< nick=StartFailed >*/
} MMCdmaActivationError;
#endif /* _MODEMMANAGER_ERRORS_H_ */

View File

@@ -14,6 +14,7 @@ GENERATED_H = \
GENERATED_C = \
mm-enums-types.c \
mm-errors-types.c \
mm-errors-quarks.c \
mm-gdbus-manager.c \
mm-gdbus-sim.c \
mm-gdbus-sms.c \
@@ -50,7 +51,7 @@ mm-enums-types.c: Makefile.am $(top_srcdir)/include/ModemManager-enums.h $(top_s
--template $(top_srcdir)/build-aux/mm-enums-template.c \
$(top_srcdir)/include/ModemManager-enums.h > $@
# Error types
# Error types & quarks
mm-errors-types.h: Makefile.am $(top_srcdir)/include/ModemManager-errors.h $(top_srcdir)/build-aux/mm-errors-template.h
$(AM_V_GEN) $(GLIB_MKENUMS) \
--fhead "#ifndef __MM_ERRORS_TYPES_H__\n#define __MM_ERRORS_TYPES_H__\n" \
@@ -61,7 +62,13 @@ mm-errors-types.h: Makefile.am $(top_srcdir)/include/ModemManager-errors.h $(top
mm-errors-types.c: Makefile.am $(top_srcdir)/include/ModemManager-errors.h $(top_srcdir)/build-aux/mm-errors-template.c mm-errors-types.h
$(AM_V_GEN) $(GLIB_MKENUMS) \
--fhead "#include <ModemManager-errors.h>\n#include \"mm-errors-types.h\"\n" \
--template $(top_srcdir)/build-aux/mm-errors-template.h \
--template $(top_srcdir)/build-aux/mm-errors-template.c \
$(top_srcdir)/include/ModemManager-errors.h > $@
mm-errors-quarks.c: Makefile.am $(top_srcdir)/include/ModemManager-errors.h $(top_srcdir)/build-aux/mm-errors-quarks-template.c $(top_srcdir)/include/ModemManager-names.h mm-errors-types.h
$(AM_V_GEN) $(GLIB_MKENUMS) \
--fhead "#include <ModemManager-errors.h>\n#include \"mm-errors-types.h\"\n" \
--template $(top_srcdir)/build-aux/mm-errors-quarks-template.c \
$(top_srcdir)/include/ModemManager-errors.h > $@
# Manager interface
@@ -157,7 +164,6 @@ mm-bearer-properties.c: mm-errors-types.h
mm-sms-properties.c: mm-errors-types.h
mm-bearer-ip-config.c: mm-errors-types.h
mm-location-3gpp.c: mm-errors-types.h
mm-errors-quarks.c: mm-errors-types.h
mm-unlock-retries.c: mm-enums-types.h
mm-network-timezone.c: mm-errors-types.h
@@ -185,7 +191,6 @@ nodist_libmm_common_la_SOURCES = \
$(GENERATED_C)
libmm_common_la_SOURCES = \
mm-errors-quarks.c \
mm-common-helpers.h \
mm-common-helpers.c \
mm-simple-status.h \

View File

@@ -1,219 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details:
*
* Copyright (C) 2011 - Google, Inc.
*/
/* NOTE: ideally, this file should be autogenerated by glib-mkenums, along with
* mm-errors-types.[c|h], but currently glib-mkenums is not enough for the kind
* of substitutions we need, specifically when generating the DBus paths of the
* errors. See discussions at:
* https://bugzilla.gnome.org/show_bug.cgi?id=662693
*/
#include <gio/gio.h>
#include "ModemManager-errors.h"
#include "mm-errors-types.h"
#define ERROR_PREFIX "org.freedesktop.ModemManager1.Core.Error."
static const GDBusErrorEntry mm_core_error_entries[] = {
{ MM_CORE_ERROR_FAILED, ERROR_PREFIX "Failed" },
{ MM_CORE_ERROR_CANCELLED, ERROR_PREFIX "Cancelled" },
{ MM_CORE_ERROR_ABORTED, ERROR_PREFIX "Aborted" },
{ MM_CORE_ERROR_UNSUPPORTED, ERROR_PREFIX "Unsupported" },
{ MM_CORE_ERROR_NO_PLUGINS, ERROR_PREFIX "NoPlugins" },
{ MM_CORE_ERROR_UNAUTHORIZED, ERROR_PREFIX "Unauthorized" },
{ MM_CORE_ERROR_INVALID_ARGS, ERROR_PREFIX "InvalidArgs" },
{ MM_CORE_ERROR_IN_PROGRESS, ERROR_PREFIX "InProgress" },
{ MM_CORE_ERROR_WRONG_STATE, ERROR_PREFIX "WrongState" },
{ MM_CORE_ERROR_CONNECTED, ERROR_PREFIX "Connected" },
{ MM_CORE_ERROR_TOO_MANY, ERROR_PREFIX "TooMany" },
{ MM_CORE_ERROR_NOT_FOUND, ERROR_PREFIX "NotFound" },
};
#undef ERROR_PREFIX
GQuark
mm_core_error_quark (void)
{
static volatile gsize quark_volatile = 0;
if (!quark_volatile)
g_dbus_error_register_error_domain ("mm-core-error-quark",
&quark_volatile,
mm_core_error_entries,
G_N_ELEMENTS (mm_core_error_entries));
return (GQuark) quark_volatile;
}
#define ERROR_PREFIX "org.freedesktop.ModemManager1.MobileEquipment.Error."
static const GDBusErrorEntry mm_mobile_equipment_error_entries[] = {
/* General errors */
{ MM_MOBILE_EQUIPMENT_ERROR_PHONE_FAILURE, ERROR_PREFIX "PhoneFailure" },
{ MM_MOBILE_EQUIPMENT_ERROR_NO_CONNECTION, ERROR_PREFIX "NoConnection" },
{ MM_MOBILE_EQUIPMENT_ERROR_LINK_RESERVED, ERROR_PREFIX "LinkReserved" },
{ MM_MOBILE_EQUIPMENT_ERROR_NOT_ALLOWED, ERROR_PREFIX "NotAllowed" },
{ MM_MOBILE_EQUIPMENT_ERROR_NOT_SUPPORTED, ERROR_PREFIX "NotSupported" },
{ MM_MOBILE_EQUIPMENT_ERROR_PH_SIM_PIN, ERROR_PREFIX "PhSimPin" },
{ MM_MOBILE_EQUIPMENT_ERROR_PH_FSIM_PIN, ERROR_PREFIX "PhFsimPin" },
{ MM_MOBILE_EQUIPMENT_ERROR_PH_FSIM_PUK, ERROR_PREFIX "PhFsimPuk" },
{ MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED, ERROR_PREFIX "SimNotInserted" },
{ MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN, ERROR_PREFIX "SimPin" },
{ MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK, ERROR_PREFIX "SimPuk" },
{ MM_MOBILE_EQUIPMENT_ERROR_SIM_FAILURE, ERROR_PREFIX "SimFailure" },
{ MM_MOBILE_EQUIPMENT_ERROR_SIM_BUSY, ERROR_PREFIX "SimBusy" },
{ MM_MOBILE_EQUIPMENT_ERROR_SIM_WRONG, ERROR_PREFIX "SimWrong" },
{ MM_MOBILE_EQUIPMENT_ERROR_INCORRECT_PASSWORD, ERROR_PREFIX "IncorrectPassword" },
{ MM_MOBILE_EQUIPMENT_ERROR_SIM_PIN2, ERROR_PREFIX "SimPin2" },
{ MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK2, ERROR_PREFIX "SimPuk2" },
{ MM_MOBILE_EQUIPMENT_ERROR_MEMORY_FULL, ERROR_PREFIX "MemoryFull" },
{ MM_MOBILE_EQUIPMENT_ERROR_INVALID_INDEX, ERROR_PREFIX "InvalidIndex" },
{ MM_MOBILE_EQUIPMENT_ERROR_NOT_FOUND, ERROR_PREFIX "NotFound" },
{ MM_MOBILE_EQUIPMENT_ERROR_MEMORY_FAILURE, ERROR_PREFIX "MemoryFailure" },
{ MM_MOBILE_EQUIPMENT_ERROR_TEXT_TOO_LONG, ERROR_PREFIX "TextTooLong" },
{ MM_MOBILE_EQUIPMENT_ERROR_INVALID_CHARS, ERROR_PREFIX "InvalidChars" },
{ MM_MOBILE_EQUIPMENT_ERROR_DIAL_STRING_TOO_LONG, ERROR_PREFIX "DialStringTooLong" },
{ MM_MOBILE_EQUIPMENT_ERROR_DIAL_STRING_INVALID, ERROR_PREFIX "DialStringInvalid" },
{ MM_MOBILE_EQUIPMENT_ERROR_NO_NETWORK, ERROR_PREFIX "NoNetwork" },
{ MM_MOBILE_EQUIPMENT_ERROR_NETWORK_TIMEOUT, ERROR_PREFIX "NetworkTimeout" },
{ MM_MOBILE_EQUIPMENT_ERROR_NETWORK_NOT_ALLOWED, ERROR_PREFIX "NetworkNotAllowed" },
{ MM_MOBILE_EQUIPMENT_ERROR_NETWORK_PIN, ERROR_PREFIX "NetworkPin" },
{ MM_MOBILE_EQUIPMENT_ERROR_NETWORK_PUK, ERROR_PREFIX "NetworkPuk" },
{ MM_MOBILE_EQUIPMENT_ERROR_NETWORK_SUBSET_PIN, ERROR_PREFIX "NetworkSubsetPin" },
{ MM_MOBILE_EQUIPMENT_ERROR_NETWORK_SUBSET_PUK, ERROR_PREFIX "NetworkSubsetPuk" },
{ MM_MOBILE_EQUIPMENT_ERROR_SERVICE_PIN, ERROR_PREFIX "ServicePin" },
{ MM_MOBILE_EQUIPMENT_ERROR_SERVICE_PUK, ERROR_PREFIX "ServicePuk" },
{ MM_MOBILE_EQUIPMENT_ERROR_CORP_PIN, ERROR_PREFIX "CorpPin" },
{ MM_MOBILE_EQUIPMENT_ERROR_CORP_PUK, ERROR_PREFIX "CorpPuk" },
{ MM_MOBILE_EQUIPMENT_ERROR_UNKNOWN, ERROR_PREFIX "Unknown" },
/* GPRS related errors */
{ MM_MOBILE_EQUIPMENT_ERROR_GPRS_ILLEGAL_MS, ERROR_PREFIX "GPRS.IllegalMs" },
{ MM_MOBILE_EQUIPMENT_ERROR_GPRS_ILLEGAL_ME, ERROR_PREFIX "GPRS.IllegalMe" },
{ MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_NOT_ALLOWED, ERROR_PREFIX "GPRS.ServiceNotAllowed" },
{ MM_MOBILE_EQUIPMENT_ERROR_GPRS_PLMN_NOT_ALLOWED, ERROR_PREFIX "GPRS.PlmnNotAllowed" },
{ MM_MOBILE_EQUIPMENT_ERROR_GPRS_LOCATION_NOT_ALLOWED, ERROR_PREFIX "GPRS.LocationNotAllowed" },
{ MM_MOBILE_EQUIPMENT_ERROR_GPRS_ROAMING_NOT_ALLOWED, ERROR_PREFIX "GPRS.RomaingNotAllowed" },
{ MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUPPORTED, ERROR_PREFIX "GPRS.ServiceOptionNotSupported" },
{ MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_NOT_SUBSCRIBED, ERROR_PREFIX "GPRS.ServiceOptionNotSubscribed" },
{ MM_MOBILE_EQUIPMENT_ERROR_GPRS_SERVICE_OPTION_OUT_OF_ORDER, ERROR_PREFIX "GPRS.ServiceOptionOutOfOrder" },
{ MM_MOBILE_EQUIPMENT_ERROR_GPRS_UNKNOWN, ERROR_PREFIX "GPRS.Unknown" },
{ MM_MOBILE_EQUIPMENT_ERROR_GPRS_PDP_AUTH_FAILURE, ERROR_PREFIX "GPRS.PdpAuthFailure" },
{ MM_MOBILE_EQUIPMENT_ERROR_GPRS_INVALID_MOBILE_CLASS, ERROR_PREFIX "GPRS.InvalidMobileClass" }
};
#undef ERROR_PREFIX
GQuark
mm_mobile_equipment_error_quark (void)
{
static volatile gsize quark_volatile = 0;
if (!quark_volatile)
g_dbus_error_register_error_domain ("mm-mobile-equipment-error-quark",
&quark_volatile,
mm_mobile_equipment_error_entries,
G_N_ELEMENTS (mm_mobile_equipment_error_entries));
return (GQuark) quark_volatile;
}
#define ERROR_PREFIX "org.freedesktop.ModemManager1.Connection.Error."
static const GDBusErrorEntry mm_connection_error_entries[] = {
{ MM_CONNECTION_ERROR_UNKNOWN, ERROR_PREFIX "Unknown" },
{ MM_CONNECTION_ERROR_NO_CARRIER, ERROR_PREFIX "NoCarrier" },
{ MM_CONNECTION_ERROR_NO_DIALTONE, ERROR_PREFIX "NoDialtone" },
{ MM_CONNECTION_ERROR_BUSY, ERROR_PREFIX "Busy" },
{ MM_CONNECTION_ERROR_NO_ANSWER, ERROR_PREFIX "NoAnswer" },
};
#undef ERROR_PREFIX
GQuark
mm_connection_error_quark (void)
{
static volatile gsize quark_volatile = 0;
if (!quark_volatile)
g_dbus_error_register_error_domain ("mm-connection-error-quark",
&quark_volatile,
mm_connection_error_entries,
G_N_ELEMENTS (mm_connection_error_entries));
return (GQuark) quark_volatile;
}
#define ERROR_PREFIX "org.freedesktop.ModemManager1.Serial.Error."
static const GDBusErrorEntry mm_serial_error_entries[] = {
{ MM_SERIAL_ERROR_UNKNOWN, ERROR_PREFIX "Unknown" },
{ MM_SERIAL_ERROR_OPEN_FAILED, ERROR_PREFIX "OpenFailed" },
{ MM_SERIAL_ERROR_SEND_FAILED, ERROR_PREFIX "SendFailed" },
{ MM_SERIAL_ERROR_RESPONSE_TIMEOUT, ERROR_PREFIX "ResponseTimeout" },
{ MM_SERIAL_ERROR_OPEN_FAILED_NO_DEVICE, ERROR_PREFIX "OpenFailedNoDevice" },
{ MM_SERIAL_ERROR_FLASH_FAILED, ERROR_PREFIX "FlashFailed" },
{ MM_SERIAL_ERROR_NOT_OPEN, ERROR_PREFIX "NotOpen" },
};
#undef ERROR_PREFIX
GQuark
mm_serial_error_quark (void)
{
static volatile gsize quark_volatile = 0;
if (!quark_volatile)
g_dbus_error_register_error_domain ("mm-serial-error-quark",
&quark_volatile,
mm_serial_error_entries,
G_N_ELEMENTS (mm_serial_error_entries));
return (GQuark) quark_volatile;
}
#define ERROR_PREFIX "org.freedesktop.ModemManager1.Message.Error."
static const GDBusErrorEntry mm_message_error_entries[] = {
{ MM_MESSAGE_ERROR_ME_FAILURE, ERROR_PREFIX "MeFailure" },
{ MM_MESSAGE_ERROR_SMS_SERVICE_RESERVED, ERROR_PREFIX "SmsServiceReserved" },
{ MM_MESSAGE_ERROR_NOT_ALLOWED, ERROR_PREFIX "NotAllowed" },
{ MM_MESSAGE_ERROR_NOT_SUPPORTED, ERROR_PREFIX "NotSupported" },
{ MM_MESSAGE_ERROR_INVALID_PDU_PARAMETER, ERROR_PREFIX "InvalidPduParameter" },
{ MM_MESSAGE_ERROR_INVALID_TEXT_PARAMETER, ERROR_PREFIX "InvalidTextParameter" },
{ MM_MESSAGE_ERROR_SIM_NOT_INSERTED, ERROR_PREFIX "SimNotInserted" },
{ MM_MESSAGE_ERROR_SIM_PIN, ERROR_PREFIX "SimPin" },
{ MM_MESSAGE_ERROR_PH_SIM_PIN, ERROR_PREFIX "PhSimPin" },
{ MM_MESSAGE_ERROR_SIM_FAILURE, ERROR_PREFIX "SimFailure" },
{ MM_MESSAGE_ERROR_SIM_BUSY, ERROR_PREFIX "SimBusy" },
{ MM_MESSAGE_ERROR_SIM_WRONG, ERROR_PREFIX "SimWrong" },
{ MM_MESSAGE_ERROR_SIM_PUK, ERROR_PREFIX "SimPuk" },
{ MM_MESSAGE_ERROR_SIM_PIN2, ERROR_PREFIX "SimPin2" },
{ MM_MESSAGE_ERROR_SIM_PUK2, ERROR_PREFIX "SimPuk2" },
{ MM_MESSAGE_ERROR_MEMORY_FAILURE, ERROR_PREFIX "MemoryFailure" },
{ MM_MESSAGE_ERROR_INVALID_INDEX, ERROR_PREFIX "InvalidIndex" },
{ MM_MESSAGE_ERROR_MEMORY_FULL, ERROR_PREFIX "MemoryFull" },
{ MM_MESSAGE_ERROR_SMSC_ADDRESS_UNKNOWN, ERROR_PREFIX "SmscAddressUnknown" },
{ MM_MESSAGE_ERROR_NO_NETWORK, ERROR_PREFIX "NoNetwork" },
{ MM_MESSAGE_ERROR_NETWORK_TIMEOUT, ERROR_PREFIX "NetworkTimeout" },
{ MM_MESSAGE_ERROR_NO_CNMA_ACK_EXPECTED, ERROR_PREFIX "NoCdmaAckExpected" },
{ MM_MESSAGE_ERROR_UNKNOWN, ERROR_PREFIX "Unknown" }
};
#undef ERROR_PREFIX
GQuark
mm_message_error_quark (void)
{
static volatile gsize quark_volatile = 0;
if (!quark_volatile)
g_dbus_error_register_error_domain ("mm-message-error-quark",
&quark_volatile,
mm_message_error_entries,
G_N_ELEMENTS (mm_message_error_entries));
return (GQuark) quark_volatile;
}