1 #!/usr/bin/env python 2 3 # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. 4 # Use of this source code is governed by a BSD-style license that can be 5 # found in the LICENSE file. 6 7 """Python bindings of ModemManager1 DBUS constants.""" 8 9 from dbus.exceptions import DBusException 10 11 # The root object 12 OMM = '/org/freedesktop/ModemManager1' 13 14 # Interfaces 15 OFDOM = 'org.freedesktop.DBus.ObjectManager' 16 MODEM_MANAGER_INTERFACE = 'org.freedesktop.ModemManager1' 17 MODEM_INTERFACE = MODEM_MANAGER_INTERFACE + '.Modem' 18 MODEM_MODEM3GPP_INTERFACE = MODEM_INTERFACE + '.Modem3gpp' 19 MODEM_SIMPLE_INTERFACE = MODEM_INTERFACE + '.Simple' 20 MODEM_MODEMCDMA_INTERFACE = MODEM_INTERFACE + '.Cdma' 21 MODEM_MESSAGING_INTERFACE = MODEM_INTERFACE + '.Messaging' 22 SIM_INTERFACE = MODEM_MANAGER_INTERFACE + '.Sim' 23 SMS_INTERFACE = MODEM_MANAGER_INTERFACE + '.Sms' 24 25 # Modem States from Modemmanager-enums.h 26 MM_MODEM_STATE_FAILED = -1 27 MM_MODEM_STATE_UNKNOWN = 0 28 MM_MODEM_STATE_INITIALIZING = 1 29 MM_MODEM_STATE_LOCKED = 2 30 MM_MODEM_STATE_DISABLED = 3 31 MM_MODEM_STATE_DISABLING = 4 32 MM_MODEM_STATE_ENABLING = 5 33 MM_MODEM_STATE_ENABLED = 6 34 MM_MODEM_STATE_SEARCHING = 7 35 MM_MODEM_STATE_REGISTERED = 8 36 MM_MODEM_STATE_DISCONNECTING = 9 37 MM_MODEM_STATE_CONNECTING = 10 38 MM_MODEM_STATE_CONNECTED = 11 39 40 # State Change Reasons 41 MM_MODEM_STATE_CHANGE_REASON_UNKNOWN = 0 42 MM_MODEM_STATE_CHANGE_REASON_USER_REQUESTED = 1 43 MM_MODEM_STATE_CHANGE_REASON_SUSPEND = 2 44 45 # List of GSM Registration Status 46 MM_MODEM_3GPP_REGISTRATION_STATE_IDLE = 0 47 MM_MODEM_3GPP_REGISTRATION_STATE_HOME = 1 48 MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING = 2 49 MM_MODEM_3GPP_REGISTRATION_STATE_DENIED = 3 50 MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN = 4 51 MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING = 5 52 53 # Property Names 54 MM_MODEM_PROPERTY_STATE = 'State' 55 MM_MODEM3GPP_PROPERTY_REGISTRATION_STATE = 'RegistrationState' 56 57 58 class ConnectionUnknownError(DBusException): 59 _dbus_error_name = MODEM_MANAGER_INTERFACE + '.Connection.Unknown' 60 include_traceback = False 61 62 63 class ServiceOptionNotSubscribedError(DBusException): 64 _dbus_error_name = ( 65 MODEM_MANAGER_INTERFACE + 66 '.MobileEquipment.Connect.Gprs.ServiceOptionNotSubscribed') 67 include_traceback = False 68 69 70 class NoNetworkError(DBusException): 71 _dbus_error_name = ( 72 MODEM_MANAGER_INTERFACE + '.MobileEquipment.Connect.NoNetwork') 73 include_traceback = False 74 75 76 class CoreUnsupportedError(DBusException): 77 _dbus_error_name = MODEM_MANAGER_INTERFACE + '.Core.Unsupported' 78 include_traceback = False 79