Implement the more granular GSM interfaces as agreed on NM mailing list.

Convert all exisiting code over to new DBus interfaces.
This commit is contained in:
Tambet Ingo
2008-08-29 11:43:36 +03:00
parent 2d00b75341
commit 424f514b02
23 changed files with 1666 additions and 892 deletions
+6 -3
View File
@@ -1,6 +1,9 @@
EXTRA_DIST = \
mm-manager.xml \
mm-modem.xml \
mm-gsm-modem.xml \
mm-gsm-modem-hso.xml \
mm-cdma-modem.xml
mm-modem-cdma.xml \
mm-modem-gsm-card.xml \
mm-modem-gsm-contacts.xml \
mm-modem-gsm-network.xml \
mm-modem-gsm-sms.xml
+5 -3
View File
@@ -24,7 +24,9 @@
<xi:include href="mm-manager.xml"/>
<xi:include href="mm-modem.xml"/>
<xi:include href="mm-cdma-modem.xml"/>
<xi:include href="mm-gsm-modem.xml"/>
<xi:include href="mm-gsm-modem-hso.xml"/>
<xi:include href="mm-modem-cdma.xml"/>
<xi:include href="mm-modem-gsm-card.xml"/>
<xi:include href="mm-modem-gsm-contacts.xml"/>
<xi:include href="mm-modem-gsm-network.xml"/>
<xi:include href="mm-modem-gsm-sms.xml"/>
</tp:spec>
@@ -8,7 +8,7 @@
Get the current signal quality.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_cdma_modem_get_signal_quality"/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_modem_cdma_get_signal_quality"/>
<arg name="quality" type="u" direction="out">
<tp:docstring>
Signal quality (percent).
+104
View File
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.ModemManager.Modem.Gsm.Card">
<method name="GetImei">
<tp:docstring>
Get the IMEI of the SIM card.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_get_imei"/>
<arg name="imei" type="s" direction="out">
<tp:docstring>
The IMEI.
</tp:docstring>
</arg>
</method>
<method name="GetImsi">
<tp:docstring>
Get the IMSI of the SIM card.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_get_imsi"/>
<arg name="imsi" type="s" direction="out">
<tp:docstring>
The IMSI.
</tp:docstring>
</arg>
</method>
<method name="GetInfo">
<tp:docstring>
Get the card information (manufacturer, modem, version).
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_get_info"/>
<arg name="manufacturer" type="s" direction="out">
<tp:docstring>
The manufacturer of the card.
</tp:docstring>
</arg>
<arg name="modem" type="s" direction="out">
<tp:docstring>
The model of the card.
</tp:docstring>
</arg>
<arg name="version" type="s" direction="out">
<tp:docstring>
The version (revision) of the card.
</tp:docstring>
</arg>
</method>
<method name="SendPin">
<tp:docstring>
Send the PIN (or PUK) to unlock the SIM card.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_send_pin"/>
<arg name="pin" type="s" direction="in">
<tp:docstring>
The PIN code.
</tp:docstring>
</arg>
</method>
<method name="EnablePin">
<tp:docstring>
Enable or disable the PIN checking.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_enable_pin"/>
<arg name="pin" type="s" direction="in">
<tp:docstring>
The PIN code.
</tp:docstring>
</arg>
<arg name="enabled" type="b" direction="in">
<tp:docstring>
True to enable PIN checking.
</tp:docstring>
</arg>
</method>
<method name="ChangePin">
<tp:docstring>
Change the PIN code.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_change_pin"/>
<arg name="old_pin" type="s" direction="in">
<tp:docstring>
The current PIN code.
</tp:docstring>
</arg>
<arg name="new_pin" type="s" direction="in">
<tp:docstring>
The new PIN code.
</tp:docstring>
</arg>
</method>
</interface>
</node>
+114
View File
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.ModemManager.Modem.Gsm.Contacts">
<method name="Add">
<tp:docstring>
Add a new contact to the SIM card.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_contacts_add"/>
<arg name="name" type="s" direction="in">
<tp:docstring>
The name of the contact.
</tp:docstring>
</arg>
<arg name="number" type="s" direction="in">
<tp:docstring>
The phone number of the contact.
</tp:docstring>
</arg>
<arg name="index" type="u" direction="out">
<tp:docstring>
The index of the new contact.
</tp:docstring>
</arg>
</method>
<method name="Delete">
<tp:docstring>
Delete a contact from the SIM card.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_contacts_delete"/>
<arg name="index" type="u" direction="in">
<tp:docstring>
The index of the contact.
</tp:docstring>
</arg>
</method>
<method name="Get">
<tp:docstring>
Retrieve a contact from the SIM card.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_contacts_get"/>
<arg name="index" type="u" direction="in">
<tp:docstring>
The index of the contact.
</tp:docstring>
</arg>
<arg name="found_index" type="u" direction="out">
<tp:docstring>
The index of the contact (same as the passed index).
</tp:docstring>
</arg>
<arg name="name" type="s" direction="out">
<tp:docstring>
The name of the contact.
</tp:docstring>
</arg>
<arg name="number" type="s" direction="out">
<tp:docstring>
The number of the contact.
</tp:docstring>
</arg>
</method>
<method name="List">
<tp:docstring>
List all contacts on the SIM card.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_contacts_list"/>
<arg name="results" type="a(uss)" direction="out">
<tp:docstring>
The list of contacts where each contact has an index, name, and number.
</tp:docstring>
</arg>
</method>
<method name="Find">
<tp:docstring>
Find a contact from the SIM card.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_contacts_find"/>
<arg name="pattern" type="s" direction="in">
<tp:docstring>
The pattern to search for.
</tp:docstring>
</arg>
<arg name="results" type="a(uss)" direction="out">
<tp:docstring>
The list of matching contacts where a contact has an index, name, and number.
</tp:docstring>
</arg>
</method>
<method name="GetCount">
<tp:docstring>
Get the number of contacts stored on the SIM card.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_contacts_count"/>
<arg name="count" type="u" direction="out">
<tp:docstring>
The number of contacts.
</tp:docstring>
</arg>
</method>
</interface>
</node>
@@ -1,19 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.ModemManager.Modem.Gsm">
<method name="SetPin">
<tp:docstring>
Set the PIN (or PUK) to unlock the SIM card.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_set_pin"/>
<arg name="pin" type="s" direction="in">
The PIN code.
</arg>
</method>
<interface name="org.freedesktop.ModemManager.Modem.Gsm.Network">
<method name="Register">
<tp:docstring>
Register the device to network.
@@ -47,7 +35,9 @@
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_set_apn"/>
<arg name="apn" type="s" direction="in">
The APN.
<tp:docstring>
The APN.
</tp:docstring>
</arg>
</method>
@@ -70,7 +60,7 @@
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_set_band"/>
<arg name="band" type="u" direction="in" tp:type="MM_GSM_MODEM_BAND">
<arg name="band" type="u" direction="in" tp:type="MM_MODEM_GSM_NETWORK_BAND">
<tp:docstring>
The band.
</tp:docstring>
@@ -83,7 +73,7 @@
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_get_band"/>
<arg name="band" type="u" direction="out" tp:type="MM_GSM_MODEM_BAND">
<arg name="band" type="u" direction="out" tp:type="MM_MODEM_GSM_NETWORK_BAND">
<tp:docstring>
The current band.
</tp:docstring>
@@ -96,7 +86,7 @@
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_set_network_mode"/>
<arg name="mode" type="u" direction="in" tp:type="MM_GSM_MODEM_NETWORK_MODE">
<arg name="mode" type="u" direction="in" tp:type="MM_MODEM_GSM_NETWORK_MODE">
<tp:docstring>
The GSM network mode.
</tp:docstring>
@@ -109,7 +99,7 @@
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_get_network_mode"/>
<arg name="mode" type="u" direction="out" tp:type="MM_GSM_MODEM_NETWORK_MODE">
<arg name="mode" type="u" direction="out" tp:type="MM_MODEM_GSM_NETWORK_MODE">
<tp:docstring>
The current network mode.
</tp:docstring>
@@ -122,9 +112,9 @@
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_get_reg_info"/>
<arg name="status" type="u" direction="out" tp:type="MM_GSM_MODEM_REG_STATUS">
<arg name="status" type="u" direction="out" tp:type="MM_MODEM_GSM_NETWORK_REG_STATUS">
<tp:docstring>
The current network mode.
The network status.
</tp:docstring>
</arg>
<arg name="operator_code" type="s" direction="out">
@@ -150,18 +140,39 @@
</arg>
</signal>
<signal name="RegistrationInfo">
<tp:docstring>
The registration status changed.
</tp:docstring>
<arg name="status" type="u" tp:type="MM_MODEM_GSM_NETWORK_REG_STATUS">
<tp:docstring>
The network status.
</tp:docstring>
</arg>
<arg name="operator_code" type="s">
<tp:docstring>
The current operator code.
</tp:docstring>
</arg>
<arg name="operator_name" type="s">
<tp:docstring>
The current operator name.
</tp:docstring>
</arg>
</signal>
<signal name="NetworkMode">
<tp:docstring>
The network mode changed.
</tp:docstring>
<arg name="mode" type="u" tp:type="MM_GSM_MODEM_NETWORK_MODE">
<arg name="mode" type="u" tp:type="MM_MODEM_GSM_NETWORK_MODE">
<tp:docstring>
The new network mode.
</tp:docstring>
</arg>
</signal>
<tp:enum name="MM_GSM_MODEM_NETWORK_MODE" type="u">
<tp:enum name="MM_MODEM_GSM_NETWORK_MODE" type="u">
<tp:enumvalue suffix="ANY" value="0">
<tp:docstring>
Any network mode can be used.
@@ -199,7 +210,7 @@
</tp:enumvalue>
</tp:enum>
<tp:enum name="MM_GSM_MODEM_BAND" type="u">
<tp:enum name="MM_MODEM_GSM_NETWORK_BAND" type="u">
<tp:enumvalue suffix="ANY" value="0">
<tp:docstring>
Any band can be used.
@@ -215,54 +226,54 @@
DCS (1800 MHz).
</tp:docstring>
</tp:enumvalue>
<tp:enumvalue suffix="PCS" value="3">
<tp:enumvalue suffix="PCS" value="4">
<tp:docstring>
PCS (1900 MHz).
</tp:docstring>
</tp:enumvalue>
<tp:enumvalue suffix="G850" value="4">
<tp:enumvalue suffix="G850" value="8">
<tp:docstring>
G850 (850 MHz).
</tp:docstring>
</tp:enumvalue>
<tp:enumvalue suffix="U2100" value="5">
<tp:enumvalue suffix="U2100" value="16">
<tp:docstring>
U2100 (WCDMA 2100 MHz).
</tp:docstring>
</tp:enumvalue>
<tp:enumvalue suffix="U1700" value="6">
<tp:enumvalue suffix="U1700" value="32">
<tp:docstring>
U1700 (WCDMA 3GPP UMTS1800 MHz).
</tp:docstring>
</tp:enumvalue>
<tp:enumvalue suffix="17IV" value="7">
<tp:enumvalue suffix="17IV" value="64">
<tp:docstring>
17IV (WCDMA 3GPP AWS 1700/2100 MHz).
</tp:docstring>
</tp:enumvalue>
<tp:enumvalue suffix="U800" value="8">
<tp:enumvalue suffix="U800" value="128">
<tp:docstring>
U800 (WCDMA 3GPP UMTS800 MHz).
</tp:docstring>
</tp:enumvalue>
<tp:enumvalue suffix="U850" value="9">
<tp:enumvalue suffix="U850" value="256">
<tp:docstring>
U850 (WCDMA 3GPP UMTS850 MHz).
</tp:docstring>
</tp:enumvalue>
<tp:enumvalue suffix="U900" value="10">
<tp:enumvalue suffix="U900" value="512">
<tp:docstring>
U900 (WCDMA 3GPP UMTS900 MHz).
</tp:docstring>
</tp:enumvalue>
<tp:enumvalue suffix="U17IX" value="11">
<tp:enumvalue suffix="U17IX" value="1024">
<tp:docstring>
U17IX (WCDMA 3GPP UMTS MHz).
</tp:docstring>
</tp:enumvalue>
</tp:enum>
<tp:enum name="MM_GSM_MODEM_REG_STATUS" type="u">
<tp:enum name="MM_MODEM_GSM_NETWORK_REG_STATUS" type="u">
<tp:enumvalue suffix="IDLE" value="0">
<tp:docstring>
Not registered, not searching for new operator to register.
+98
View File
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.ModemManager.Modem.Gsm.SMS">
<method name="Delete">
<tp:docstring>
Delete an SMS message.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_sms_delete"/>
<arg name="index" type="u" direction="in">
<tp:docstring>
The index of the SMS.
</tp:docstring>
</arg>
</method>
<method name="Get">
<tp:docstring>
Retrieve an SMS from the SIM card.
</tp:docstring>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_sms_get"/>
<arg name="index" type="u" direction="in">
<tp:docstring>
The index of the SMS.
</tp:docstring>
</arg>
<arg name="found_index" type="u" direction="out">
<tp:docstring>
The index of the SMS (same as the passed index).
</tp:docstring>
</arg>
<arg name="number" type="s" direction="out">
<tp:docstring>
The number the SMS was received from.
</tp:docstring>
</arg>
<arg name="contents" type="s" direction="out">
<tp:docstring>
The contents of the SMS.
</tp:docstring>
</arg>
<arg name="time" type="d" direction="out">
<tp:docstring>
The timestamp.
</tp:docstring>
</arg>
</method>
<method name="GetFormat">
<arg name="result" type="u" direction="out"/>
</method>
<method name="SetFormat">
<arg name="format" type="u" direction="in"/>
</method>
<method name="GetSmsc">
<arg name="result" type="s" direction="out"/>
</method>
<method name="SetSmsc">
<arg name="smsc" type="s" direction="in"/>
</method>
<method name="List">
<arg name="result" type="a(ussd)" direction="out"/>
</method>
<method name="Save">
<arg name="number" type="s" direction="in"/>
<arg name="contents" type="s" direction="in"/>
<arg name="index" type="u" direction="out"/>
</method>
<method name="Send">
<arg name="result" type="u" direction="out"/>
</method>
<method name="SendFromStorage">
<arg name="index" type="u" direction="in"/>
</method>
<method name="SetIndication">
<arg name="mode" type="u" direction="in"/>
<arg name="mt" type="u" direction="in"/>
<arg name="bm" type="u" direction="in"/>
<arg name="ds" type="u" direction="in"/>
<arg name="bfr" type="u" direction="in"/>
</method>
<signal name="SmsReceived">
<arg name="index" type="u"/>
</signal>
</interface>
</node>