Upgrade ofono to 1.2 70/3670/1 2.0 accepted/2.0/20130530.164904 submit/2.0/20130527.100412
authorChengyi Zhao <chengyix.zhao@intel.com>
Mon, 27 May 2013 02:06:29 +0000 (10:06 +0800)
committerChengyi Zhao <chengyix.zhao@intel.com>
Mon, 27 May 2013 02:06:29 +0000 (10:06 +0800)
Signed-off-by: Chengyi Zhao <chengyix.zhao@intel.com>
107 files changed:
AUTHORS
ChangeLog
Makefile.am
Makefile.in
aclocal.m4
compile
config.guess
config.sub
configure
configure.ac
depcomp
doc/assisted-satellite-navigation-api.txt [deleted file]
doc/cdma-connman-api.txt [deleted file]
doc/cdma-messagemanager-api.txt [deleted file]
doc/cdma-network-api.txt [deleted file]
doc/cdma-voicecall-manager-api.txt [deleted file]
doc/coding-style.txt [deleted file]
doc/dialup-command-set.txt [deleted file]
doc/dialup-overview.txt [deleted file]
doc/dundee-api.txt [deleted file]
doc/emergency-call-handling.txt [deleted file]
doc/handsfree-api.txt [deleted file]
doc/hardware-support.txt [deleted file]
doc/hfp-overview.txt [deleted file]
doc/mmi-codes.txt [deleted file]
doc/modem-api.txt
doc/sim900-modem.txt [deleted file]
doc/standards.txt [deleted file]
doc/supplementaryservices-api.txt
doc/voicecall-api.txt
drivers/atmodem/atutil.h
drivers/atmodem/call-barring.c
drivers/atmodem/call-forwarding.c
drivers/atmodem/call-settings.c
drivers/atmodem/cbs.c
drivers/atmodem/network-registration.c
drivers/atmodem/sim-auth.c
drivers/atmodem/sim.c
drivers/atmodem/stk.c
drivers/atmodem/vendor.h
drivers/hfpmodem/handsfree.c
drivers/ifxmodem/voicecall.c
drivers/isimodem/sim.c
drivers/isimodem/uicc.c
drivers/isimodem/voicecall.c
drivers/qmimodem/qmi.c
drivers/qmimodem/qmi.h
drivers/qmimodem/qmimodem.c
drivers/qmimodem/qmimodem.h
drivers/qmimodem/sim-legacy.c
drivers/qmimodem/sim.c [new file with mode: 0644]
drivers/qmimodem/uim.h [new file with mode: 0644]
dundee/dundee.service.in
gdbus/client.c [new file with mode: 0644]
gdbus/gdbus.h
gdbus/mainloop.c
gdbus/object.c
gdbus/watch.c
include/handsfree.h
include/modem.h
include/sim.h
install-sh
ltmain.sh
missing
packaging/ofono.changes
packaging/ofono.spec
plugins/alcatel.c
plugins/gobi.c
plugins/ifx.c
plugins/mbm.c
plugins/stktest.c [new file with mode: 0644]
plugins/telit.c
plugins/udevng.c
plugins/wavecom.c
src/dbus.c
src/handsfree.c
src/modem.c
src/ofono.h
src/ofono.service.in
src/sim.c
src/simfs.c
src/simfs.h
src/simutil.c
src/simutil.h
src/sms.c
src/smsutil.c
src/stk.c
src/stkagent.c
src/ussd.c
src/voicecall.c
test/dundee-connect [deleted file]
test/dundee-disconnect [deleted file]
test/get-icon
test/list-calls
test/list-modems
test/monitor-dundee [deleted file]
test/monitor-ofono
test/test-stk-menu
test/test-ussd [deleted file]
test/test-voicecall [deleted file]
tools/stktest.c [new file with mode: 0644]
tools/tty-redirector.c [new file with mode: 0644]
unit/stk-test-data.h [new file with mode: 0644]
unit/test-simutil.c
unit/test-sms-root.c
unit/test-sms.c
unit/test-stkutil.c

diff --git a/AUTHORS b/AUTHORS
index 0d6c97a..a7a427e 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -81,3 +81,6 @@ Renat Zaripov <r.r.zaripov@gmail.com>
 Michael Brudevold <michael.brudevold@logicpd.com>
 Pablo Neira Ayuso <pablo@gnumonks.org>
 August Mayer <august.mayer@hale.at>
+Holger Hans Peter Freyther <hfreyther@sysmocom.de>
+Cedric Jehasse <cedric.jehasse@softathome.com>
+Mingli Wu <mingli@southpole.se>
index 1ec2d7b..dc10dc9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+ver 1.12:
+       Fix issue with alpha ID and self explanatory icons.
+       Fix issue with SIM Refresh handling and resetting state.
+       Fix issue with SMS initiated by STK proactive command.
+       Fix issue with CBS treating carriage return as padding.
+       Fix issue with USSD terminated by network notification.
+       Add support for battery charge level with Handsfree devices.
+       Add support for technology and band changes with IFX modems.
+       Add support for SIM file handling with Qualcomm QMI modems.
+       Add support for SIM file system 2G and 3G path handling.
+       Add support for SIM Toolkit end-to-end testing.
+
 ver 1.11:
        Fix issue with Bluetooth disconnect handling.
        Fix issue with handling EFspn with filler characters.
index 40a83dc..0d2ba9f 100644 (file)
@@ -56,7 +56,7 @@ builtin_libadd =
 builtin_cflags =
 
 gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \
-                                       gdbus/object.c gdbus/polkit.c
+                               gdbus/object.c gdbus/client.c gdbus/polkit.c
 
 gatchat_sources = gatchat/gatchat.h gatchat/gatchat.c \
                                gatchat/gatresult.h gatchat/gatresult.c \
@@ -156,6 +156,7 @@ qmi_sources = drivers/qmimodem/qmi.h drivers/qmimodem/qmi.c \
                                        drivers/qmimodem/ctl.h \
                                        drivers/qmimodem/dms.h \
                                        drivers/qmimodem/nas.h \
+                                       drivers/qmimodem/uim.h \
                                        drivers/qmimodem/wms.h \
                                        drivers/qmimodem/wds.h \
                                        drivers/qmimodem/pds.h \
@@ -170,6 +171,7 @@ builtin_sources += $(qmi_sources) \
                        drivers/qmimodem/voicecall.c \
                        drivers/qmimodem/network-registration.c \
                        drivers/qmimodem/sim-legacy.c \
+                       drivers/qmimodem/sim.c \
                        drivers/qmimodem/sms.c \
                        drivers/qmimodem/ussd.c \
                        drivers/qmimodem/gprs.c \
@@ -458,6 +460,9 @@ builtin_sources += examples/emulator.c
 
 builtin_modules += example_private_network
 builtin_sources += examples/private-network.c
+
+builtin_modules += stktest
+builtin_sources += plugins/stktest.c
 endif
 
 builtin_modules += smart_messaging
@@ -665,7 +670,8 @@ unit_test_simutil_SOURCES = unit/test-simutil.c src/util.c \
 unit_test_simutil_LDADD = @GLIB_LIBS@
 unit_objects += $(unit_test_simutil_OBJECTS)
 
-unit_test_stkutil_SOURCES = unit/test-stkutil.c src/util.c \
+unit_test_stkutil_SOURCES = unit/test-stkutil.c unit/stk-test-data.h \
+                               src/util.c \
                                 src/storage.c src/smsutil.c \
                                 src/simutil.c src/stkutil.c
 unit_test_stkutil_LDADD = @GLIB_LIBS@
@@ -679,7 +685,8 @@ unit_test_cdmasms_SOURCES = unit/test-cdmasms.c src/cdma-smsutil.c
 unit_test_cdmasms_LDADD = @GLIB_LIBS@
 unit_objects += $(unit_test_cdmasms_OBJECTS)
 
-unit_test_sms_root_SOURCES = unit/test-sms.c src/util.c src/smsutil.c src/storage.c
+unit_test_sms_root_SOURCES = unit/test-sms-root.c \
+                                       src/util.c src/smsutil.c src/storage.c
 unit_test_sms_root_LDADD = @GLIB_LIBS@
 unit_objects += $(unit_test_sms_root_OBJECTS)
 
@@ -698,7 +705,7 @@ TESTS = $(unit_tests)
 if TOOLS
 noinst_PROGRAMS += tools/huawei-audio tools/auto-enable \
                        tools/get-location tools/lookup-apn \
-                       tools/lookup-provider-name
+                       tools/lookup-provider-name tools/tty-redirector
 
 tools_huawei_audio_SOURCES = $(gdbus_sources) tools/huawei-audio.c
 tools_huawei_audio_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
@@ -716,12 +723,23 @@ tools_lookup_provider_name_SOURCES = plugins/mbpi.c plugins/mbpi.h \
                                tools/lookup-provider-name.c
 tools_lookup_provider_name_LDADD = @GLIB_LIBS@
 
+tools_tty_redirector_SOURCES = tools/tty-redirector.c
+tools_tty_redirector_LDADD = @GLIB_LIBS@
+
 if QMIMODEM
 noinst_PROGRAMS += tools/qmi
 
 tools_qmi_SOURCES = $(qmi_sources) tools/qmi.c
 tools_qmi_LDADD = @GLIB_LIBS@
 endif
+
+if MAINTAINER_MODE
+noinst_PROGRAMS += tools/stktest
+
+tools_stktest_SOURCES = $(gatchat_sources) $(gdbus_sources) tools/stktest.c \
+                               unit/stk-test-data.h
+tools_stktest_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
+endif
 endif
 
 if DUNDEE
index ac2b49e..3b3b593 100644 (file)
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -83,8 +100,8 @@ host_triplet = @host@
 @QMIMODEM_TRUE@        drivers/qmimodem/voicecall.c \
 @QMIMODEM_TRUE@        drivers/qmimodem/network-registration.c \
 @QMIMODEM_TRUE@        drivers/qmimodem/sim-legacy.c \
-@QMIMODEM_TRUE@        drivers/qmimodem/sms.c drivers/qmimodem/ussd.c \
-@QMIMODEM_TRUE@        drivers/qmimodem/gprs.c \
+@QMIMODEM_TRUE@        drivers/qmimodem/sim.c drivers/qmimodem/sms.c \
+@QMIMODEM_TRUE@        drivers/qmimodem/ussd.c drivers/qmimodem/gprs.c \
 @QMIMODEM_TRUE@        drivers/qmimodem/gprs-context.c \
 @QMIMODEM_TRUE@        drivers/qmimodem/radio-settings.c \
 @QMIMODEM_TRUE@        drivers/qmimodem/location-reporting.c \
@@ -237,25 +254,27 @@ host_triplet = @host@
 @PROVISION_TRUE@am__append_23 = provision cdma_provision
 @MAINTAINER_MODE_TRUE@am__append_24 = example_history example_nettime \
 @MAINTAINER_MODE_TRUE@ example_provision example_emulator \
-@MAINTAINER_MODE_TRUE@ example_private_network
+@MAINTAINER_MODE_TRUE@ example_private_network stktest
 @MAINTAINER_MODE_TRUE@am__append_25 = examples/history.c \
 @MAINTAINER_MODE_TRUE@ examples/nettime.c examples/provision.c \
 @MAINTAINER_MODE_TRUE@ examples/emulator.c \
-@MAINTAINER_MODE_TRUE@ examples/private-network.c
-sbin_PROGRAMS = src/ofonod$(EXEEXT) $(am__EXEEXT_4)
+@MAINTAINER_MODE_TRUE@ examples/private-network.c \
+@MAINTAINER_MODE_TRUE@ plugins/stktest.c
+sbin_PROGRAMS = src/ofonod$(EXEEXT) $(am__EXEEXT_5)
 noinst_PROGRAMS = $(am__EXEEXT_1) unit/test-sms-root$(EXEEXT) \
        unit/test-mux$(EXEEXT) unit/test-caif$(EXEEXT) $(am__EXEEXT_2) \
-       $(am__EXEEXT_3) gatchat/gsmdial$(EXEEXT) \
+       $(am__EXEEXT_3) $(am__EXEEXT_4) gatchat/gsmdial$(EXEEXT) \
        gatchat/test-server$(EXEEXT) gatchat/test-qcdm$(EXEEXT)
 TESTS = $(am__EXEEXT_1)
 @TOOLS_TRUE@am__append_26 = tools/huawei-audio tools/auto-enable \
 @TOOLS_TRUE@                   tools/get-location tools/lookup-apn \
-@TOOLS_TRUE@                   tools/lookup-provider-name
+@TOOLS_TRUE@                   tools/lookup-provider-name tools/tty-redirector
 
 @QMIMODEM_TRUE@@TOOLS_TRUE@am__append_27 = tools/qmi
-@DUNDEE_TRUE@am__append_28 = dundee/dundee
-@DATAFILES_TRUE@@DUNDEE_TRUE@am__append_29 = dundee/dundee.conf
-@DATAFILES_TRUE@@DUNDEE_TRUE@@SYSTEMD_TRUE@am__append_30 = dundee/dundee.service
+@MAINTAINER_MODE_TRUE@@TOOLS_TRUE@am__append_28 = tools/stktest
+@DUNDEE_TRUE@am__append_29 = dundee/dundee
+@DATAFILES_TRUE@@DUNDEE_TRUE@am__append_30 = dundee/dundee.conf
+@DATAFILES_TRUE@@DUNDEE_TRUE@@SYSTEMD_TRUE@am__append_31 = dundee/dundee.service
 subdir = .
 DIST_COMMON = README $(am__configure_deps) $(am__dist_conf_DATA_DIST) \
        $(am__dist_dbusconf_DATA_DIST) $(dist_man_MANS) \
@@ -287,9 +306,12 @@ am__EXEEXT_1 = unit/test-common$(EXEEXT) unit/test-util$(EXEEXT) \
 @TOOLS_TRUE@   tools/auto-enable$(EXEEXT) \
 @TOOLS_TRUE@   tools/get-location$(EXEEXT) \
 @TOOLS_TRUE@   tools/lookup-apn$(EXEEXT) \
-@TOOLS_TRUE@   tools/lookup-provider-name$(EXEEXT)
+@TOOLS_TRUE@   tools/lookup-provider-name$(EXEEXT) \
+@TOOLS_TRUE@   tools/tty-redirector$(EXEEXT)
 @QMIMODEM_TRUE@@TOOLS_TRUE@am__EXEEXT_3 = tools/qmi$(EXEEXT)
-@DUNDEE_TRUE@am__EXEEXT_4 = dundee/dundee$(EXEEXT)
+@MAINTAINER_MODE_TRUE@@TOOLS_TRUE@am__EXEEXT_4 =  \
+@MAINTAINER_MODE_TRUE@@TOOLS_TRUE@     tools/stktest$(EXEEXT)
+@DUNDEE_TRUE@am__EXEEXT_5 = dundee/dundee$(EXEEXT)
 am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(testdir)" \
        "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(confdir)" \
        "$(DESTDIR)$(dbusconfdir)" "$(DESTDIR)$(pkgconfigdir)" \
@@ -297,26 +319,27 @@ am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(testdir)" \
        "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)"
 PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
 am__dundee_dundee_SOURCES_DIST = gdbus/gdbus.h gdbus/mainloop.c \
-       gdbus/watch.c gdbus/object.c gdbus/polkit.c gatchat/gatchat.h \
-       gatchat/gatchat.c gatchat/gatresult.h gatchat/gatresult.c \
-       gatchat/gatsyntax.h gatchat/gatsyntax.c gatchat/ringbuffer.h \
-       gatchat/ringbuffer.c gatchat/gatio.h gatchat/gatio.c \
-       gatchat/crc-ccitt.h gatchat/crc-ccitt.c gatchat/gatmux.h \
-       gatchat/gatmux.c gatchat/gsm0710.h gatchat/gsm0710.c \
-       gatchat/gattty.h gatchat/gattty.c gatchat/gatutil.h \
-       gatchat/gatutil.c gatchat/gat.h gatchat/gatserver.h \
-       gatchat/gatserver.c gatchat/gatrawip.h gatchat/gatrawip.c \
-       gatchat/gathdlc.c gatchat/gathdlc.h gatchat/gatppp.c \
-       gatchat/gatppp.h gatchat/ppp.h gatchat/ppp_cp.h \
-       gatchat/ppp_cp.c gatchat/ppp_lcp.c gatchat/ppp_auth.c \
-       gatchat/ppp_net.c gatchat/ppp_ipcp.c gatchat/ppp_ipv6cp.c \
-       btio/btio.h btio/btio.c src/log.c src/dbus.c \
-       plugins/bluetooth.c dundee/dundee.h dundee/main.c \
+       gdbus/watch.c gdbus/object.c gdbus/client.c gdbus/polkit.c \
+       gatchat/gatchat.h gatchat/gatchat.c gatchat/gatresult.h \
+       gatchat/gatresult.c gatchat/gatsyntax.h gatchat/gatsyntax.c \
+       gatchat/ringbuffer.h gatchat/ringbuffer.c gatchat/gatio.h \
+       gatchat/gatio.c gatchat/crc-ccitt.h gatchat/crc-ccitt.c \
+       gatchat/gatmux.h gatchat/gatmux.c gatchat/gsm0710.h \
+       gatchat/gsm0710.c gatchat/gattty.h gatchat/gattty.c \
+       gatchat/gatutil.h gatchat/gatutil.c gatchat/gat.h \
+       gatchat/gatserver.h gatchat/gatserver.c gatchat/gatrawip.h \
+       gatchat/gatrawip.c gatchat/gathdlc.c gatchat/gathdlc.h \
+       gatchat/gatppp.c gatchat/gatppp.h gatchat/ppp.h \
+       gatchat/ppp_cp.h gatchat/ppp_cp.c gatchat/ppp_lcp.c \
+       gatchat/ppp_auth.c gatchat/ppp_net.c gatchat/ppp_ipcp.c \
+       gatchat/ppp_ipv6cp.c btio/btio.h btio/btio.c src/log.c \
+       src/dbus.c plugins/bluetooth.c dundee/dundee.h dundee/main.c \
        dundee/dbus.c dundee/manager.c dundee/device.c \
        dundee/bluetooth.c
 am__dirstamp = $(am__leading_dot)dirstamp
 am__objects_1 = gdbus/mainloop.$(OBJEXT) gdbus/watch.$(OBJEXT) \
-       gdbus/object.$(OBJEXT) gdbus/polkit.$(OBJEXT)
+       gdbus/object.$(OBJEXT) gdbus/client.$(OBJEXT) \
+       gdbus/polkit.$(OBJEXT)
 am__objects_2 = gatchat/gatchat.$(OBJEXT) gatchat/gatresult.$(OBJEXT) \
        gatchat/gatsyntax.$(OBJEXT) gatchat/ringbuffer.$(OBJEXT) \
        gatchat/gatio.$(OBJEXT) gatchat/crc-ccitt.$(OBJEXT) \
@@ -339,8 +362,8 @@ dundee_dundee_OBJECTS = $(am_dundee_dundee_OBJECTS)
 am__DEPENDENCIES_1 =
 am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 @DUNDEE_TRUE@dundee_dundee_DEPENDENCIES = $(am__DEPENDENCIES_2)
-AM_V_lt = $(am__v_lt_$(V))
-am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am_gatchat_gsmdial_OBJECTS = gatchat/gsmdial.$(OBJEXT) \
        $(am__objects_2)
@@ -355,17 +378,17 @@ am_gatchat_test_server_OBJECTS = gatchat/test-server.$(OBJEXT) \
 gatchat_test_server_OBJECTS = $(am_gatchat_test_server_OBJECTS)
 gatchat_test_server_DEPENDENCIES =
 am__src_ofonod_SOURCES_DIST = gdbus/gdbus.h gdbus/mainloop.c \
-       gdbus/watch.c gdbus/object.c gdbus/polkit.c plugins/udev.c \
-       plugins/udevng.c gisi/client.c gisi/client.h gisi/common.h \
-       gisi/iter.c gisi/iter.h gisi/message.c gisi/message.h \
-       gisi/modem.c gisi/modem.h gisi/netlink.c gisi/netlink.h \
-       gisi/pep.c gisi/pep.h gisi/phonet.h gisi/pipe.c gisi/pipe.h \
-       gisi/server.c gisi/server.h gisi/socket.c gisi/socket.h \
-       drivers/isimodem/isimodem.h drivers/isimodem/isimodem.c \
-       drivers/isimodem/mtc.h drivers/isimodem/debug.h \
-       drivers/isimodem/isiutil.h drivers/isimodem/debug.c \
-       drivers/isimodem/phonebook.c drivers/isimodem/devinfo.c \
-       drivers/isimodem/info.h \
+       gdbus/watch.c gdbus/object.c gdbus/client.c gdbus/polkit.c \
+       plugins/udev.c plugins/udevng.c gisi/client.c gisi/client.h \
+       gisi/common.h gisi/iter.c gisi/iter.h gisi/message.c \
+       gisi/message.h gisi/modem.c gisi/modem.h gisi/netlink.c \
+       gisi/netlink.h gisi/pep.c gisi/pep.h gisi/phonet.h gisi/pipe.c \
+       gisi/pipe.h gisi/server.c gisi/server.h gisi/socket.c \
+       gisi/socket.h drivers/isimodem/isimodem.h \
+       drivers/isimodem/isimodem.c drivers/isimodem/mtc.h \
+       drivers/isimodem/debug.h drivers/isimodem/isiutil.h \
+       drivers/isimodem/debug.c drivers/isimodem/phonebook.c \
+       drivers/isimodem/devinfo.c drivers/isimodem/info.h \
        drivers/isimodem/network-registration.c \
        drivers/isimodem/network.h drivers/isimodem/infoserver.h \
        drivers/isimodem/infoserver.c drivers/isimodem/voicecall.c \
@@ -384,15 +407,16 @@ am__src_ofonod_SOURCES_DIST = gdbus/gdbus.h gdbus/mainloop.c \
        plugins/nokia-gpio.h plugins/nokia-gpio.c plugins/u8500.c \
        drivers/qmimodem/qmi.h drivers/qmimodem/qmi.c \
        drivers/qmimodem/ctl.h drivers/qmimodem/dms.h \
-       drivers/qmimodem/nas.h drivers/qmimodem/wms.h \
-       drivers/qmimodem/wds.h drivers/qmimodem/pds.h \
-       drivers/qmimodem/common.h drivers/qmimodem/util.h \
-       drivers/qmimodem/qmimodem.h drivers/qmimodem/qmimodem.c \
-       drivers/qmimodem/devinfo.c drivers/qmimodem/voicecall.c \
+       drivers/qmimodem/nas.h drivers/qmimodem/uim.h \
+       drivers/qmimodem/wms.h drivers/qmimodem/wds.h \
+       drivers/qmimodem/pds.h drivers/qmimodem/common.h \
+       drivers/qmimodem/util.h drivers/qmimodem/qmimodem.h \
+       drivers/qmimodem/qmimodem.c drivers/qmimodem/devinfo.c \
+       drivers/qmimodem/voicecall.c \
        drivers/qmimodem/network-registration.c \
-       drivers/qmimodem/sim-legacy.c drivers/qmimodem/sms.c \
-       drivers/qmimodem/ussd.c drivers/qmimodem/gprs.c \
-       drivers/qmimodem/gprs-context.c \
+       drivers/qmimodem/sim-legacy.c drivers/qmimodem/sim.c \
+       drivers/qmimodem/sms.c drivers/qmimodem/ussd.c \
+       drivers/qmimodem/gprs.c drivers/qmimodem/gprs-context.c \
        drivers/qmimodem/radio-settings.c \
        drivers/qmimodem/location-reporting.c plugins/gobi.c \
        gatchat/gatchat.h gatchat/gatchat.c gatchat/gatresult.h \
@@ -480,16 +504,16 @@ am__src_ofonod_SOURCES_DIST = gdbus/gdbus.h gdbus/mainloop.c \
        plugins/mbpi.c plugins/provision.c plugins/cdma-provision.c \
        examples/history.c examples/nettime.c examples/provision.c \
        examples/emulator.c examples/private-network.c \
-       plugins/smart-messaging.c plugins/push-notification.c \
-       src/ofono.ver src/main.c src/ofono.h src/log.c src/plugin.c \
-       src/modem.c src/common.h src/common.c src/manager.c src/dbus.c \
-       src/util.h src/util.c src/network.c src/voicecall.c src/ussd.c \
-       src/sms.c src/call-settings.c src/call-forwarding.c \
-       src/call-meter.c src/smsutil.h src/smsutil.c \
-       src/call-barring.c src/sim.c src/stk.c src/phonebook.c \
-       src/history.c src/message-waiting.c src/simutil.h \
-       src/simutil.c src/storage.h src/storage.c src/cbs.c \
-       src/watch.c src/call-volume.c src/gprs.c src/idmap.h \
+       plugins/stktest.c plugins/smart-messaging.c \
+       plugins/push-notification.c src/ofono.ver src/main.c \
+       src/ofono.h src/log.c src/plugin.c src/modem.c src/common.h \
+       src/common.c src/manager.c src/dbus.c src/util.h src/util.c \
+       src/network.c src/voicecall.c src/ussd.c src/sms.c \
+       src/call-settings.c src/call-forwarding.c src/call-meter.c \
+       src/smsutil.h src/smsutil.c src/call-barring.c src/sim.c \
+       src/stk.c src/phonebook.c src/history.c src/message-waiting.c \
+       src/simutil.h src/simutil.c src/storage.h src/storage.c \
+       src/cbs.c src/watch.c src/call-volume.c src/gprs.c src/idmap.h \
        src/idmap.c src/radio-settings.c src/stkutil.h src/stkutil.c \
        src/nettime.c src/stkagent.c src/stkagent.h src/simfs.c \
        src/simfs.h src/audio-settings.c src/smsagent.c src/smsagent.h \
@@ -537,6 +561,7 @@ am__objects_5 = gisi/client.$(OBJEXT) gisi/iter.$(OBJEXT) \
 @QMIMODEM_TRUE@        drivers/qmimodem/voicecall.$(OBJEXT) \
 @QMIMODEM_TRUE@        drivers/qmimodem/network-registration.$(OBJEXT) \
 @QMIMODEM_TRUE@        drivers/qmimodem/sim-legacy.$(OBJEXT) \
+@QMIMODEM_TRUE@        drivers/qmimodem/sim.$(OBJEXT) \
 @QMIMODEM_TRUE@        drivers/qmimodem/sms.$(OBJEXT) \
 @QMIMODEM_TRUE@        drivers/qmimodem/ussd.$(OBJEXT) \
 @QMIMODEM_TRUE@        drivers/qmimodem/gprs.$(OBJEXT) \
@@ -656,7 +681,8 @@ am__objects_5 = gisi/client.$(OBJEXT) gisi/iter.$(OBJEXT) \
 @MAINTAINER_MODE_TRUE@ examples/nettime.$(OBJEXT) \
 @MAINTAINER_MODE_TRUE@ examples/provision.$(OBJEXT) \
 @MAINTAINER_MODE_TRUE@ examples/emulator.$(OBJEXT) \
-@MAINTAINER_MODE_TRUE@ examples/private-network.$(OBJEXT)
+@MAINTAINER_MODE_TRUE@ examples/private-network.$(OBJEXT) \
+@MAINTAINER_MODE_TRUE@ plugins/stktest.$(OBJEXT)
 am__objects_16 = $(am__objects_4) $(am__objects_6) $(am__objects_8) \
        $(am__objects_9) $(am__objects_10) $(am__objects_11) \
        $(am__objects_12) $(am__objects_13) $(am__objects_14) \
@@ -692,7 +718,7 @@ src_ofonod_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(src_ofonod_LDFLAGS) $(LDFLAGS) -o $@
 am__tools_auto_enable_SOURCES_DIST = gdbus/gdbus.h gdbus/mainloop.c \
-       gdbus/watch.c gdbus/object.c gdbus/polkit.c \
+       gdbus/watch.c gdbus/object.c gdbus/client.c gdbus/polkit.c \
        tools/auto-enable.c
 @TOOLS_TRUE@am_tools_auto_enable_OBJECTS = $(am__objects_1) \
 @TOOLS_TRUE@   tools/auto-enable.$(OBJEXT)
@@ -704,7 +730,7 @@ am__tools_get_location_SOURCES_DIST = tools/get-location.c
 tools_get_location_OBJECTS = $(am_tools_get_location_OBJECTS)
 tools_get_location_DEPENDENCIES =
 am__tools_huawei_audio_SOURCES_DIST = gdbus/gdbus.h gdbus/mainloop.c \
-       gdbus/watch.c gdbus/object.c gdbus/polkit.c \
+       gdbus/watch.c gdbus/object.c gdbus/client.c gdbus/polkit.c \
        tools/huawei-audio.c
 @TOOLS_TRUE@am_tools_huawei_audio_OBJECTS = $(am__objects_1) \
 @TOOLS_TRUE@   tools/huawei-audio.$(OBJEXT)
@@ -727,12 +753,39 @@ tools_lookup_provider_name_DEPENDENCIES =
 am__tools_qmi_SOURCES_DIST = drivers/qmimodem/qmi.h \
        drivers/qmimodem/qmi.c drivers/qmimodem/ctl.h \
        drivers/qmimodem/dms.h drivers/qmimodem/nas.h \
-       drivers/qmimodem/wms.h drivers/qmimodem/wds.h \
-       drivers/qmimodem/pds.h drivers/qmimodem/common.h tools/qmi.c
+       drivers/qmimodem/uim.h drivers/qmimodem/wms.h \
+       drivers/qmimodem/wds.h drivers/qmimodem/pds.h \
+       drivers/qmimodem/common.h tools/qmi.c
 @QMIMODEM_TRUE@@TOOLS_TRUE@am_tools_qmi_OBJECTS = $(am__objects_7) \
 @QMIMODEM_TRUE@@TOOLS_TRUE@    tools/qmi.$(OBJEXT)
 tools_qmi_OBJECTS = $(am_tools_qmi_OBJECTS)
 tools_qmi_DEPENDENCIES =
+am__tools_stktest_SOURCES_DIST = gatchat/gatchat.h gatchat/gatchat.c \
+       gatchat/gatresult.h gatchat/gatresult.c gatchat/gatsyntax.h \
+       gatchat/gatsyntax.c gatchat/ringbuffer.h gatchat/ringbuffer.c \
+       gatchat/gatio.h gatchat/gatio.c gatchat/crc-ccitt.h \
+       gatchat/crc-ccitt.c gatchat/gatmux.h gatchat/gatmux.c \
+       gatchat/gsm0710.h gatchat/gsm0710.c gatchat/gattty.h \
+       gatchat/gattty.c gatchat/gatutil.h gatchat/gatutil.c \
+       gatchat/gat.h gatchat/gatserver.h gatchat/gatserver.c \
+       gatchat/gatrawip.h gatchat/gatrawip.c gatchat/gathdlc.c \
+       gatchat/gathdlc.h gatchat/gatppp.c gatchat/gatppp.h \
+       gatchat/ppp.h gatchat/ppp_cp.h gatchat/ppp_cp.c \
+       gatchat/ppp_lcp.c gatchat/ppp_auth.c gatchat/ppp_net.c \
+       gatchat/ppp_ipcp.c gatchat/ppp_ipv6cp.c gdbus/gdbus.h \
+       gdbus/mainloop.c gdbus/watch.c gdbus/object.c gdbus/client.c \
+       gdbus/polkit.c tools/stktest.c unit/stk-test-data.h
+@MAINTAINER_MODE_TRUE@@TOOLS_TRUE@am_tools_stktest_OBJECTS =  \
+@MAINTAINER_MODE_TRUE@@TOOLS_TRUE@     $(am__objects_2) \
+@MAINTAINER_MODE_TRUE@@TOOLS_TRUE@     $(am__objects_1) \
+@MAINTAINER_MODE_TRUE@@TOOLS_TRUE@     tools/stktest.$(OBJEXT)
+tools_stktest_OBJECTS = $(am_tools_stktest_OBJECTS)
+tools_stktest_DEPENDENCIES =
+am__tools_tty_redirector_SOURCES_DIST = tools/tty-redirector.c
+@TOOLS_TRUE@am_tools_tty_redirector_OBJECTS =  \
+@TOOLS_TRUE@   tools/tty-redirector.$(OBJEXT)
+tools_tty_redirector_OBJECTS = $(am_tools_tty_redirector_OBJECTS)
+tools_tty_redirector_DEPENDENCIES =
 am_unit_test_caif_OBJECTS = unit/test-caif.$(OBJEXT) $(am__objects_2)
 unit_test_caif_OBJECTS = $(am_unit_test_caif_OBJECTS)
 unit_test_caif_DEPENDENCIES =
@@ -760,7 +813,7 @@ am_unit_test_sms_OBJECTS = unit/test-sms.$(OBJEXT) src/util.$(OBJEXT) \
        src/smsutil.$(OBJEXT) src/storage.$(OBJEXT)
 unit_test_sms_OBJECTS = $(am_unit_test_sms_OBJECTS)
 unit_test_sms_DEPENDENCIES =
-am_unit_test_sms_root_OBJECTS = unit/test-sms.$(OBJEXT) \
+am_unit_test_sms_root_OBJECTS = unit/test-sms-root.$(OBJEXT) \
        src/util.$(OBJEXT) src/smsutil.$(OBJEXT) src/storage.$(OBJEXT)
 unit_test_sms_root_OBJECTS = $(am_unit_test_sms_root_OBJECTS)
 unit_test_sms_root_DEPENDENCIES =
@@ -794,6 +847,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 SCRIPTS = $(test_SCRIPTS)
 DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -805,21 +864,21 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
        $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
        $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_$(V))
-am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
 am__v_CC_0 = @echo "  CC    " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
 am__v_at_0 = @
 CCLD = $(CC)
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_$(V))
-am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD  " $@;
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
 am__v_GEN_0 = @echo "  GEN   " $@;
 SOURCES = $(dundee_dundee_SOURCES) $(gatchat_gsmdial_SOURCES) \
        $(gatchat_test_qcdm_SOURCES) $(gatchat_test_server_SOURCES) \
@@ -827,6 +886,7 @@ SOURCES = $(dundee_dundee_SOURCES) $(gatchat_gsmdial_SOURCES) \
        $(tools_get_location_SOURCES) $(tools_huawei_audio_SOURCES) \
        $(tools_lookup_apn_SOURCES) \
        $(tools_lookup_provider_name_SOURCES) $(tools_qmi_SOURCES) \
+       $(tools_stktest_SOURCES) $(tools_tty_redirector_SOURCES) \
        $(unit_test_caif_SOURCES) $(unit_test_cdmasms_SOURCES) \
        $(unit_test_common_SOURCES) $(unit_test_idmap_SOURCES) \
        $(unit_test_mux_SOURCES) $(unit_test_simutil_SOURCES) \
@@ -840,12 +900,19 @@ DIST_SOURCES = $(am__dundee_dundee_SOURCES_DIST) \
        $(am__tools_huawei_audio_SOURCES_DIST) \
        $(am__tools_lookup_apn_SOURCES_DIST) \
        $(am__tools_lookup_provider_name_SOURCES_DIST) \
-       $(am__tools_qmi_SOURCES_DIST) $(unit_test_caif_SOURCES) \
-       $(unit_test_cdmasms_SOURCES) $(unit_test_common_SOURCES) \
-       $(unit_test_idmap_SOURCES) $(unit_test_mux_SOURCES) \
-       $(unit_test_simutil_SOURCES) $(unit_test_sms_SOURCES) \
-       $(unit_test_sms_root_SOURCES) $(unit_test_stkutil_SOURCES) \
-       $(unit_test_util_SOURCES)
+       $(am__tools_qmi_SOURCES_DIST) \
+       $(am__tools_stktest_SOURCES_DIST) \
+       $(am__tools_tty_redirector_SOURCES_DIST) \
+       $(unit_test_caif_SOURCES) $(unit_test_cdmasms_SOURCES) \
+       $(unit_test_common_SOURCES) $(unit_test_idmap_SOURCES) \
+       $(unit_test_mux_SOURCES) $(unit_test_simutil_SOURCES) \
+       $(unit_test_sms_SOURCES) $(unit_test_sms_root_SOURCES) \
+       $(unit_test_stkutil_SOURCES) $(unit_test_util_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 man8dir = $(mandir)/man8
 NROFF = nroff
 MANS = $(dist_man_MANS)
@@ -875,12 +942,16 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d "$(distdir)" \
-    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr "$(distdir)"; }; }
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
 distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
 distcleancheck_listfiles = find . -type f -print
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -1044,10 +1115,10 @@ local_headers = $(foreach file,$(pkginclude_HEADERS) \
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = ofono.pc
 @DATAFILES_TRUE@dbusconfdir = @DBUS_CONFDIR@
-@DATAFILES_TRUE@dist_dbusconf_DATA = src/ofono.conf $(am__append_29)
+@DATAFILES_TRUE@dist_dbusconf_DATA = src/ofono.conf $(am__append_30)
 @DATAFILES_TRUE@@SYSTEMD_TRUE@systemdunitdir = @SYSTEMD_UNITDIR@
 @DATAFILES_TRUE@@SYSTEMD_TRUE@systemdunit_DATA = src/ofono.service \
-@DATAFILES_TRUE@@SYSTEMD_TRUE@ $(am__append_30)
+@DATAFILES_TRUE@@SYSTEMD_TRUE@ $(am__append_31)
 @DATAFILES_TRUE@confdir = $(sysconfdir)/ofono
 @DATAFILES_TRUE@dist_conf_DATA = $(am__append_13)
 @DATAFILES_TRUE@statedir = $(localstatedir)/lib/ofono
@@ -1064,7 +1135,7 @@ builtin_sources = $(am__append_2) $(am__append_6) $(am__append_8) \
 builtin_libadd = $(am__append_4) $(am__append_21)
 builtin_cflags = $(am__append_3) $(am__append_20)
 gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \
-                                       gdbus/object.c gdbus/polkit.c
+                               gdbus/object.c gdbus/client.c gdbus/polkit.c
 
 gatchat_sources = gatchat/gatchat.h gatchat/gatchat.c \
                                gatchat/gatresult.h gatchat/gatresult.c \
@@ -1102,6 +1173,7 @@ btio_sources = btio/btio.h btio/btio.c
 @QMIMODEM_TRUE@                                        drivers/qmimodem/ctl.h \
 @QMIMODEM_TRUE@                                        drivers/qmimodem/dms.h \
 @QMIMODEM_TRUE@                                        drivers/qmimodem/nas.h \
+@QMIMODEM_TRUE@                                        drivers/qmimodem/uim.h \
 @QMIMODEM_TRUE@                                        drivers/qmimodem/wms.h \
 @QMIMODEM_TRUE@                                        drivers/qmimodem/wds.h \
 @QMIMODEM_TRUE@                                        drivers/qmimodem/pds.h \
@@ -1283,7 +1355,8 @@ unit_test_simutil_SOURCES = unit/test-simutil.c src/util.c \
                                 src/simutil.c src/smsutil.c src/storage.c
 
 unit_test_simutil_LDADD = @GLIB_LIBS@
-unit_test_stkutil_SOURCES = unit/test-stkutil.c src/util.c \
+unit_test_stkutil_SOURCES = unit/test-stkutil.c unit/stk-test-data.h \
+                               src/util.c \
                                 src/storage.c src/smsutil.c \
                                 src/simutil.c src/stkutil.c
 
@@ -1292,7 +1365,9 @@ unit_test_sms_SOURCES = unit/test-sms.c src/util.c src/smsutil.c src/storage.c
 unit_test_sms_LDADD = @GLIB_LIBS@
 unit_test_cdmasms_SOURCES = unit/test-cdmasms.c src/cdma-smsutil.c
 unit_test_cdmasms_LDADD = @GLIB_LIBS@
-unit_test_sms_root_SOURCES = unit/test-sms.c src/util.c src/smsutil.c src/storage.c
+unit_test_sms_root_SOURCES = unit/test-sms-root.c \
+                                       src/util.c src/smsutil.c src/storage.c
+
 unit_test_sms_root_LDADD = @GLIB_LIBS@
 unit_test_mux_SOURCES = unit/test-mux.c $(gatchat_sources)
 unit_test_mux_LDADD = @GLIB_LIBS@
@@ -1313,8 +1388,14 @@ unit_test_caif_LDADD = @GLIB_LIBS@
 @TOOLS_TRUE@                           tools/lookup-provider-name.c
 
 @TOOLS_TRUE@tools_lookup_provider_name_LDADD = @GLIB_LIBS@
+@TOOLS_TRUE@tools_tty_redirector_SOURCES = tools/tty-redirector.c
+@TOOLS_TRUE@tools_tty_redirector_LDADD = @GLIB_LIBS@
 @QMIMODEM_TRUE@@TOOLS_TRUE@tools_qmi_SOURCES = $(qmi_sources) tools/qmi.c
 @QMIMODEM_TRUE@@TOOLS_TRUE@tools_qmi_LDADD = @GLIB_LIBS@
+@MAINTAINER_MODE_TRUE@@TOOLS_TRUE@tools_stktest_SOURCES = $(gatchat_sources) $(gdbus_sources) tools/stktest.c \
+@MAINTAINER_MODE_TRUE@@TOOLS_TRUE@                             unit/stk-test-data.h
+
+@MAINTAINER_MODE_TRUE@@TOOLS_TRUE@tools_stktest_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
 @DUNDEE_TRUE@dundee_dundee_SOURCES = $(gdbus_sources) $(gatchat_sources) $(btio_sources) \
 @DUNDEE_TRUE@                  src/log.c src/dbus.c plugins/bluetooth.c \
 @DUNDEE_TRUE@                  dundee/dundee.h dundee/main.c dundee/dbus.c \
@@ -1339,7 +1420,7 @@ all: $(BUILT_SOURCES) config.h
 
 .SUFFIXES:
 .SUFFIXES: .c .lo .o .obj
-am--refresh:
+am--refresh: Makefile
        @:
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
@@ -1375,10 +1456,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-       @if test ! -f $@; then \
-         rm -f stamp-h1; \
-         $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
-       else :; fi
+       @if test ! -f $@; then rm -f stamp-h1; else :; fi
+       @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
 
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
        @rm -f stamp-h1
@@ -1409,8 +1488,11 @@ clean-noinstPROGRAMS:
        rm -f $$list
 install-sbinPROGRAMS: $(sbin_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
        @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
+       fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
        while read p p1; do if test -f $$p || test -f $$p1; \
@@ -1462,6 +1544,8 @@ gdbus/watch.$(OBJEXT): gdbus/$(am__dirstamp) \
        gdbus/$(DEPDIR)/$(am__dirstamp)
 gdbus/object.$(OBJEXT): gdbus/$(am__dirstamp) \
        gdbus/$(DEPDIR)/$(am__dirstamp)
+gdbus/client.$(OBJEXT): gdbus/$(am__dirstamp) \
+       gdbus/$(DEPDIR)/$(am__dirstamp)
 gdbus/polkit.$(OBJEXT): gdbus/$(am__dirstamp) \
        gdbus/$(DEPDIR)/$(am__dirstamp)
 gatchat/$(am__dirstamp):
@@ -1550,22 +1634,22 @@ dundee/device.$(OBJEXT): dundee/$(am__dirstamp) \
        dundee/$(DEPDIR)/$(am__dirstamp)
 dundee/bluetooth.$(OBJEXT): dundee/$(am__dirstamp) \
        dundee/$(DEPDIR)/$(am__dirstamp)
-dundee/dundee$(EXEEXT): $(dundee_dundee_OBJECTS) $(dundee_dundee_DEPENDENCIES) dundee/$(am__dirstamp)
+dundee/dundee$(EXEEXT): $(dundee_dundee_OBJECTS) $(dundee_dundee_DEPENDENCIES) $(EXTRA_dundee_dundee_DEPENDENCIES) dundee/$(am__dirstamp)
        @rm -f dundee/dundee$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(dundee_dundee_OBJECTS) $(dundee_dundee_LDADD) $(LIBS)
 gatchat/gsmdial.$(OBJEXT): gatchat/$(am__dirstamp) \
        gatchat/$(DEPDIR)/$(am__dirstamp)
-gatchat/gsmdial$(EXEEXT): $(gatchat_gsmdial_OBJECTS) $(gatchat_gsmdial_DEPENDENCIES) gatchat/$(am__dirstamp)
+gatchat/gsmdial$(EXEEXT): $(gatchat_gsmdial_OBJECTS) $(gatchat_gsmdial_DEPENDENCIES) $(EXTRA_gatchat_gsmdial_DEPENDENCIES) gatchat/$(am__dirstamp)
        @rm -f gatchat/gsmdial$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(gatchat_gsmdial_OBJECTS) $(gatchat_gsmdial_LDADD) $(LIBS)
 gatchat/test-qcdm.$(OBJEXT): gatchat/$(am__dirstamp) \
        gatchat/$(DEPDIR)/$(am__dirstamp)
-gatchat/test-qcdm$(EXEEXT): $(gatchat_test_qcdm_OBJECTS) $(gatchat_test_qcdm_DEPENDENCIES) gatchat/$(am__dirstamp)
+gatchat/test-qcdm$(EXEEXT): $(gatchat_test_qcdm_OBJECTS) $(gatchat_test_qcdm_DEPENDENCIES) $(EXTRA_gatchat_test_qcdm_DEPENDENCIES) gatchat/$(am__dirstamp)
        @rm -f gatchat/test-qcdm$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(gatchat_test_qcdm_OBJECTS) $(gatchat_test_qcdm_LDADD) $(LIBS)
 gatchat/test-server.$(OBJEXT): gatchat/$(am__dirstamp) \
        gatchat/$(DEPDIR)/$(am__dirstamp)
-gatchat/test-server$(EXEEXT): $(gatchat_test_server_OBJECTS) $(gatchat_test_server_DEPENDENCIES) gatchat/$(am__dirstamp)
+gatchat/test-server$(EXEEXT): $(gatchat_test_server_OBJECTS) $(gatchat_test_server_DEPENDENCIES) $(EXTRA_gatchat_test_server_DEPENDENCIES) gatchat/$(am__dirstamp)
        @rm -f gatchat/test-server$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(gatchat_test_server_OBJECTS) $(gatchat_test_server_LDADD) $(LIBS)
 plugins/udev.$(OBJEXT): plugins/$(am__dirstamp) \
@@ -1685,6 +1769,8 @@ drivers/qmimodem/network-registration.$(OBJEXT):  \
 drivers/qmimodem/sim-legacy.$(OBJEXT):  \
        drivers/qmimodem/$(am__dirstamp) \
        drivers/qmimodem/$(DEPDIR)/$(am__dirstamp)
+drivers/qmimodem/sim.$(OBJEXT): drivers/qmimodem/$(am__dirstamp) \
+       drivers/qmimodem/$(DEPDIR)/$(am__dirstamp)
 drivers/qmimodem/sms.$(OBJEXT): drivers/qmimodem/$(am__dirstamp) \
        drivers/qmimodem/$(DEPDIR)/$(am__dirstamp)
 drivers/qmimodem/ussd.$(OBJEXT): drivers/qmimodem/$(am__dirstamp) \
@@ -2069,6 +2155,8 @@ examples/emulator.$(OBJEXT): examples/$(am__dirstamp) \
        examples/$(DEPDIR)/$(am__dirstamp)
 examples/private-network.$(OBJEXT): examples/$(am__dirstamp) \
        examples/$(DEPDIR)/$(am__dirstamp)
+plugins/stktest.$(OBJEXT): plugins/$(am__dirstamp) \
+       plugins/$(DEPDIR)/$(am__dirstamp)
 plugins/smart-messaging.$(OBJEXT): plugins/$(am__dirstamp) \
        plugins/$(DEPDIR)/$(am__dirstamp)
 plugins/push-notification.$(OBJEXT): plugins/$(am__dirstamp) \
@@ -2159,7 +2247,7 @@ src/cdma-provision.$(OBJEXT): src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/handsfree.$(OBJEXT): src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
-src/ofonod$(EXEEXT): $(src_ofonod_OBJECTS) $(src_ofonod_DEPENDENCIES) src/$(am__dirstamp)
+src/ofonod$(EXEEXT): $(src_ofonod_OBJECTS) $(src_ofonod_DEPENDENCIES) $(EXTRA_src_ofonod_DEPENDENCIES) src/$(am__dirstamp)
        @rm -f src/ofonod$(EXEEXT)
        $(AM_V_CCLD)$(src_ofonod_LINK) $(src_ofonod_OBJECTS) $(src_ofonod_LDADD) $(LIBS)
 tools/$(am__dirstamp):
@@ -2170,34 +2258,44 @@ tools/$(DEPDIR)/$(am__dirstamp):
        @: > tools/$(DEPDIR)/$(am__dirstamp)
 tools/auto-enable.$(OBJEXT): tools/$(am__dirstamp) \
        tools/$(DEPDIR)/$(am__dirstamp)
-tools/auto-enable$(EXEEXT): $(tools_auto_enable_OBJECTS) $(tools_auto_enable_DEPENDENCIES) tools/$(am__dirstamp)
+tools/auto-enable$(EXEEXT): $(tools_auto_enable_OBJECTS) $(tools_auto_enable_DEPENDENCIES) $(EXTRA_tools_auto_enable_DEPENDENCIES) tools/$(am__dirstamp)
        @rm -f tools/auto-enable$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(tools_auto_enable_OBJECTS) $(tools_auto_enable_LDADD) $(LIBS)
 tools/get-location.$(OBJEXT): tools/$(am__dirstamp) \
        tools/$(DEPDIR)/$(am__dirstamp)
-tools/get-location$(EXEEXT): $(tools_get_location_OBJECTS) $(tools_get_location_DEPENDENCIES) tools/$(am__dirstamp)
+tools/get-location$(EXEEXT): $(tools_get_location_OBJECTS) $(tools_get_location_DEPENDENCIES) $(EXTRA_tools_get_location_DEPENDENCIES) tools/$(am__dirstamp)
        @rm -f tools/get-location$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(tools_get_location_OBJECTS) $(tools_get_location_LDADD) $(LIBS)
 tools/huawei-audio.$(OBJEXT): tools/$(am__dirstamp) \
        tools/$(DEPDIR)/$(am__dirstamp)
-tools/huawei-audio$(EXEEXT): $(tools_huawei_audio_OBJECTS) $(tools_huawei_audio_DEPENDENCIES) tools/$(am__dirstamp)
+tools/huawei-audio$(EXEEXT): $(tools_huawei_audio_OBJECTS) $(tools_huawei_audio_DEPENDENCIES) $(EXTRA_tools_huawei_audio_DEPENDENCIES) tools/$(am__dirstamp)
        @rm -f tools/huawei-audio$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(tools_huawei_audio_OBJECTS) $(tools_huawei_audio_LDADD) $(LIBS)
 tools/lookup-apn.$(OBJEXT): tools/$(am__dirstamp) \
        tools/$(DEPDIR)/$(am__dirstamp)
-tools/lookup-apn$(EXEEXT): $(tools_lookup_apn_OBJECTS) $(tools_lookup_apn_DEPENDENCIES) tools/$(am__dirstamp)
+tools/lookup-apn$(EXEEXT): $(tools_lookup_apn_OBJECTS) $(tools_lookup_apn_DEPENDENCIES) $(EXTRA_tools_lookup_apn_DEPENDENCIES) tools/$(am__dirstamp)
        @rm -f tools/lookup-apn$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(tools_lookup_apn_OBJECTS) $(tools_lookup_apn_LDADD) $(LIBS)
 tools/lookup-provider-name.$(OBJEXT): tools/$(am__dirstamp) \
        tools/$(DEPDIR)/$(am__dirstamp)
-tools/lookup-provider-name$(EXEEXT): $(tools_lookup_provider_name_OBJECTS) $(tools_lookup_provider_name_DEPENDENCIES) tools/$(am__dirstamp)
+tools/lookup-provider-name$(EXEEXT): $(tools_lookup_provider_name_OBJECTS) $(tools_lookup_provider_name_DEPENDENCIES) $(EXTRA_tools_lookup_provider_name_DEPENDENCIES) tools/$(am__dirstamp)
        @rm -f tools/lookup-provider-name$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(tools_lookup_provider_name_OBJECTS) $(tools_lookup_provider_name_LDADD) $(LIBS)
 tools/qmi.$(OBJEXT): tools/$(am__dirstamp) \
        tools/$(DEPDIR)/$(am__dirstamp)
-tools/qmi$(EXEEXT): $(tools_qmi_OBJECTS) $(tools_qmi_DEPENDENCIES) tools/$(am__dirstamp)
+tools/qmi$(EXEEXT): $(tools_qmi_OBJECTS) $(tools_qmi_DEPENDENCIES) $(EXTRA_tools_qmi_DEPENDENCIES) tools/$(am__dirstamp)
        @rm -f tools/qmi$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(tools_qmi_OBJECTS) $(tools_qmi_LDADD) $(LIBS)
+tools/stktest.$(OBJEXT): tools/$(am__dirstamp) \
+       tools/$(DEPDIR)/$(am__dirstamp)
+tools/stktest$(EXEEXT): $(tools_stktest_OBJECTS) $(tools_stktest_DEPENDENCIES) $(EXTRA_tools_stktest_DEPENDENCIES) tools/$(am__dirstamp)
+       @rm -f tools/stktest$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(tools_stktest_OBJECTS) $(tools_stktest_LDADD) $(LIBS)
+tools/tty-redirector.$(OBJEXT): tools/$(am__dirstamp) \
+       tools/$(DEPDIR)/$(am__dirstamp)
+tools/tty-redirector$(EXEEXT): $(tools_tty_redirector_OBJECTS) $(tools_tty_redirector_DEPENDENCIES) $(EXTRA_tools_tty_redirector_DEPENDENCIES) tools/$(am__dirstamp)
+       @rm -f tools/tty-redirector$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(tools_tty_redirector_OBJECTS) $(tools_tty_redirector_LDADD) $(LIBS)
 unit/$(am__dirstamp):
        @$(MKDIR_P) unit
        @: > unit/$(am__dirstamp)
@@ -2206,56 +2304,61 @@ unit/$(DEPDIR)/$(am__dirstamp):
        @: > unit/$(DEPDIR)/$(am__dirstamp)
 unit/test-caif.$(OBJEXT): unit/$(am__dirstamp) \
        unit/$(DEPDIR)/$(am__dirstamp)
-unit/test-caif$(EXEEXT): $(unit_test_caif_OBJECTS) $(unit_test_caif_DEPENDENCIES) unit/$(am__dirstamp)
+unit/test-caif$(EXEEXT): $(unit_test_caif_OBJECTS) $(unit_test_caif_DEPENDENCIES) $(EXTRA_unit_test_caif_DEPENDENCIES) unit/$(am__dirstamp)
        @rm -f unit/test-caif$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(unit_test_caif_OBJECTS) $(unit_test_caif_LDADD) $(LIBS)
 unit/test-cdmasms.$(OBJEXT): unit/$(am__dirstamp) \
        unit/$(DEPDIR)/$(am__dirstamp)
-unit/test-cdmasms$(EXEEXT): $(unit_test_cdmasms_OBJECTS) $(unit_test_cdmasms_DEPENDENCIES) unit/$(am__dirstamp)
+unit/test-cdmasms$(EXEEXT): $(unit_test_cdmasms_OBJECTS) $(unit_test_cdmasms_DEPENDENCIES) $(EXTRA_unit_test_cdmasms_DEPENDENCIES) unit/$(am__dirstamp)
        @rm -f unit/test-cdmasms$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(unit_test_cdmasms_OBJECTS) $(unit_test_cdmasms_LDADD) $(LIBS)
 unit/test-common.$(OBJEXT): unit/$(am__dirstamp) \
        unit/$(DEPDIR)/$(am__dirstamp)
-unit/test-common$(EXEEXT): $(unit_test_common_OBJECTS) $(unit_test_common_DEPENDENCIES) unit/$(am__dirstamp)
+unit/test-common$(EXEEXT): $(unit_test_common_OBJECTS) $(unit_test_common_DEPENDENCIES) $(EXTRA_unit_test_common_DEPENDENCIES) unit/$(am__dirstamp)
        @rm -f unit/test-common$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(unit_test_common_OBJECTS) $(unit_test_common_LDADD) $(LIBS)
 unit/test-idmap.$(OBJEXT): unit/$(am__dirstamp) \
        unit/$(DEPDIR)/$(am__dirstamp)
-unit/test-idmap$(EXEEXT): $(unit_test_idmap_OBJECTS) $(unit_test_idmap_DEPENDENCIES) unit/$(am__dirstamp)
+unit/test-idmap$(EXEEXT): $(unit_test_idmap_OBJECTS) $(unit_test_idmap_DEPENDENCIES) $(EXTRA_unit_test_idmap_DEPENDENCIES) unit/$(am__dirstamp)
        @rm -f unit/test-idmap$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(unit_test_idmap_OBJECTS) $(unit_test_idmap_LDADD) $(LIBS)
 unit/test-mux.$(OBJEXT): unit/$(am__dirstamp) \
        unit/$(DEPDIR)/$(am__dirstamp)
-unit/test-mux$(EXEEXT): $(unit_test_mux_OBJECTS) $(unit_test_mux_DEPENDENCIES) unit/$(am__dirstamp)
+unit/test-mux$(EXEEXT): $(unit_test_mux_OBJECTS) $(unit_test_mux_DEPENDENCIES) $(EXTRA_unit_test_mux_DEPENDENCIES) unit/$(am__dirstamp)
        @rm -f unit/test-mux$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(unit_test_mux_OBJECTS) $(unit_test_mux_LDADD) $(LIBS)
 unit/test-simutil.$(OBJEXT): unit/$(am__dirstamp) \
        unit/$(DEPDIR)/$(am__dirstamp)
-unit/test-simutil$(EXEEXT): $(unit_test_simutil_OBJECTS) $(unit_test_simutil_DEPENDENCIES) unit/$(am__dirstamp)
+unit/test-simutil$(EXEEXT): $(unit_test_simutil_OBJECTS) $(unit_test_simutil_DEPENDENCIES) $(EXTRA_unit_test_simutil_DEPENDENCIES) unit/$(am__dirstamp)
        @rm -f unit/test-simutil$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(unit_test_simutil_OBJECTS) $(unit_test_simutil_LDADD) $(LIBS)
 unit/test-sms.$(OBJEXT): unit/$(am__dirstamp) \
        unit/$(DEPDIR)/$(am__dirstamp)
-unit/test-sms$(EXEEXT): $(unit_test_sms_OBJECTS) $(unit_test_sms_DEPENDENCIES) unit/$(am__dirstamp)
+unit/test-sms$(EXEEXT): $(unit_test_sms_OBJECTS) $(unit_test_sms_DEPENDENCIES) $(EXTRA_unit_test_sms_DEPENDENCIES) unit/$(am__dirstamp)
        @rm -f unit/test-sms$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(unit_test_sms_OBJECTS) $(unit_test_sms_LDADD) $(LIBS)
-unit/test-sms-root$(EXEEXT): $(unit_test_sms_root_OBJECTS) $(unit_test_sms_root_DEPENDENCIES) unit/$(am__dirstamp)
+unit/test-sms-root.$(OBJEXT): unit/$(am__dirstamp) \
+       unit/$(DEPDIR)/$(am__dirstamp)
+unit/test-sms-root$(EXEEXT): $(unit_test_sms_root_OBJECTS) $(unit_test_sms_root_DEPENDENCIES) $(EXTRA_unit_test_sms_root_DEPENDENCIES) unit/$(am__dirstamp)
        @rm -f unit/test-sms-root$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(unit_test_sms_root_OBJECTS) $(unit_test_sms_root_LDADD) $(LIBS)
 unit/test-stkutil.$(OBJEXT): unit/$(am__dirstamp) \
        unit/$(DEPDIR)/$(am__dirstamp)
-unit/test-stkutil$(EXEEXT): $(unit_test_stkutil_OBJECTS) $(unit_test_stkutil_DEPENDENCIES) unit/$(am__dirstamp)
+unit/test-stkutil$(EXEEXT): $(unit_test_stkutil_OBJECTS) $(unit_test_stkutil_DEPENDENCIES) $(EXTRA_unit_test_stkutil_DEPENDENCIES) unit/$(am__dirstamp)
        @rm -f unit/test-stkutil$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(unit_test_stkutil_OBJECTS) $(unit_test_stkutil_LDADD) $(LIBS)
 unit/test-util.$(OBJEXT): unit/$(am__dirstamp) \
        unit/$(DEPDIR)/$(am__dirstamp)
-unit/test-util$(EXEEXT): $(unit_test_util_OBJECTS) $(unit_test_util_DEPENDENCIES) unit/$(am__dirstamp)
+unit/test-util$(EXEEXT): $(unit_test_util_OBJECTS) $(unit_test_util_DEPENDENCIES) $(EXTRA_unit_test_util_DEPENDENCIES) unit/$(am__dirstamp)
        @rm -f unit/test-util$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(unit_test_util_OBJECTS) $(unit_test_util_LDADD) $(LIBS)
 install-testSCRIPTS: $(test_SCRIPTS)
        @$(NORMAL_INSTALL)
-       test -z "$(testdir)" || $(MKDIR_P) "$(DESTDIR)$(testdir)"
        @list='$(test_SCRIPTS)'; test -n "$(testdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(testdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(testdir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
@@ -2283,9 +2386,7 @@ uninstall-testSCRIPTS:
        @list='$(test_SCRIPTS)'; test -n "$(testdir)" || exit 0; \
        files=`for p in $$list; do echo "$$p"; done | \
               sed -e 's,.*/,,;$(transform)'`; \
-       test -n "$$list" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(testdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(testdir)" && rm -f $$files
+       dir='$(DESTDIR)$(testdir)'; $(am__uninstall_files_from_dir)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -2383,6 +2484,7 @@ mostlyclean-compile:
        -rm -f drivers/qmimodem/qmimodem.$(OBJEXT)
        -rm -f drivers/qmimodem/radio-settings.$(OBJEXT)
        -rm -f drivers/qmimodem/sim-legacy.$(OBJEXT)
+       -rm -f drivers/qmimodem/sim.$(OBJEXT)
        -rm -f drivers/qmimodem/sms.$(OBJEXT)
        -rm -f drivers/qmimodem/ussd.$(OBJEXT)
        -rm -f drivers/qmimodem/voicecall.$(OBJEXT)
@@ -2430,6 +2532,7 @@ mostlyclean-compile:
        -rm -f gatchat/ringbuffer.$(OBJEXT)
        -rm -f gatchat/test-qcdm.$(OBJEXT)
        -rm -f gatchat/test-server.$(OBJEXT)
+       -rm -f gdbus/client.$(OBJEXT)
        -rm -f gdbus/mainloop.$(OBJEXT)
        -rm -f gdbus/object.$(OBJEXT)
        -rm -f gdbus/polkit.$(OBJEXT)
@@ -2480,6 +2583,7 @@ mostlyclean-compile:
        -rm -f plugins/speedupcdma.$(OBJEXT)
        -rm -f plugins/ste.$(OBJEXT)
        -rm -f plugins/stemgr.$(OBJEXT)
+       -rm -f plugins/stktest.$(OBJEXT)
        -rm -f plugins/tc65.$(OBJEXT)
        -rm -f plugins/telit.$(OBJEXT)
        -rm -f plugins/u8500.$(OBJEXT)
@@ -2545,12 +2649,15 @@ mostlyclean-compile:
        -rm -f tools/lookup-apn.$(OBJEXT)
        -rm -f tools/lookup-provider-name.$(OBJEXT)
        -rm -f tools/qmi.$(OBJEXT)
+       -rm -f tools/stktest.$(OBJEXT)
+       -rm -f tools/tty-redirector.$(OBJEXT)
        -rm -f unit/test-caif.$(OBJEXT)
        -rm -f unit/test-cdmasms.$(OBJEXT)
        -rm -f unit/test-common.$(OBJEXT)
        -rm -f unit/test-idmap.$(OBJEXT)
        -rm -f unit/test-mux.$(OBJEXT)
        -rm -f unit/test-simutil.$(OBJEXT)
+       -rm -f unit/test-sms-root.$(OBJEXT)
        -rm -f unit/test-sms.$(OBJEXT)
        -rm -f unit/test-stkutil.$(OBJEXT)
        -rm -f unit/test-util.$(OBJEXT)
@@ -2652,6 +2759,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@drivers/qmimodem/$(DEPDIR)/qmimodem.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@drivers/qmimodem/$(DEPDIR)/radio-settings.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@drivers/qmimodem/$(DEPDIR)/sim-legacy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@drivers/qmimodem/$(DEPDIR)/sim.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@drivers/qmimodem/$(DEPDIR)/sms.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@drivers/qmimodem/$(DEPDIR)/ussd.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@drivers/qmimodem/$(DEPDIR)/voicecall.Po@am__quote@
@@ -2699,6 +2807,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@gatchat/$(DEPDIR)/ringbuffer.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@gatchat/$(DEPDIR)/test-qcdm.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@gatchat/$(DEPDIR)/test-server.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/client.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/mainloop.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/object.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/polkit.Po@am__quote@
@@ -2749,6 +2858,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/speedupcdma.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/ste.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/stemgr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/stktest.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/tc65.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/telit.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/u8500.Po@am__quote@
@@ -2814,12 +2924,15 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lookup-apn.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lookup-provider-name.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/qmi.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/stktest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/tty-redirector.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-caif.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-cdmasms.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-common.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-idmap.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-mux.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-simutil.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-sms-root.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-sms.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-stkutil.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-util.Po@am__quote@
@@ -2828,28 +2941,25 @@ distclean-compile:
 @am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
 @am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
 @am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
 @am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
 @am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
 @am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
 @am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
 @am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -2866,11 +2976,18 @@ distclean-libtool:
        -rm -f libtool config.lt
 install-man8: $(dist_man_MANS)
        @$(NORMAL_INSTALL)
-       test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
-       @list=''; test -n "$(man8dir)" || exit 0; \
-       { for i in $$list; do echo "$$i"; done; \
-       l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-         sed -n '/\.8[a-z]*$$/p'; \
+       @list1=''; \
+       list2='$(dist_man_MANS)'; \
+       test -n "$(man8dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
+           | sed -n '/\.8[a-z]*$$/p'; \
+       fi; \
        } | while read p; do \
          if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; echo "$$p"; \
@@ -2899,13 +3016,14 @@ uninstall-man8:
          sed -n '/\.8[a-z]*$$/p'; \
        } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-       test -z "$$files" || { \
-         echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
-         cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+       dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
 install-dist_confDATA: $(dist_conf_DATA)
        @$(NORMAL_INSTALL)
-       test -z "$(confdir)" || $(MKDIR_P) "$(DESTDIR)$(confdir)"
        @list='$(dist_conf_DATA)'; test -n "$(confdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(confdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(confdir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -2919,13 +3037,14 @@ uninstall-dist_confDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(dist_conf_DATA)'; test -n "$(confdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(confdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(confdir)" && rm -f $$files
+       dir='$(DESTDIR)$(confdir)'; $(am__uninstall_files_from_dir)
 install-dist_dbusconfDATA: $(dist_dbusconf_DATA)
        @$(NORMAL_INSTALL)
-       test -z "$(dbusconfdir)" || $(MKDIR_P) "$(DESTDIR)$(dbusconfdir)"
        @list='$(dist_dbusconf_DATA)'; test -n "$(dbusconfdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(dbusconfdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(dbusconfdir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -2939,13 +3058,14 @@ uninstall-dist_dbusconfDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(dist_dbusconf_DATA)'; test -n "$(dbusconfdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(dbusconfdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(dbusconfdir)" && rm -f $$files
+       dir='$(DESTDIR)$(dbusconfdir)'; $(am__uninstall_files_from_dir)
 install-pkgconfigDATA: $(pkgconfig_DATA)
        @$(NORMAL_INSTALL)
-       test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
        @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -2959,13 +3079,14 @@ uninstall-pkgconfigDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
+       dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
 install-stateDATA: $(state_DATA)
        @$(NORMAL_INSTALL)
-       test -z "$(statedir)" || $(MKDIR_P) "$(DESTDIR)$(statedir)"
        @list='$(state_DATA)'; test -n "$(statedir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(statedir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(statedir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -2979,13 +3100,14 @@ uninstall-stateDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(state_DATA)'; test -n "$(statedir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(statedir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(statedir)" && rm -f $$files
+       dir='$(DESTDIR)$(statedir)'; $(am__uninstall_files_from_dir)
 install-systemdunitDATA: $(systemdunit_DATA)
        @$(NORMAL_INSTALL)
-       test -z "$(systemdunitdir)" || $(MKDIR_P) "$(DESTDIR)$(systemdunitdir)"
        @list='$(systemdunit_DATA)'; test -n "$(systemdunitdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(systemdunitdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(systemdunitdir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -2999,13 +3121,14 @@ uninstall-systemdunitDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(systemdunit_DATA)'; test -n "$(systemdunitdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(systemdunitdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(systemdunitdir)" && rm -f $$files
+       dir='$(DESTDIR)$(systemdunitdir)'; $(am__uninstall_files_from_dir)
 install-nodist_pkgincludeHEADERS: $(nodist_pkginclude_HEADERS)
        @$(NORMAL_INSTALL)
-       test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
        @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -3019,13 +3142,14 @@ uninstall-nodist_pkgincludeHEADERS:
        @$(NORMAL_UNINSTALL)
        @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files
+       dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
 install-pkgincludeHEADERS: $(pkginclude_HEADERS)
        @$(NORMAL_INSTALL)
-       test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
        @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -3039,9 +3163,7 @@ uninstall-pkgincludeHEADERS:
        @$(NORMAL_UNINSTALL)
        @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files
+       dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -3176,14 +3298,15 @@ check-TESTS: $(TESTS)
          fi; \
          dashes=`echo "$$dashes" | sed s/./=/g`; \
          if test "$$failed" -eq 0; then \
-           echo "$$grn$$dashes"; \
+           col="$$grn"; \
          else \
-           echo "$$red$$dashes"; \
+           col="$$red"; \
          fi; \
-         echo "$$banner"; \
-         test -z "$$skipped" || echo "$$skipped"; \
-         test -z "$$report" || echo "$$report"; \
-         echo "$$dashes$$std"; \
+         echo "$${col}$$dashes$${std}"; \
+         echo "$${col}$$banner$${std}"; \
+         test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+         test -z "$$report" || echo "$${col}$$report$${std}"; \
+         echo "$${col}$$dashes$${std}"; \
          test "$$failed" -eq 0; \
        else :; fi
 
@@ -3244,7 +3367,11 @@ dist-gzip: distdir
        $(am__remove_distdir)
 
 dist-bzip2: distdir
-       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+       tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+       $(am__remove_distdir)
+
+dist-lzip: distdir
+       tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
        $(am__remove_distdir)
 
 dist-lzma: distdir
@@ -3252,7 +3379,7 @@ dist-lzma: distdir
        $(am__remove_distdir)
 
 dist-xz: distdir
-       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
        $(am__remove_distdir)
 
 dist-tarZ: distdir
@@ -3283,6 +3410,8 @@ distcheck: dist
          bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
        *.tar.lzma*) \
          lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.lz*) \
+         lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
        *.tar.xz*) \
          xz -dc $(distdir).tar.xz | $(am__untar) ;;\
        *.tar.Z*) \
@@ -3292,7 +3421,7 @@ distcheck: dist
        *.zip*) \
          unzip $(distdir).zip ;;\
        esac
-       chmod -R a-w $(distdir); chmod a+w $(distdir)
+       chmod -R a-w $(distdir); chmod u+w $(distdir)
        mkdir $(distdir)/_build
        mkdir $(distdir)/_inst
        chmod a-w $(distdir)
@@ -3302,6 +3431,7 @@ distcheck: dist
          && am__cwd=`pwd` \
          && $(am__cd) $(distdir)/_build \
          && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+           $(AM_DISTCHECK_CONFIGURE_FLAGS) \
            $(DISTCHECK_CONFIGURE_FLAGS) \
          && $(MAKE) $(AM_MAKEFLAGS) \
          && $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -3330,8 +3460,16 @@ distcheck: dist
          list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
          sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-       @$(am__cd) '$(distuninstallcheck_dir)' \
-       && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+       @test -n '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: trying to run $@ with an empty' \
+              '$$(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       $(am__cd) '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
           || { echo "ERROR: files left after uninstall:" ; \
                if test -n "$(DESTDIR)"; then \
                  echo "  (check DESTDIR support)"; \
@@ -3368,10 +3506,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
@@ -3528,8 +3671,8 @@ uninstall-man: uninstall-man8
 .PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \
        clean clean-generic clean-libtool clean-local \
        clean-noinstPROGRAMS clean-sbinPROGRAMS ctags dist dist-all \
-       dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ dist-xz \
-       dist-zip distcheck distclean distclean-compile \
+       dist-bzip2 dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ \
+       dist-xz dist-zip distcheck distclean distclean-compile \
        distclean-generic distclean-hdr distclean-libtool \
        distclean-tags distcleancheck distdir distuninstallcheck dvi \
        dvi-am html html-am info info-am install install-am \
index 8720de8..4541dc4 100644 (file)
@@ -1,7 +1,8 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
+# Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -13,8 +14,8 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
@@ -22,8 +23,8 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-#                 Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 # This file is free software; the Free Software Foundation gives
@@ -32,8 +33,8 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
 
 m4_define([_LT_COPYING], [dnl
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-#                 Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 #   This file is part of GNU Libtool.
@@ -167,6 +168,8 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
 
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
 _LT_DECL([], [host_alias], [0], [The host system])dnl
 _LT_DECL([], [host], [0])dnl
 _LT_DECL([], [host_os], [0])dnl
@@ -652,7 +655,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
 configured by $[0], generated by m4_PACKAGE_STRING.
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2011 Free Software Foundation, Inc.
 This config.lt script is free software; the Free Software Foundation
 gives unlimited permision to copy, distribute and modify it."
 
@@ -816,6 +819,7 @@ AC_DEFUN([LT_LANG],
 m4_case([$1],
   [C],                 [_LT_LANG(C)],
   [C++],               [_LT_LANG(CXX)],
+  [Go],                        [_LT_LANG(GO)],
   [Java],              [_LT_LANG(GCJ)],
   [Fortran 77],                [_LT_LANG(F77)],
   [Fortran],           [_LT_LANG(FC)],
@@ -837,6 +841,29 @@ m4_defun([_LT_LANG],
 ])# _LT_LANG
 
 
+m4_ifndef([AC_PROG_GO], [
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC],     [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+  fi
+fi
+if test -z "$GOC"; then
+  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
 # _LT_LANG_DEFAULT_CONFIG
 # -----------------------
 m4_defun([_LT_LANG_DEFAULT_CONFIG],
@@ -867,6 +894,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
        m4_ifdef([LT_PROG_GCJ],
        [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
 
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+  [LT_LANG(GO)],
+  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
 AC_PROVIDE_IFELSE([LT_PROG_RC],
   [LT_LANG(RC)],
   [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
@@ -969,7 +1000,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
        $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
          -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
         _lt_result=$?
-       if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+       # If there is a non-empty error log, and "single_module"
+       # appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+         cat conftest.err >&AS_MESSAGE_LOG_FD
+       # Otherwise, if the output was created with a 0 exit code from
+       # the compiler, it worked.
+       elif test -f libconftest.dylib && test $_lt_result -eq 0; then
          lt_cv_apple_cc_single_mod=yes
        else
          cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -977,6 +1014,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
        rm -rf libconftest.dylib*
        rm -f conftest.*
       fi])
+
     AC_CACHE_CHECK([for -exported_symbols_list linker flag],
       [lt_cv_ld_exported_symbols_list],
       [lt_cv_ld_exported_symbols_list=no
@@ -988,6 +1026,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
        [lt_cv_ld_exported_symbols_list=no])
        LDFLAGS="$save_LDFLAGS"
     ])
+
     AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
       [lt_cv_ld_force_load=no
       cat > conftest.c << _LT_EOF
@@ -1005,7 +1044,9 @@ _LT_EOF
       echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
       $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
       _lt_result=$?
-      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+      if test -s conftest.err && $GREP force_load conftest.err; then
+       cat conftest.err >&AS_MESSAGE_LOG_FD
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
        lt_cv_ld_force_load=yes
       else
        cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1050,8 +1091,8 @@ _LT_EOF
 ])
 
 
-# _LT_DARWIN_LINKER_FEATURES
-# --------------------------
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
 # Checks for linker and compiler features on darwin
 m4_defun([_LT_DARWIN_LINKER_FEATURES],
 [
@@ -1062,6 +1103,8 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
   if test "$lt_cv_ld_force_load" = "yes"; then
     _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
   else
     _LT_TAGVAR(whole_archive_flag_spec, $1)=''
   fi
@@ -1345,14 +1388,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
-sparc*-*solaris*)
+*-*solaris*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
     *64-bit*)
       case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      yes*)
+        case $host in
+        i?86-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD="${LD-ld}_sol2"
+        fi
+        ;;
       *)
        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
          LD="${LD-ld} -64"
@@ -1429,13 +1485,13 @@ old_postuninstall_cmds=
 if test -n "$RANLIB"; then
   case $host_os in
   openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
     ;;
   esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
 fi
 
 case $host_os in
@@ -1615,6 +1671,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     lt_cv_sys_max_cmd_len=196608
     ;;
 
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
   osf*)
     # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
     # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -1654,7 +1715,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
                 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
              test $i != 17 # 1/2 MB should be enough
       do
@@ -2200,7 +2261,7 @@ need_version=unknown
 
 case $host_os in
 aix3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
@@ -2209,7 +2270,7 @@ aix3*)
   ;;
 
 aix[[4-9]]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
@@ -2274,7 +2335,7 @@ beos*)
   ;;
 
 bsdi[[45]]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -2413,7 +2474,7 @@ m4_if([$1], [],[
   ;;
 
 dgux*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -2421,10 +2482,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -2432,7 +2489,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[[123]]*) objformat=aout ;;
+    freebsd[[23]].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -2450,7 +2507,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[[01]]* | freebsdelf3.[[01]]*)
@@ -2469,18 +2526,8 @@ freebsd* | dragonfly*)
   esac
   ;;
 
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
@@ -2541,7 +2588,7 @@ hpux9* | hpux10* | hpux11*)
   ;;
 
 interix[[3-9]]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -2557,7 +2604,7 @@ irix5* | irix6* | nonstopux*)
     nonstopux*) version_type=nonstopux ;;
     *)
        if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux
+               version_type=linux # correct to gnu/linux during the next big refactor
        else
                version_type=irix
        fi ;;
@@ -2594,9 +2641,9 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2640,6 +2687,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -2659,7 +2718,7 @@ netbsd*)
   ;;
 
 newsos6)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
@@ -2728,7 +2787,7 @@ rdos*)
   ;;
 
 solaris*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2753,7 +2812,7 @@ sunos4*)
   ;;
 
 sysv4 | sysv4.3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -2777,7 +2836,7 @@ sysv4 | sysv4.3*)
 
 sysv4*MP*)
   if test -d /usr/nec ;then
-    version_type=linux
+    version_type=linux # correct to gnu/linux during the next big refactor
     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
     soname_spec='$libname${shared_ext}.$major'
     shlibpath_var=LD_LIBRARY_PATH
@@ -2808,7 +2867,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
 
 tpf*)
   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2818,7 +2877,7 @@ tpf*)
   ;;
 
 uts4*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -3199,10 +3258,6 @@ freebsd* | dragonfly*)
   fi
   ;;
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -3240,12 +3295,12 @@ irix5* | irix6* | nonstopux*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
@@ -3660,6 +3715,7 @@ for ac_symprfx in "" "_"; do
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK ['"\
 "     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
@@ -3992,7 +4048,7 @@ m4_if([$1], [CXX], [
            ;;
        esac
        ;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
        case $cc_basename in
          KCC*)
            # KAI C++ Compiler
@@ -4056,7 +4112,7 @@ m4_if([$1], [CXX], [
            ;;
        esac
        ;;
-      netbsd*)
+      netbsd* | netbsdelf*-gnu)
        ;;
       *qnx* | *nto*)
         # QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4244,7 +4300,9 @@ m4_if([$1], [CXX], [
     case $cc_basename in
     nvcc*) # Cuda Compiler Driver 2.2
       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+      fi
       ;;
     esac
   else
@@ -4289,7 +4347,7 @@ m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -4336,18 +4394,33 @@ m4_if([$1], [CXX], [
        ;;
       *)
        case `$CC -V 2>&1 | sed 5q` in
-       *Sun\ F* | *Sun*Fortran*)
+       *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
          # Sun Fortran 8.3 passes all unrecognized flags to the linker
          _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
          _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
          _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
          ;;
+       *Sun\ F* | *Sun*Fortran*)
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+         ;;
        *Sun\ C*)
          # Sun C 5.9
          _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
          _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
          _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
          ;;
+        *Intel*\ [[CF]]*Compiler*)
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+         ;;
+       *Portland\ Group*)
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         ;;
        esac
        ;;
       esac
@@ -4507,13 +4580,18 @@ m4_if([$1], [CXX], [
     ;;
   cygwin* | mingw* | cegcc*)
     case $cc_basename in
-    cl*) ;;
+    cl*)
+      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+      ;;
     *)
       _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
       _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
       ;;
     esac
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   *)
     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
     ;;
@@ -4532,7 +4610,6 @@ m4_if([$1], [CXX], [
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_direct_absolute, $1)=no
   _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
   _LT_TAGVAR(hardcode_libdir_separator, $1)=
   _LT_TAGVAR(hardcode_minus_L, $1)=no
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -4577,6 +4654,9 @@ dnl Note also adjust exclude_expsyms for C++ above.
   openbsd*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
@@ -4783,8 +4863,7 @@ _LT_EOF
        xlf* | bgf* | bgxlf* | mpixlf*)
          # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
          _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-         _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
          _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
          if test "x$supports_anon_versioning" = xyes; then
            _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
@@ -4799,7 +4878,7 @@ _LT_EOF
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
        wlarc=
@@ -4976,6 +5055,7 @@ _LT_EOF
        if test "$aix_use_runtimelinking" = yes; then
          shared_flag="$shared_flag "'${wl}-G'
        fi
+       _LT_TAGVAR(link_all_deplibs, $1)=no
       else
        # not using gcc
        if test "$host_cpu" = ia64; then
@@ -5079,6 +5159,7 @@ _LT_EOF
        # The linker will not automatically build a static lib if we build a DLL.
        # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+       _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
        _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
        # Don't use ranlib
        _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
@@ -5125,10 +5206,6 @@ _LT_EOF
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
-    freebsd1*)
-      _LT_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
     # support.  Future versions do this automatically, but an explicit c++rt0.o
     # does not break anything, and helps significantly (at the cost of a little
@@ -5141,7 +5218,7 @@ _LT_EOF
       ;;
 
     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
+    freebsd2.*)
       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       _LT_TAGVAR(hardcode_direct, $1)=yes
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
@@ -5180,7 +5257,6 @@ _LT_EOF
       fi
       if test "$with_gnu_ld" = no; then
        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-       _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
        _LT_TAGVAR(hardcode_direct, $1)=yes
        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
@@ -5284,7 +5360,7 @@ _LT_EOF
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -5622,9 +5698,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1],
 _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
     [Flag to hardcode $libdir into a binary during linking.
     This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
-    [[If ld is used when linking, flag to hardcode $libdir into a binary
-    during linking.  This must work even if $libdir does not exist]])
 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
     [Whether we need a single "-rpath" flag with a separated argument])
 _LT_TAGDECL([], [hardcode_direct], [0],
@@ -5778,7 +5851,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
 _LT_TAGVAR(hardcode_direct, $1)=no
 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -6148,7 +6220,7 @@ if test "$_lt_caught_CXX_error" != yes; then
         esac
         ;;
 
-      freebsd[[12]]*)
+      freebsd2.*)
         # C++ shared libraries reported to be fairly broken before
        # switch to ELF
         _LT_TAGVAR(ld_shlibs, $1)=no
@@ -6164,9 +6236,6 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(ld_shlibs, $1)=yes
         ;;
 
-      gnu*)
-        ;;
-
       haiku*)
         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
@@ -6328,7 +6397,7 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(inherit_rpath, $1)=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
         case $cc_basename in
           KCC*)
            # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -6909,12 +6978,18 @@ public class foo {
   }
 };
 _LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
 ])
 
 _lt_libdeps_save_CFLAGS=$CFLAGS
 case "$CC $CFLAGS " in #(
 *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
 *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
 esac
 
 dnl Parse the compiler output and extract the necessary
@@ -7111,7 +7186,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
 _LT_TAGVAR(hardcode_direct, $1)=no
 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_automatic, $1)=no
@@ -7244,7 +7318,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
 _LT_TAGVAR(hardcode_direct, $1)=no
 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_automatic, $1)=no
@@ -7427,6 +7500,73 @@ CFLAGS=$lt_save_CFLAGS
 ])# _LT_LANG_GCJ_CONFIG
 
 
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
 # _LT_LANG_RC_CONFIG([TAG])
 # -------------------------
 # Ensure that the configuration variables for the Windows resource compiler
@@ -7496,6 +7636,13 @@ dnl aclocal-1.4 backwards compatibility:
 dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
 
 
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
 # LT_PROG_RC
 # ----------
 AC_DEFUN([LT_PROG_RC],
@@ -8160,9 +8307,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
 # MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
 m4_define([_LT_WITH_PIC],
 [AC_ARG_WITH([pic],
-    [AS_HELP_STRING([--with-pic],
+    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
        [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
+    [lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for lt_pkg in $withval; do
+       IFS="$lt_save_ifs"
+       if test "X$lt_pkg" = "X$lt_p"; then
+         pic_mode=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
     [pic_mode=default])
 
 test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
@@ -8334,15 +8496,15 @@ m4_define([lt_dict_filter],
 
 # @configure_input@
 
-# serial 3293 ltversion.m4
+# serial 3337 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.4])
-m4_define([LT_PACKAGE_REVISION], [1.3293])
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4'
-macro_revision='1.3293'
+[macro_version='2.4.2'
+macro_revision='1.3337'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])
@@ -8474,7 +8636,8 @@ m4_ifndef([_LT_PROG_CXX],         [AC_DEFUN([_LT_PROG_CXX])])
 # ----------------------------------
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
@@ -8520,7 +8683,8 @@ m4_define([_PKG_CONFIG],
     pkg_cv_[]$1="$$1"
  elif test -n "$PKG_CONFIG"; then
     PKG_CHECK_EXISTS([$3],
-                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes ],
                     [pkg_failed=yes])
  else
     pkg_failed=untried
@@ -8568,9 +8732,9 @@ if test $pkg_failed = yes; then
        AC_MSG_RESULT([no])
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
-               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
         else 
-               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
@@ -8604,12 +8768,15 @@ else
 fi[]dnl
 ])# PKG_CHECK_MODULES
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
+# Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 1
+
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
@@ -8619,7 +8786,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.11'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11.1], [],
+m4_if([$1], [1.11.6], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -8635,19 +8802,21 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.1])dnl
+[AM_AUTOMAKE_VERSION([1.11.6])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 1
+
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
@@ -8729,14 +8898,14 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
+# 2010, 2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 10
+# serial 12
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -8776,6 +8945,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -8840,7 +9010,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
        break
       fi
       ;;
-    msvisualcpp | msvcmsys)
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
@@ -8905,10 +9075,13 @@ AC_DEFUN([AM_DEP_TRACK],
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 AC_SUBST([AMDEPBACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
 ])
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
@@ -9142,12 +9315,15 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
+# Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 1
+
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
@@ -9187,8 +9363,8 @@ AC_SUBST([am__leading_dot])])
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
+# 2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -9208,7 +9384,7 @@ AC_DEFUN([AM_MAINTAINER_MODE],
        [disable], [m4_define([am_maintainer_other], [enable])],
        [m4_define([am_maintainer_other], [enable])
         m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
-AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
   dnl maintainer-mode's default is 'disable' unless 'enable' is passed
   AC_ARG_ENABLE([maintainer-mode],
 [  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
@@ -9354,12 +9530,15 @@ else
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
+# Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 1
+
 # AM_PROG_MKDIR_P
 # ---------------
 # Check for `mkdir -p'.
@@ -9382,13 +9561,14 @@ esac
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
+# Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 5
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -9396,13 +9576,13 @@ AC_DEFUN([_AM_MANGLE_OPTION],
 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
 # _AM_SET_OPTION(NAME)
-# ------------------------------
+# --------------------
 # Set option NAME.  Presently that only means defining a flag for this option.
 AC_DEFUN([_AM_SET_OPTION],
 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
 
 # _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
+# ------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
@@ -9478,13 +9658,13 @@ Check your system clock])
 fi
 AC_MSG_RESULT(yes)])
 
-# Copyright (C) 2009  Free Software Foundation, Inc.
+# Copyright (C) 2009, 2011  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
+# serial 2
 
 # AM_SILENT_RULES([DEFAULT])
 # --------------------------
@@ -9499,18 +9679,50 @@ yes) AM_DEFAULT_VERBOSITY=0;;
 no)  AM_DEFAULT_VERBOSITY=1;;
 *)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
 esac
+dnl
+dnl A few `make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+   [am_cv_make_support_nested_variables],
+   [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+  dnl Using `$V' instead of `$(V)' breaks IRIX make.
+  AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
 AM_BACKSLASH='\'
 AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 1
+
 # AM_PROG_INSTALL_STRIP
 # ---------------------
 # One issue with vendor `install' (even GNU) is that you can't
@@ -9533,13 +9745,13 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
+# serial 3
 
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
@@ -9548,13 +9760,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 
 # AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
+# --------------------------
 # Public sister of _AM_SUBST_NOTMAKE.
 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -9576,10 +9788,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
 AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
 m4_if([$1], [v7],
-     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
      [m4_case([$1], [ustar],, [pax],,
               [m4_fatal([Unknown tar format])])
 AC_MSG_CHECKING([how to create a $1 tar archive])
diff --git a/compile b/compile
index c0096a7..862a14e 100755 (executable)
--- a/compile
+++ b/compile
@@ -1,10 +1,10 @@
 #! /bin/sh
-# Wrapper for compilers which do not understand `-c -o'.
+# Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2009-10-06.20; # UTC
+scriptversion=2012-03-05.13; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
-# Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free
+# Software Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -29,21 +29,219 @@ scriptversion=2009-10-06.20; # UTC
 # bugs to <bug-automake@gnu.org> or send patches to
 # <automake-patches@gnu.org>.
 
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""       $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+       # lazily determine how to convert abs files
+       case `uname -s` in
+         MINGW*)
+           file_conv=mingw
+           ;;
+         CYGWIN*)
+           file_conv=cygwin
+           ;;
+         *)
+           file_conv=wine
+           ;;
+       esac
+      fi
+      case $file_conv/,$2, in
+       *,$file_conv,*)
+         ;;
+       mingw/*)
+         file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+         ;;
+       cygwin/*)
+         file=`cygpath -m "$file" || echo "$file"`
+         ;;
+       wine/*)
+         file=`winepath -w "$file" || echo "$file"`
+         ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+       -o)
+         # configure might choose to run compile as 'compile cc -o foo foo.c'.
+         eat=1
+         case $2 in
+           *.o | *.[oO][bB][jJ])
+             func_file_conv "$2"
+             set x "$@" -Fo"$file"
+             shift
+             ;;
+           *)
+             func_file_conv "$2"
+             set x "$@" -Fe"$file"
+             shift
+             ;;
+         esac
+         ;;
+       -I)
+         eat=1
+         func_file_conv "$2" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -I*)
+         func_file_conv "${1#-I}" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -l)
+         eat=1
+         func_cl_dashl "$2"
+         set x "$@" "$lib"
+         shift
+         ;;
+       -l*)
+         func_cl_dashl "${1#-l}"
+         set x "$@" "$lib"
+         shift
+         ;;
+       -L)
+         eat=1
+         func_cl_dashL "$2"
+         ;;
+       -L*)
+         func_cl_dashL "${1#-L}"
+         ;;
+       -static)
+         shared=false
+         ;;
+       -Wl,*)
+         arg=${1#-Wl,}
+         save_ifs="$IFS"; IFS=','
+         for flag in $arg; do
+           IFS="$save_ifs"
+           linker_opts="$linker_opts $flag"
+         done
+         IFS="$save_ifs"
+         ;;
+       -Xlinker)
+         eat=1
+         linker_opts="$linker_opts $2"
+         ;;
+       -*)
+         set x "$@" "$1"
+         shift
+         ;;
+       *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+         func_file_conv "$1"
+         set x "$@" -Tp"$file"
+         shift
+         ;;
+       *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+         func_file_conv "$1" mingw
+         set x "$@" "$file"
+         shift
+         ;;
+       *)
+         set x "$@" "$1"
+         shift
+         ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
      exit 1;
      ;;
   -h | --h*)
     cat <<\EOF
 Usage: compile [--help] [--version] PROGRAM [ARGS]
 
-Wrapper for compilers which do not understand `-c -o'.
-Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
 arguments, and rename the output as expected.
 
 If you are trying to build a whole package this is not the
-right script to run: please start by reading the file `INSTALL'.
+right script to run: please start by reading the file 'INSTALL'.
 
 Report bugs to <bug-automake@gnu.org>.
 EOF
@@ -53,11 +251,13 @@ EOF
     echo "compile $scriptversion"
     exit $?
     ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
 esac
 
 ofile=
 cfile=
-eat=
 
 for arg
 do
@@ -66,8 +266,8 @@ do
   else
     case $1 in
       -o)
-       # configure might choose to run compile as `compile cc -o foo foo.c'.
-       # So we strip `-o arg' only if arg is an object.
+       # configure might choose to run compile as 'compile cc -o foo foo.c'.
+       # So we strip '-o arg' only if arg is an object.
        eat=1
        case $2 in
          *.o | *.obj)
@@ -94,10 +294,10 @@ do
 done
 
 if test -z "$ofile" || test -z "$cfile"; then
-  # If no `-o' option was seen then we might have been invoked from a
+  # If no '-o' option was seen then we might have been invoked from a
   # pattern rule where we don't need one.  That is ok -- this is a
   # normal compilation that the losing compiler can handle.  If no
-  # `.c' file was seen then we are probably linking.  That is also
+  # '.c' file was seen then we are probably linking.  That is also
   # ok.
   exec "$@"
 fi
@@ -106,7 +306,7 @@ fi
 cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
 
 # Create the lock directory.
-# Note: use `[/\\:.-]' here to ensure that we don't use the same name
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
 # that we are using for the .o file.  Also, base the name on the expected
 # object file name, since that is what matters with a parallel build.
 lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
index 666c5ad..d622a44 100755 (executable)
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2009-11-20'
+timestamp='2012-02-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -17,9 +17,7 @@ timestamp='2009-11-20'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -56,8 +54,9 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -139,22 +138,12 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-case "${UNAME_MACHINE}" in
-    i?86)
-       test -z "$VENDOR" && VENDOR=pc
-       ;;
-    *)
-       test -z "$VENDOR" && VENDOR=unknown
-       ;;
-esac
-test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
-
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
        # NetBSD (nbsd) targets should (where applicable) match one or
-       # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+       # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
        # switched to ELF, *-*-netbsd* would select the old
        # object file format.  This provides both forward
@@ -190,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                fi
                ;;
            *)
-               os=netbsd
+               os=netbsd
                ;;
        esac
        # The OS release
@@ -213,19 +202,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        exit ;;
     *:OpenBSD:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-       echo ${UNAME_MACHINE_ARCH}-${VENDOR}-openbsd${UNAME_RELEASE}
+       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
        exit ;;
     *:ekkoBSD:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-ekkobsd${UNAME_RELEASE}
+       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
        exit ;;
     *:SolidBSD:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-solidbsd${UNAME_RELEASE}
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
        exit ;;
     macppc:MirBSD:*:*)
-       echo powerpc-${VENDOR}-mirbsd${UNAME_RELEASE}
+       echo powerpc-unknown-mirbsd${UNAME_RELEASE}
        exit ;;
     *:MirBSD:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-mirbsd${UNAME_RELEASE}
+       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
        exit ;;
     alpha:OSF1:*:*)
        case $UNAME_RELEASE in
@@ -233,7 +222,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
                ;;
        *5.*)
-               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
                ;;
        esac
        # According to Compaq, /usr/sbin/psrinfo has been available on
@@ -279,7 +268,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-       exit ;;
+       # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+       exitcode=$?
+       trap '' 0
+       exit $exitcode ;;
     Alpha\ *:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # Should we change UNAME_MACHINE based on the output of uname instead
@@ -290,13 +282,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo alpha-dec-winnt3.5
        exit ;;
     Amiga*:UNIX_System_V:4.0:*)
-       echo m68k-${VENDOR}-sysv4
+       echo m68k-unknown-sysv4
        exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-amigaos
+       echo ${UNAME_MACHINE}-unknown-amigaos
        exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-morphos
+       echo ${UNAME_MACHINE}-unknown-morphos
        exit ;;
     *:OS/390:*:*)
        echo i370-ibm-openedition
@@ -305,13 +297,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo s390-ibm-zvmoe
        exit ;;
     *:OS400:*:*)
-        echo powerpc-ibm-os400
+       echo powerpc-ibm-os400
        exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
        exit ;;
     arm:riscos:*:*|arm:RISCOS:*:*)
-       echo arm-${VENDOR}-riscos
+       echo arm-unknown-riscos
        exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
        echo hppa1.1-hitachi-hiuxmpp
@@ -404,23 +396,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint${UNAME_RELEASE}
        exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
        echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+       exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint${UNAME_RELEASE}
        exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+       echo m68k-milan-mint${UNAME_RELEASE}
+       exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+       echo m68k-hades-mint${UNAME_RELEASE}
+       exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-${VENDOR}-mint${UNAME_RELEASE}
-        exit ;;
+       echo m68k-unknown-mint${UNAME_RELEASE}
+       exit ;;
     m68k:machten:*:*)
        echo m68k-apple-machten${UNAME_RELEASE}
        exit ;;
@@ -490,8 +482,8 @@ EOF
        echo m88k-motorola-sysv3
        exit ;;
     AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
+       # DG/UX returns AViiON for all architectures
+       UNAME_PROCESSOR=`/usr/bin/uname -p`
        if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
        then
            if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -504,7 +496,7 @@ EOF
        else
            echo i586-dg-dgux${UNAME_RELEASE}
        fi
-       exit ;;
+       exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
        echo m88k-dolphin-sysv3
        exit ;;
@@ -561,7 +553,7 @@ EOF
                echo rs6000-ibm-aix3.2
        fi
        exit ;;
-    *:AIX:*:[456])
+    *:AIX:*:[4567])
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
                IBM_ARCH=rs6000
@@ -604,52 +596,52 @@ EOF
            9000/[678][0-9][0-9])
                if [ -x /usr/bin/getconf ]; then
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                    case "${sc_cpu_version}" in
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-                      532)                      # CPU_PA_RISC2_0
-                        case "${sc_kernel_bits}" in
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
+                   sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                   case "${sc_cpu_version}" in
+                     523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                     528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                     532)                      # CPU_PA_RISC2_0
+                       case "${sc_kernel_bits}" in
+                         32) HP_ARCH="hppa2.0n" ;;
+                         64) HP_ARCH="hppa2.0w" ;;
                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
+                       esac ;;
+                   esac
                fi
                if [ "${HP_ARCH}" = "" ]; then
                    eval $set_cc_for_build
-                   sed 's/^              //' << EOF >$dummy.c
+                   sed 's/^            //' << EOF >$dummy.c
 
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
+               #define _HPUX_SOURCE
+               #include <stdlib.h>
+               #include <unistd.h>
 
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
+               int main ()
+               {
+               #if defined(_SC_KERNEL_BITS)
+                   long bits = sysconf(_SC_KERNEL_BITS);
+               #endif
+                   long cpu  = sysconf (_SC_CPU_VERSION);
 
-                  switch (cpu)
-               {
-               case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-               case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-               case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-                   switch (bits)
-                       {
-                       case 64: puts ("hppa2.0w"); break;
-                       case 32: puts ("hppa2.0n"); break;
-                       default: puts ("hppa2.0"); break;
-                       } break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-                   puts ("hppa2.0"); break;
-              #endif
-               default: puts ("hppa1.0"); break;
-               }
-                  exit (0);
-              }
+                   switch (cpu)
+                       {
+                       case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+                       case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+                       case CPU_PA_RISC2_0:
+               #if defined(_SC_KERNEL_BITS)
+                           switch (bits)
+                               {
+                               case 64: puts ("hppa2.0w"); break;
+                               case 32: puts ("hppa2.0n"); break;
+                               default: puts ("hppa2.0"); break;
+                               } break;
+               #else  /* !defined(_SC_KERNEL_BITS) */
+                           puts ("hppa2.0"); break;
+               #endif
+                       default: puts ("hppa1.0"); break;
+                       }
+                   exit (0);
+               }
 EOF
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
                    test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -730,9 +722,9 @@ EOF
        exit ;;
     i*86:OSF1:*:*)
        if [ -x /usr/sbin/sysversion ] ; then
-           echo ${UNAME_MACHINE}-${VENDOR}-osf1mk
+           echo ${UNAME_MACHINE}-unknown-osf1mk
        else
-           echo ${UNAME_MACHINE}-${VENDOR}-osf1
+           echo ${UNAME_MACHINE}-unknown-osf1
        fi
        exit ;;
     parisc*:Lites*:*:*)
@@ -740,22 +732,22 @@ EOF
        exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
        echo c1-convex-bsd
-        exit ;;
+       exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-        exit ;;
+       exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
        echo c34-convex-bsd
-        exit ;;
+       exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
        echo c38-convex-bsd
-        exit ;;
+       exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
        echo c4-convex-bsd
-        exit ;;
+       exit ;;
     CRAY*Y-MP:*:*:*)
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
        exit ;;
@@ -779,32 +771,31 @@ EOF
        exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
+       FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+       FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+       echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+       exit ;;
     5000:UNIX_System_V:4.*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+       FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+       FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+       echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
        exit ;;
     sparc*:BSD/OS:*:*)
-       echo sparc-${VENDOR}-bsdi${UNAME_RELEASE}
+       echo sparc-unknown-bsdi${UNAME_RELEASE}
        exit ;;
     *:BSD/OS:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-bsdi${UNAME_RELEASE}
+       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
        exit ;;
     *:FreeBSD:*:*)
-       case ${UNAME_MACHINE} in
-           pc98)
-               echo i386-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       UNAME_PROCESSOR=`/usr/bin/uname -p`
+       case ${UNAME_PROCESSOR} in
            amd64)
-               echo x86_64-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
            *)
-               echo ${UNAME_MACHINE}-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+               echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
        esac
        exit ;;
     i*:CYGWIN*:*)
@@ -813,23 +804,26 @@ EOF
     *:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
        exit ;;
+    i*:MSYS*:*)
+       echo ${UNAME_MACHINE}-pc-msys
+       exit ;;
     i*:windows32*:*)
-       # uname -m includes "-pc" on this system.
-       echo ${UNAME_MACHINE}-mingw32
+       # uname -m includes "-pc" on this system.
+       echo ${UNAME_MACHINE}-mingw32
        exit ;;
     i*:PW*:*)
        echo ${UNAME_MACHINE}-pc-pw32
        exit ;;
     *:Interix*:*)
-       case ${UNAME_MACHINE} in
+       case ${UNAME_MACHINE} in
            x86)
                echo i586-pc-interix${UNAME_RELEASE}
                exit ;;
            authenticamd | genuineintel | EM64T)
-               echo x86_64-${VENDOR}-interix${UNAME_RELEASE}
+               echo x86_64-unknown-interix${UNAME_RELEASE}
                exit ;;
            IA64)
-               echo ia64-${VENDOR}-interix${UNAME_RELEASE}
+               echo ia64-unknown-interix${UNAME_RELEASE}
                exit ;;
        esac ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
@@ -848,25 +842,32 @@ EOF
        echo ${UNAME_MACHINE}-pc-uwin
        exit ;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-       echo x86_64-${VENDOR}-cygwin
+       echo x86_64-unknown-cygwin
        exit ;;
     p*:CYGWIN*:*)
-       echo powerpcle-${VENDOR}-cygwin
+       echo powerpcle-unknown-cygwin
        exit ;;
     prep*:SunOS:5.*:*)
-       echo powerpcle-${VENDOR}-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
     *:GNU:*:*)
        # the GNU system
-       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
        exit ;;
     *:GNU/*:*:*)
        # other systems with GNU libc and userland
-       echo ${UNAME_MACHINE}-${VENDOR}-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
        exit ;;
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
        exit ;;
+    aarch64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    aarch64_be:Linux:*:*)
+       UNAME_MACHINE=aarch64_be
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
          EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -876,32 +877,41 @@ EOF
          EV6)   UNAME_MACHINE=alphaev6 ;;
          EV67)  UNAME_MACHINE=alphaev67 ;;
          EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
+       esac
        objdump --private-headers /bin/sh | grep -q ld.so.1
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-       echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
+       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
        exit ;;
     arm*:Linux:*:*)
        eval $set_cc_for_build
        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
            | grep -q __ARM_EABI__
        then
-           echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
        else
-           echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi
+           if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+               | grep -q __ARM_PCS_VFP
+           then
+               echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+           else
+               echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+           fi
        fi
        exit ;;
     avr32*:Linux:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     cris:Linux:*:*)
-       echo cris-axis-linux-gnu
+       echo ${UNAME_MACHINE}-axis-linux-gnu
        exit ;;
     crisv32:Linux:*:*)
-       echo crisv32-axis-linux-gnu
+       echo ${UNAME_MACHINE}-axis-linux-gnu
        exit ;;
     frv:Linux:*:*)
-       echo frv-${VENDOR}-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    hexagon:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     i*86:Linux:*:*)
        LIBC=gnu
@@ -912,16 +922,16 @@ EOF
        #endif
 EOF
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-       echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}"
+       echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
        exit ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     m32r*:Linux:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
        eval $set_cc_for_build
@@ -940,51 +950,54 @@ EOF
        #endif
 EOF
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-       test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
        ;;
     or32:Linux:*:*)
-       echo or32-${VENDOR}-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     padre:Linux:*:*)
-       echo sparc-${VENDOR}-linux-gnu
+       echo sparc-unknown-linux-gnu
        exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-${VENDOR}-linux-gnu
+       echo hppa64-unknown-linux-gnu
        exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
-         PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
-         *)    echo hppa-${VENDOR}-linux-gnu ;;
+         PA7*) echo hppa1.1-unknown-linux-gnu ;;
+         PA8*) echo hppa2.0-unknown-linux-gnu ;;
+         *)    echo hppa-unknown-linux-gnu ;;
        esac
        exit ;;
     ppc64:Linux:*:*)
-       echo powerpc64-${VENDOR}-linux-gnu
+       echo powerpc64-unknown-linux-gnu
        exit ;;
     ppc:Linux:*:*)
-       echo powerpc-${VENDOR}-linux-gnu
+       echo powerpc-unknown-linux-gnu
        exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
        echo ${UNAME_MACHINE}-ibm-linux
        exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    tile*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     vax:Linux:*:*)
        echo ${UNAME_MACHINE}-dec-linux-gnu
        exit ;;
     x86_64:Linux:*:*)
-       echo x86_64-${VENDOR}-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     xtensa*:Linux:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -993,11 +1006,11 @@ EOF
        echo i386-sequent-sysv4
        exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
+       # Unixware is an offshoot of SVR4, but it has its own version
+       # number series starting with 2...
+       # I am not positive that other SVR4 systems won't match this,
        # I just have to hope.  -- rms.
-        # Use sysv4.2uw... so that sysv4* matches it.
+       # Use sysv4.2uw... so that sysv4* matches it.
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
        exit ;;
     i*86:OS/2:*:*)
@@ -1006,16 +1019,16 @@ EOF
        echo ${UNAME_MACHINE}-pc-os2-emx
        exit ;;
     i*86:XTS-300:*:STOP)
-       echo ${UNAME_MACHINE}-${VENDOR}-stop
+       echo ${UNAME_MACHINE}-unknown-stop
        exit ;;
     i*86:atheos:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-atheos
+       echo ${UNAME_MACHINE}-unknown-atheos
        exit ;;
     i*86:syllable:*:*)
        echo ${UNAME_MACHINE}-pc-syllable
        exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-       echo i386-${VENDOR}-lynxos${UNAME_RELEASE}
+       echo i386-unknown-lynxos${UNAME_RELEASE}
        exit ;;
     i*86:*DOS:*:*)
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
@@ -1029,13 +1042,13 @@ EOF
        fi
        exit ;;
     i*86:*:5:[678]*)
-       # UnixWare 7.x, OpenUNIX and OpenServer 6.
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
        case `/bin/uname -X | grep "^Machine"` in
            *486*)           UNAME_MACHINE=i486 ;;
            *Pentium)        UNAME_MACHINE=i586 ;;
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
        esac
-       echo ${UNAME_MACHINE}-${VENDOR}-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
        exit ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
@@ -1057,13 +1070,13 @@ EOF
        exit ;;
     pc:*:*:*)
        # Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i586.
+       # uname -m prints for DJGPP always 'pc', but it prints nothing about
+       # the processor, so we play safe by assuming i586.
        # Note: whatever this is, it MUST be the same as what config.sub
        # prints for the "djgpp" host, or else GDB configury will decide that
        # this is a cross-build.
        echo i586-pc-msdosdjgpp
-        exit ;;
+       exit ;;
     Intel:Mach:3*:*)
        echo i386-pc-mach3
        exit ;;
@@ -1074,7 +1087,7 @@ EOF
        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
          echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
        else # Add other i860-SVR4 vendors below as they are discovered.
-         echo i860-${VENDOR}-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+         echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
        fi
        exit ;;
     mini*:CTIX:SYS*5:*)
@@ -1098,8 +1111,8 @@ EOF
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
          && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+         && { echo i486-ncr-sysv4; exit; } ;;
     NCR*:*:4.2:* | MPRAS*:*:4.2:*)
        OS_REL='.3'
        test -r /etc/.relid \
@@ -1111,19 +1124,19 @@ EOF
        /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
            && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-       echo m68k-${VENDOR}-lynxos${UNAME_RELEASE}
+       echo m68k-unknown-lynxos${UNAME_RELEASE}
        exit ;;
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
        exit ;;
     TSUNAMI:LynxOS:2.*:*)
-       echo sparc-${VENDOR}-lynxos${UNAME_RELEASE}
+       echo sparc-unknown-lynxos${UNAME_RELEASE}
        exit ;;
     rs6000:LynxOS:2.*:*)
-       echo rs6000-${VENDOR}-lynxos${UNAME_RELEASE}
+       echo rs6000-unknown-lynxos${UNAME_RELEASE}
        exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-       echo powerpc-${VENDOR}-lynxos${UNAME_RELEASE}
+       echo powerpc-unknown-lynxos${UNAME_RELEASE}
        exit ;;
     SM[BE]S:UNIX_SV:*:*)
        echo mips-dde-sysv${UNAME_RELEASE}
@@ -1142,10 +1155,10 @@ EOF
                echo ns32k-sni-sysv
        fi
        exit ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel@ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit ;;
+    PENTIUM:*:4.0*:*)  # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                       # says <Richard.M.Bartel@ccMail.Census.GOV>
+       echo i586-unisys-sysv4
+       exit ;;
     *:UNIX_System_V:4*:FTX*)
        # From Gerald Hewes <hewes@openmarket.com>.
        # How about differentiating between stratus architectures? -djm
@@ -1171,11 +1184,11 @@ EOF
        exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
-               echo mips-nec-sysv${UNAME_RELEASE}
+               echo mips-nec-sysv${UNAME_RELEASE}
        else
-               echo mips-${VENDOR}-sysv${UNAME_RELEASE}
+               echo mips-unknown-sysv${UNAME_RELEASE}
        fi
-        exit ;;
+       exit ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
        echo powerpc-be-beos
        exit ;;
@@ -1240,6 +1253,9 @@ EOF
     *:QNX:*:4*)
        echo i386-pc-qnx
        exit ;;
+    NEO-?:NONSTOP_KERNEL:*:*)
+       echo neo-tandem-nsk${UNAME_RELEASE}
+       exit ;;
     NSE-?:NONSTOP_KERNEL:*:*)
        echo nse-tandem-nsk${UNAME_RELEASE}
        exit ;;
@@ -1264,13 +1280,13 @@ EOF
        else
            UNAME_MACHINE="$cputype"
        fi
-       echo ${UNAME_MACHINE}-${VENDOR}-plan9
+       echo ${UNAME_MACHINE}-unknown-plan9
        exit ;;
     *:TOPS-10:*:*)
-       echo pdp10-${VENDOR}-tops10
+       echo pdp10-unknown-tops10
        exit ;;
     *:TENEX:*:*)
-       echo pdp10-${VENDOR}-tenex
+       echo pdp10-unknown-tenex
        exit ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
        echo pdp10-dec-tops20
@@ -1279,19 +1295,19 @@ EOF
        echo pdp10-xkl-tops20
        exit ;;
     *:TOPS-20:*:*)
-       echo pdp10-${VENDOR}-tops20
+       echo pdp10-unknown-tops20
        exit ;;
     *:ITS:*:*)
-       echo pdp10-${VENDOR}-its
+       echo pdp10-unknown-its
        exit ;;
     SEI:*:*:SEIUX)
-        echo mips-sei-seiux${UNAME_RELEASE}
+       echo mips-sei-seiux${UNAME_RELEASE}
        exit ;;
     *:DragonFly:*:*)
-       echo ${UNAME_MACHINE}-${VENDOR}-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
        exit ;;
     *:*VMS:*:*)
-       UNAME_MACHINE=`(uname -p) 2>/dev/null`
+       UNAME_MACHINE=`(uname -p) 2>/dev/null`
        case "${UNAME_MACHINE}" in
            A*) echo alpha-dec-vms ; exit ;;
            I*) echo ia64-dec-vms ; exit ;;
@@ -1309,6 +1325,9 @@ EOF
     i*86:AROS:*:*)
        echo ${UNAME_MACHINE}-pc-aros
        exit ;;
+    x86_64:VMkernel:*:*)
+       echo ${UNAME_MACHINE}-unknown-esx
+       exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1331,11 +1350,11 @@ main ()
 #include <sys/param.h>
   printf ("m68k-sony-newsos%s\n",
 #ifdef NEWSOS4
-          "4"
+       "4"
 #else
-         ""
+       ""
 #endif
-         ); exit (0);
+       ); exit (0);
 #endif
 #endif
 
index 2a55a50..6205f84 100755 (executable)
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2009-11-20'
+timestamp='2012-04-18'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -21,9 +21,7 @@ timestamp='2009-11-20'
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -75,8 +73,9 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -123,13 +122,18 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
   *)
     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
     if [ $basic_machine != $1 ]
@@ -156,8 +160,8 @@ case $os in
                os=
                basic_machine=$1
                ;;
-        -bluegene*)
-               os=-cnk
+       -bluegene*)
+               os=-cnk
                ;;
        -sim | -cisco | -oki | -wec | -winbond)
                os=
@@ -173,10 +177,10 @@ case $os in
                os=-chorusos
                basic_machine=$1
                ;;
-       -chorusrdb)
-               os=-chorusrdb
+       -chorusrdb)
+               os=-chorusrdb
                basic_machine=$1
-               ;;
+               ;;
        -hiux*)
                os=-hiuxwe2
                ;;
@@ -221,6 +225,12 @@ case $os in
        -isc*)
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
+       -lynx*178)
+               os=-lynxos178
+               ;;
+       -lynx*5)
+               os=-lynxos5
+               ;;
        -lynx*)
                os=-lynxos
                ;;
@@ -245,17 +255,22 @@ case $basic_machine in
        # Some are omitted here because they have special meanings below.
        1750a | 580 \
        | a29k \
+       | aarch64 | aarch64_be \
        | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
        | am33_2.0 \
        | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+        | be32 | be64 \
        | bfin \
        | c4x | clipper \
        | d10v | d30v | dlx | dsp16xx \
+       | epiphany \
        | fido | fr30 | frv \
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | hexagon \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
+       | le32 | le64 \
        | lm32 \
        | m32c | m32r | m32rle | m68000 | m68k | m88k \
        | maxq | mb | microblaze | mcore | mep | metag \
@@ -281,29 +296,39 @@ case $basic_machine in
        | moxie \
        | mt \
        | msp430 \
+       | nds32 | nds32le | nds32be \
        | nios | nios2 \
        | ns16k | ns32k \
+       | open8 \
        | or32 \
        | pdp10 | pdp11 | pj | pjl \
-       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | powerpc | powerpc64 | powerpc64le | powerpcle \
        | pyramid \
-       | rx \
+       | rl78 | rx \
        | score \
        | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
        | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
        | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-       | spu | strongarm \
-       | tahoe | thumb | tic4x | tic80 | tron \
+       | spu \
+       | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
        | ubicom32 \
-       | v850 | v850e \
+       | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
        | we32k \
-       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | x86 | xc16x | xstormy16 | xtensa \
        | z8k | z80)
                basic_machine=$basic_machine-unknown
                ;;
-       m6811 | m68hc11 | m6812 | m68hc12 | picochip)
-               # Motorola 68HC11/12.
+       c54x)
+               basic_machine=tic54x-unknown
+               ;;
+       c55x)
+               basic_machine=tic55x-unknown
+               ;;
+       c6x)
+               basic_machine=tic6x-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
                basic_machine=$basic_machine-unknown
                os=-none
                ;;
@@ -313,6 +338,21 @@ case $basic_machine in
                basic_machine=mt-unknown
                ;;
 
+       strongarm | thumb | xscale)
+               basic_machine=arm-unknown
+               ;;
+       xgate)
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       xscaleeb)
+               basic_machine=armeb-unknown
+               ;;
+
+       xscaleel)
+               basic_machine=armel-unknown
+               ;;
+
        # We use `pc' rather than `unknown'
        # because (1) that's what they normally are, and
        # (2) the word "unknown" tends to confuse beginning users.
@@ -327,21 +367,25 @@ case $basic_machine in
        # Recognize the basic CPU types with company name.
        580-* \
        | a29k-* \
+       | aarch64-* | aarch64_be-* \
        | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
        | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
        | avr-* | avr32-* \
+       | be32-* | be64-* \
        | bfin-* | bs2000-* \
-       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* \
        | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
        | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
        | h8300-* | h8500-* \
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | hexagon-* \
        | i*86-* | i860-* | i960-* | ia64-* \
        | ip2k-* | iq2000-* \
+       | le32-* | le64-* \
        | lm32-* \
        | m32c-* | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
@@ -367,25 +411,29 @@ case $basic_machine in
        | mmix-* \
        | mt-* \
        | msp430-* \
+       | nds32-* | nds32le-* | nds32be-* \
        | nios-* | nios2-* \
        | none-* | np1-* | ns16k-* | ns32k-* \
+       | open8-* \
        | orion-* \
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
        | pyramid-* \
-       | romp-* | rs6000-* | rx-* \
+       | rl78-* | romp-* | rs6000-* | rx-* \
        | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
        | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
        | sparclite-* \
-       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
-       | tahoe-* | thumb-* \
-       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+       | tahoe-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tile*-* \
        | tron-* \
        | ubicom32-* \
-       | v850-* | v850e-* | vax-* \
+       | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+       | vax-* \
        | we32k-* \
-       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* \
        | xstormy16-* | xtensa*-* \
        | ymp-* \
        | z8k-* | z80-*)
@@ -410,7 +458,7 @@ case $basic_machine in
                basic_machine=a29k-amd
                os=-udi
                ;;
-       abacus)
+       abacus)
                basic_machine=abacus-unknown
                ;;
        adobe68k)
@@ -480,11 +528,20 @@ case $basic_machine in
                basic_machine=powerpc-ibm
                os=-cnk
                ;;
+       c54x-*)
+               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c55x-*)
+               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c6x-*)
+               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        c90)
                basic_machine=c90-cray
                os=-unicos
                ;;
-        cegcc)
+       cegcc)
                basic_machine=arm-unknown
                os=-cegcc
                ;;
@@ -516,7 +573,7 @@ case $basic_machine in
                basic_machine=craynv-cray
                os=-unicosmp
                ;;
-       cr16)
+       cr16 | cr16-*)
                basic_machine=cr16-unknown
                os=-elf
                ;;
@@ -674,7 +731,6 @@ case $basic_machine in
        i370-ibm* | ibm*)
                basic_machine=i370-ibm
                ;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
        i*86v32)
                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
                os=-sysv32
@@ -732,7 +788,7 @@ case $basic_machine in
                basic_machine=ns32k-utek
                os=-sysv
                ;;
-        microblaze)
+       microblaze)
                basic_machine=microblaze-xilinx
                ;;
        mingw32)
@@ -771,10 +827,18 @@ case $basic_machine in
        ms1-*)
                basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
                ;;
+       msys)
+               basic_machine=i386-pc
+               os=-msys
+               ;;
        mvs)
                basic_machine=i370-ibm
                os=-mvs
                ;;
+       nacl)
+               basic_machine=le32-unknown
+               os=-nacl
+               ;;
        ncr3000)
                basic_machine=i486-ncr
                os=-sysv4
@@ -839,6 +903,12 @@ case $basic_machine in
        np1)
                basic_machine=np1-gould
                ;;
+       neo-tandem)
+               basic_machine=neo-tandem
+               ;;
+       nse-tandem)
+               basic_machine=nse-tandem
+               ;;
        nsr-tandem)
                basic_machine=nsr-tandem
                ;;
@@ -921,9 +991,10 @@ case $basic_machine in
                ;;
        power)  basic_machine=power-ibm
                ;;
-       ppc)    basic_machine=powerpc-unknown
+       ppc | ppcbe)    basic_machine=powerpc-unknown
                ;;
-       ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+       ppc-* | ppcbe-*)
+               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        ppcle | powerpclittle | ppc-le | powerpc-little)
                basic_machine=powerpcle-unknown
@@ -1017,6 +1088,9 @@ case $basic_machine in
                basic_machine=i860-stratus
                os=-sysv4
                ;;
+       strongarm-* | thumb-*)
+               basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        sun2)
                basic_machine=m68000-sun
                ;;
@@ -1073,20 +1147,8 @@ case $basic_machine in
                basic_machine=t90-cray
                os=-unicos
                ;;
-       tic54x | c54x*)
-               basic_machine=tic54x-unknown
-               os=-coff
-               ;;
-       tic55x | c55x*)
-               basic_machine=tic55x-unknown
-               os=-coff
-               ;;
-       tic6x | c6x*)
-               basic_machine=tic6x-unknown
-               os=-coff
-               ;;
        tile*)
-               basic_machine=tile-unknown
+               basic_machine=$basic_machine-unknown
                os=-linux-gnu
                ;;
        tx39)
@@ -1156,6 +1218,9 @@ case $basic_machine in
        xps | xps100)
                basic_machine=xps100-honeywell
                ;;
+       xscale-* | xscalee[bl]-*)
+               basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+               ;;
        ymp)
                basic_machine=ymp-cray
                os=-unicos
@@ -1253,11 +1318,11 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
+       # First match some system type aliases
+       # that might get confused with valid system types.
        # -solaris* is a basic system type, with this one exception.
-        -auroraux)
-               os=-auroraux
+       -auroraux)
+               os=-auroraux
                ;;
        -solaris1 | -solaris1.*)
                os=`echo $os | sed -e 's|solaris1|sunos4|'`
@@ -1293,8 +1358,9 @@ case $os in
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
              | -chorusos* | -chorusrdb* | -cegcc* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+             | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-android* \
+             | -linux-newlib* | -linux-uclibc* \
              | -uxpv* | -beos* | -mpeix* | -udk* \
              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1341,7 +1407,7 @@ case $os in
        -opened*)
                os=-openedition
                ;;
-        -os400*)
+       -os400*)
                os=-os400
                ;;
        -wince*)
@@ -1390,7 +1456,7 @@ case $os in
        -sinix*)
                os=-sysv4
                ;;
-        -tpf*)
+       -tpf*)
                os=-tpf
                ;;
        -triton*)
@@ -1435,6 +1501,8 @@ case $os in
        -dicos*)
                os=-dicos
                ;;
+       -nacl*)
+               ;;
        -none)
                ;;
        *)
@@ -1457,10 +1525,10 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
-        score-*)
+       score-*)
                os=-elf
                ;;
-        spu-*)
+       spu-*)
                os=-elf
                ;;
        *-acorn)
@@ -1472,8 +1540,20 @@ case $basic_machine in
        arm*-semi)
                os=-aout
                ;;
-        c4x-* | tic4x-*)
-               os=-coff
+       c4x-* | tic4x-*)
+               os=-coff
+               ;;
+       hexagon-*)
+               os=-elf
+               ;;
+       tic54x-*)
+               os=-coff
+               ;;
+       tic55x-*)
+               os=-coff
+               ;;
+       tic6x-*)
+               os=-coff
                ;;
        # This must come before the *-dec entry.
        pdp10-*)
@@ -1493,14 +1573,11 @@ case $basic_machine in
                ;;
        m68000-sun)
                os=-sunos3
-               # This also exists in the configure program, but was not the
-               # default.
-               # os=-sunos4
                ;;
        m68*-cisco)
                os=-aout
                ;;
-        mep-*)
+       mep-*)
                os=-elf
                ;;
        mips*-cisco)
@@ -1527,7 +1604,7 @@ case $basic_machine in
        *-ibm)
                os=-aix
                ;;
-       *-knuth)
+       *-knuth)
                os=-mmixware
                ;;
        *-wec)
index a4810af..db4e90d 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,11 +1,9 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for ofono 1.11.
+# Generated by GNU Autoconf 2.69 for ofono 1.12.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -134,6 +132,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -167,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -220,21 +244,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-       # neutralization value for shells without unset; and this also
-       # works around shells that cannot unset nonexistent variables.
-       # Preserve -v and -x to the replacement shell.
-       BASH_ENV=/dev/null
-       ENV=/dev/null
-       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-       export CONFIG_SHELL
-       case $- in # ((((
-         *v*x* | *x*v* ) as_opts=-vx ;;
-         *v* ) as_opts=-v ;;
-         *x* ) as_opts=-x ;;
-         * ) as_opts= ;;
-       esac
-       exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -336,6 +364,14 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -457,6 +493,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -491,16 +531,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -512,28 +552,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -567,8 +587,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='ofono'
 PACKAGE_TARNAME='ofono'
-PACKAGE_VERSION='1.11'
-PACKAGE_STRING='ofono 1.11'
+PACKAGE_VERSION='1.12'
+PACKAGE_STRING='ofono 1.12'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -631,17 +651,19 @@ CDMAMODEM_FALSE
 CDMAMODEM_TRUE
 ATMODEM_FALSE
 ATMODEM_TRUE
+UDEV_FALSE
+UDEV_TRUE
+UDEV_DATADIR
+UDEV_LIBS
+UDEV_CFLAGS
 DUNDEE_FALSE
 DUNDEE_TRUE
 TOOLS_FALSE
 TOOLS_TRUE
 USB_LIBS
 USB_CFLAGS
-UDEV_FALSE
-UDEV_TRUE
-UDEV_DATADIR
-UDEV_LIBS
-UDEV_CFLAGS
+TEST_FALSE
+TEST_TRUE
 SYSTEMD_FALSE
 SYSTEMD_TRUE
 SYSTEMD_UNITDIR
@@ -653,8 +675,6 @@ GTHREAD_LIBS
 GTHREAD_CFLAGS
 GLIB_LIBS
 GLIB_CFLAGS
-TEST_FALSE
-TEST_TRUE
 CPP
 OTOOL64
 OTOOL
@@ -688,6 +708,7 @@ LIBTOOL
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
+am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
@@ -709,6 +730,8 @@ MAINTAINER_MODE_FALSE
 MAINTAINER_MODE_TRUE
 AM_BACKSLASH
 AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
 am__untar
 am__tar
 AMTAR
@@ -785,15 +808,15 @@ with_sysroot
 enable_libtool_lock
 enable_optimization
 enable_debug
-enable_test
 enable_pie
 enable_threads
 with_dbusconfdir
 with_dbusdatadir
 with_systemdunitdir
-enable_udev
+enable_test
 enable_tools
 enable_dundee
+enable_udev
 enable_atmodem
 enable_cdmamodem
 enable_phonesim
@@ -822,10 +845,10 @@ GTHREAD_CFLAGS
 GTHREAD_LIBS
 DBUS_CFLAGS
 DBUS_LIBS
-UDEV_CFLAGS
-UDEV_LIBS
 USB_CFLAGS
 USB_LIBS
+UDEV_CFLAGS
+UDEV_LIBS
 BLUEZ_CFLAGS
 BLUEZ_LIBS'
 
@@ -1283,8 +1306,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1370,7 +1391,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures ofono 1.11 to adapt to many kinds of systems.
+\`configure' configures ofono 1.12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1440,7 +1461,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of ofono 1.11:";;
+     short | recursive ) echo "Configuration of ofono 1.12:";;
    esac
   cat <<\_ACEOF
 
@@ -1461,12 +1482,12 @@ Optional Features:
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --disable-optimization  disable code optimization through compiler
   --enable-debug          enable compiling with debugging information
-  --enable-test           enable test/example scripts
   --enable-pie            enable position independent executables flag
   --enable-threads        enable threading support
-  --disable-udev          don't use udev support even if available
+  --enable-test           enable test/example scripts
   --enable-tools          enable testing tools
-  --enable-dundee         enable DUN deamon support
+  --enable-dundee         enable dialup deamon support
+  --disable-udev          disable udev modem detection support
   --disable-atmodem       disable ETSI AT modem support
   --disable-cdmamodem     disable CDMA AT modem support
   --disable-phonesim      disable Phone simulator support
@@ -1479,7 +1500,7 @@ Optional Features:
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-pic              try to use only PIC/non-PIC objects [default=use
+  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                           both]
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-sysroot=DIR Search for dependent libraries within DIR
@@ -1512,10 +1533,10 @@ Some influential environment variables:
               linker flags for GTHREAD, overriding pkg-config
   DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config
   DBUS_LIBS   linker flags for DBUS, overriding pkg-config
-  UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config
-  UDEV_LIBS   linker flags for UDEV, overriding pkg-config
   USB_CFLAGS  C compiler flags for USB, overriding pkg-config
   USB_LIBS    linker flags for USB, overriding pkg-config
+  UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config
+  UDEV_LIBS   linker flags for UDEV, overriding pkg-config
   BLUEZ_CFLAGS
               C compiler flags for BLUEZ, overriding pkg-config
   BLUEZ_LIBS  linker flags for BLUEZ, overriding pkg-config
@@ -1586,10 +1607,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-ofono configure 1.11
-generated by GNU Autoconf 2.68
+ofono configure 1.12
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1665,7 +1686,7 @@ $as_echo "$ac_try_echo"; } >&5
         test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
         test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
+        test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -1864,8 +1885,8 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by ofono $as_me 1.11, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+It was created by ofono $as_me 1.12, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2281,7 +2302,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+       if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
          if test $ac_prog = install &&
            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
            # AIX install.  It has an incompatible calling convention.
@@ -2450,7 +2471,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2490,7 +2511,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_STRIP="strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2541,7 +2562,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_prog in mkdir gmkdir; do
         for ac_exec_ext in '' $ac_executable_extensions; do
-          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
           case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
             'mkdir (GNU coreutils) '* | \
             'mkdir (coreutils) '* | \
@@ -2594,7 +2615,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2680,7 +2701,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='ofono'
- VERSION='1.11'
+ VERSION='1.12'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2710,11 +2731,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
-# Always define AMTAR for backward compatibility.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
 
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
@@ -2733,6 +2754,33 @@ yes) AM_DEFAULT_VERBOSITY=0;;
 no)  AM_DEFAULT_VERBOSITY=1;;
 *)   AM_DEFAULT_VERBOSITY=0;;
 esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
 AM_BACKSLASH='\'
 
 
@@ -2768,6 +2816,7 @@ fi
 
 
 
+
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
        if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
@@ -2788,7 +2837,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2831,7 +2880,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2957,6 +3006,7 @@ fi
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
  if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
@@ -2989,7 +3039,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3029,7 +3079,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3082,7 +3132,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3123,7 +3173,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -3181,7 +3231,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3225,7 +3275,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3671,8 +3721,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3770,6 +3819,7 @@ else
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -3829,7 +3879,7 @@ else
        break
       fi
       ;;
-    msvisualcpp | msvcmsys)
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
@@ -3954,7 +4004,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3994,7 +4044,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4047,7 +4097,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4088,7 +4138,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -4146,7 +4196,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4190,7 +4240,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4386,8 +4436,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4485,6 +4534,7 @@ else
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -4544,7 +4594,7 @@ else
        break
       fi
       ;;
-    msvisualcpp | msvcmsys)
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
@@ -4745,11 +4795,6 @@ fi
 $as_echo "$ac_cv_prog_cc_pie" >&6; }
 
 
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
-  [\\/$]* | ?:[\\/]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
 
 
 
@@ -4794,8 +4839,8 @@ esac
 
 
 
-macro_version='2.4'
-macro_revision='1.3293'
+macro_version='2.4.2'
+macro_revision='1.3337'
 
 
 
@@ -4973,7 +5018,7 @@ do
     for ac_prog in sed gsed; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+      as_fn_executable_p "$ac_path_SED" || continue
 # Check for GNU ac_path_SED and select it if it is found.
   # Check for GNU $ac_path_SED
 case `"$ac_path_SED" --version 2>&1` in
@@ -5049,7 +5094,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -5115,7 +5160,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -5182,7 +5227,7 @@ do
     for ac_prog in fgrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+      as_fn_executable_p "$ac_path_FGREP" || continue
 # Check for GNU ac_path_FGREP and select it if it is found.
   # Check for GNU $ac_path_FGREP
 case `"$ac_path_FGREP" --version 2>&1` in
@@ -5438,7 +5483,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5482,7 +5527,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5640,6 +5685,11 @@ else
     lt_cv_sys_max_cmd_len=196608
     ;;
 
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
   osf*)
     # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
     # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -5679,7 +5729,7 @@ else
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
                 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
              test $i != 17 # 1/2 MB should be enough
       do
@@ -5901,7 +5951,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5941,7 +5991,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OBJDUMP="objdump"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6067,10 +6117,6 @@ freebsd* | dragonfly*)
   fi
   ;;
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -6108,12 +6154,12 @@ irix5* | irix6* | nonstopux*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
@@ -6247,7 +6293,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6287,7 +6333,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_DLLTOOL="dlltool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6390,7 +6436,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6434,7 +6480,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_AR="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6559,7 +6605,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6599,7 +6645,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_STRIP="strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6658,7 +6704,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6698,7 +6744,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6748,13 +6794,13 @@ old_postuninstall_cmds=
 if test -n "$RANLIB"; then
   case $host_os in
   openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
     ;;
   esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
 fi
 
 case $host_os in
@@ -6901,6 +6947,7 @@ for ac_symprfx in "" "_"; do
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK '"\
 "     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
@@ -7289,7 +7336,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
-sparc*-*solaris*)
+*-*solaris*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
@@ -7300,7 +7347,20 @@ sparc*-*solaris*)
     case `/usr/bin/file conftest.o` in
     *64-bit*)
       case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      yes*)
+        case $host in
+        i?86-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD="${LD-ld}_sol2"
+        fi
+        ;;
       *)
        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
          LD="${LD-ld} -64"
@@ -7333,7 +7393,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7373,7 +7433,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7453,7 +7513,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7493,7 +7553,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7545,7 +7605,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7585,7 +7645,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_NMEDIT="nmedit"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7637,7 +7697,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7677,7 +7737,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_LIPO="lipo"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7729,7 +7789,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7769,7 +7829,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OTOOL="otool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7821,7 +7881,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7861,7 +7921,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OTOOL64="otool64"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7940,7 +8000,13 @@ else
        $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
          -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
         _lt_result=$?
-       if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+       # If there is a non-empty error log, and "single_module"
+       # appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+         cat conftest.err >&5
+       # Otherwise, if the output was created with a 0 exit code from
+       # the compiler, it worked.
+       elif test -f libconftest.dylib && test $_lt_result -eq 0; then
          lt_cv_apple_cc_single_mod=yes
        else
          cat conftest.err >&5
@@ -7951,6 +8017,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
 $as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
 if ${lt_cv_ld_exported_symbols_list+:} false; then :
@@ -7983,6 +8050,7 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
 $as_echo_n "checking for -force_load linker flag... " >&6; }
 if ${lt_cv_ld_force_load+:} false; then :
@@ -8004,7 +8072,9 @@ _LT_EOF
       echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
       $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
       _lt_result=$?
-      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+      if test -s conftest.err && $GREP force_load conftest.err; then
+       cat conftest.err >&5
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
        lt_cv_ld_force_load=yes
       else
        cat conftest.err >&5
@@ -8379,7 +8449,22 @@ fi
 
 # Check whether --with-pic was given.
 if test "${with_pic+set}" = set; then :
-  withval=$with_pic; pic_mode="$withval"
+  withval=$with_pic; lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for lt_pkg in $withval; do
+       IFS="$lt_save_ifs"
+       if test "X$lt_pkg" = "X$lt_p"; then
+         pic_mode=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
   pic_mode=default
 fi
@@ -8457,6 +8542,10 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 
 
+
+
+
+
 test -z "$LN_S" && LN_S="ln -s"
 
 
@@ -8912,7 +9001,9 @@ lt_prog_compiler_static=
     case $cc_basename in
     nvcc*) # Cuda Compiler Driver 2.2
       lt_prog_compiler_wl='-Xlinker '
-      lt_prog_compiler_pic='-Xcompiler -fPIC'
+      if test -n "$lt_prog_compiler_pic"; then
+        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+      fi
       ;;
     esac
   else
@@ -8956,7 +9047,7 @@ lt_prog_compiler_static=
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -9003,18 +9094,33 @@ lt_prog_compiler_static=
        ;;
       *)
        case `$CC -V 2>&1 | sed 5q` in
-       *Sun\ F* | *Sun*Fortran*)
+       *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
          # Sun Fortran 8.3 passes all unrecognized flags to the linker
          lt_prog_compiler_pic='-KPIC'
          lt_prog_compiler_static='-Bstatic'
          lt_prog_compiler_wl=''
          ;;
+       *Sun\ F* | *Sun*Fortran*)
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl='-Qoption ld '
+         ;;
        *Sun\ C*)
          # Sun C 5.9
          lt_prog_compiler_pic='-KPIC'
          lt_prog_compiler_static='-Bstatic'
          lt_prog_compiler_wl='-Wl,'
          ;;
+        *Intel*\ [CF]*Compiler*)
+         lt_prog_compiler_wl='-Wl,'
+         lt_prog_compiler_pic='-fPIC'
+         lt_prog_compiler_static='-static'
+         ;;
+       *Portland\ Group*)
+         lt_prog_compiler_wl='-Wl,'
+         lt_prog_compiler_pic='-fpic'
+         lt_prog_compiler_static='-Bstatic'
+         ;;
        esac
        ;;
       esac
@@ -9376,7 +9482,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   hardcode_direct=no
   hardcode_direct_absolute=no
   hardcode_libdir_flag_spec=
-  hardcode_libdir_flag_spec_ld=
   hardcode_libdir_separator=
   hardcode_minus_L=no
   hardcode_shlibpath_var=unsupported
@@ -9420,6 +9525,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   openbsd*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    link_all_deplibs=no
+    ;;
   esac
 
   ld_shlibs=yes
@@ -9626,8 +9734,7 @@ _LT_EOF
        xlf* | bgf* | bgxlf* | mpixlf*)
          # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
          whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-         hardcode_libdir_flag_spec=
-         hardcode_libdir_flag_spec_ld='-rpath $libdir'
+         hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
          archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
          if test "x$supports_anon_versioning" = xyes; then
            archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
@@ -9642,7 +9749,7 @@ _LT_EOF
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
        wlarc=
@@ -9819,6 +9926,7 @@ _LT_EOF
        if test "$aix_use_runtimelinking" = yes; then
          shared_flag="$shared_flag "'${wl}-G'
        fi
+       link_all_deplibs=no
       else
        # not using gcc
        if test "$host_cpu" = ia64; then
@@ -10006,6 +10114,7 @@ fi
        # The linker will not automatically build a static lib if we build a DLL.
        # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
        enable_shared_with_static_runtimes=yes
+       exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
        export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
        # Don't use ranlib
        old_postinstall_cmds='chmod 644 $oldlib'
@@ -10051,6 +10160,7 @@ fi
   hardcode_shlibpath_var=unsupported
   if test "$lt_cv_ld_force_load" = "yes"; then
     whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
   else
     whole_archive_flag_spec=''
   fi
       hardcode_shlibpath_var=no
       ;;
 
-    freebsd1*)
-      ld_shlibs=no
-      ;;
-
     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
     # support.  Future versions do this automatically, but an explicit c++rt0.o
     # does not break anything, and helps significantly (at the cost of a little
@@ -10095,7 +10201,7 @@ fi
       ;;
 
     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
+    freebsd2.*)
       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       hardcode_direct=yes
       hardcode_minus_L=yes
@@ -10134,7 +10240,6 @@ fi
       fi
       if test "$with_gnu_ld" = no; then
        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-       hardcode_libdir_flag_spec_ld='+b $libdir'
        hardcode_libdir_separator=:
        hardcode_direct=yes
        hardcode_direct_absolute=yes
@@ -10275,7 +10380,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       link_all_deplibs=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -10758,11 +10863,6 @@ esac
 
 
 
-
-
-
-
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
@@ -10852,7 +10952,7 @@ need_version=unknown
 
 case $host_os in
 aix3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
@@ -10861,7 +10961,7 @@ aix3*)
   ;;
 
 aix[4-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
@@ -10926,7 +11026,7 @@ beos*)
   ;;
 
 bsdi[45]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -11065,7 +11165,7 @@ darwin* | rhapsody*)
   ;;
 
 dgux*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -11073,10 +11173,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -11084,7 +11180,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -11102,7 +11198,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -11121,18 +11217,8 @@ freebsd* | dragonfly*)
   esac
   ;;
 
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
@@ -11193,7 +11279,7 @@ hpux9* | hpux10* | hpux11*)
   ;;
 
 interix[3-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -11209,7 +11295,7 @@ irix5* | irix6* | nonstopux*)
     nonstopux*) version_type=nonstopux ;;
     *)
        if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux
+               version_type=linux # correct to gnu/linux during the next big refactor
        else
                version_type=irix
        fi ;;
@@ -11246,9 +11332,9 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -11330,7 +11428,7 @@ netbsd*)
   ;;
 
 newsos6)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
@@ -11399,7 +11497,7 @@ rdos*)
   ;;
 
 solaris*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -11424,7 +11522,7 @@ sunos4*)
   ;;
 
 sysv4 | sysv4.3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -11448,7 +11546,7 @@ sysv4 | sysv4.3*)
 
 sysv4*MP*)
   if test -d /usr/nec ;then
-    version_type=linux
+    version_type=linux # correct to gnu/linux during the next big refactor
     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
     soname_spec='$libname${shared_ext}.$major'
     shlibpath_var=LD_LIBRARY_PATH
@@ -11479,7 +11577,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
 
 tpf*)
   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -11489,7 +11587,7 @@ tpf*)
   ;;
 
 uts4*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -12271,6 +12369,8 @@ CC="$lt_save_CC"
 
 
 
+
+
         ac_config_commands="$ac_config_commands libtool"
 
 
@@ -12301,20 +12401,6 @@ if test "${enable_debug+set}" = set; then :
 fi
 
 
-# Check whether --enable-test was given.
-if test "${enable_test+set}" = set; then :
-  enableval=$enable_test; enable_test=${enableval}
-fi
-
- if test "${enable_test}" = "yes"; then
-  TEST_TRUE=
-  TEST_FALSE='#'
-else
-  TEST_TRUE='#'
-  TEST_FALSE=
-fi
-
-
 # Check whether --enable-pie was given.
 if test "${enable_pie+set}" = set; then :
   enableval=$enable_pie;
@@ -12399,6 +12485,7 @@ if test -n "$GLIB_CFLAGS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.28" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -12415,6 +12502,7 @@ if test -n "$GLIB_LIBS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.28" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -12434,9 +12522,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.28" 2>&1`
+               GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.28" 2>&1`
         else
-               GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.28" 2>&1`
+               GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.28" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$GLIB_PKG_ERRORS" >&5
@@ -12475,6 +12563,7 @@ if test -n "$GTHREAD_CFLAGS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_GTHREAD_CFLAGS=`$PKG_CONFIG --cflags "gthread-2.0 >= 2.16" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -12491,6 +12580,7 @@ if test -n "$GTHREAD_LIBS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_GTHREAD_LIBS=`$PKG_CONFIG --libs "gthread-2.0 >= 2.16" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -12510,9 +12600,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               GTHREAD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gthread-2.0 >= 2.16" 2>&1`
+               GTHREAD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gthread-2.0 >= 2.16" 2>&1`
         else
-               GTHREAD_PKG_ERRORS=`$PKG_CONFIG --print-errors "gthread-2.0 >= 2.16" 2>&1`
+               GTHREAD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gthread-2.0 >= 2.16" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$GTHREAD_PKG_ERRORS" >&5
@@ -12548,6 +12638,7 @@ if test -n "$DBUS_CFLAGS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 1.4" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -12564,6 +12655,7 @@ if test -n "$DBUS_LIBS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 1.4" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -12583,9 +12675,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "dbus-1 >= 1.4" 2>&1`
+               DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-1 >= 1.4" 2>&1`
         else
-               DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors "dbus-1 >= 1.4" 2>&1`
+               DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-1 >= 1.4" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$DBUS_PKG_ERRORS" >&5
@@ -12656,43 +12748,59 @@ else
 fi
 
 
-# Check whether --enable-udev was given.
-if test "${enable_udev+set}" = set; then :
-  enableval=$enable_udev; enable_udev=${enableval}
+# Check whether --enable-test was given.
+if test "${enable_test+set}" = set; then :
+  enableval=$enable_test; enable_test=${enableval}
 fi
 
-if (test "${enable_udev}" != "no"); then
+ if test "${enable_test}" = "yes"; then
+  TEST_TRUE=
+  TEST_FALSE='#'
+else
+  TEST_TRUE='#'
+  TEST_FALSE=
+fi
+
+
+# Check whether --enable-tools was given.
+if test "${enable_tools+set}" = set; then :
+  enableval=$enable_tools; enable_tools=${enableval}
+fi
+
+if (test "${enable_tools}" = "yes"); then
 
 pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UDEV" >&5
-$as_echo_n "checking for UDEV... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for USB" >&5
+$as_echo_n "checking for USB... " >&6; }
 
-if test -n "$UDEV_CFLAGS"; then
-    pkg_cv_UDEV_CFLAGS="$UDEV_CFLAGS"
+if test -n "$USB_CFLAGS"; then
+    pkg_cv_USB_CFLAGS="$USB_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 143\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "libudev >= 143") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libusb-1.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libusb-1.0") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_UDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev >= 143" 2>/dev/null`
+  pkg_cv_USB_CFLAGS=`$PKG_CONFIG --cflags "libusb-1.0" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
  else
     pkg_failed=untried
 fi
-if test -n "$UDEV_LIBS"; then
-    pkg_cv_UDEV_LIBS="$UDEV_LIBS"
+if test -n "$USB_LIBS"; then
+    pkg_cv_USB_LIBS="$USB_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 143\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "libudev >= 143") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libusb-1.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libusb-1.0") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_UDEV_LIBS=`$PKG_CONFIG --libs "libudev >= 143" 2>/dev/null`
+  pkg_cv_USB_LIBS=`$PKG_CONFIG --libs "libusb-1.0" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -12712,81 +12820,90 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               UDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libudev >= 143" 2>&1`
+               USB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libusb-1.0" 2>&1`
         else
-               UDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors "libudev >= 143" 2>&1`
+               USB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libusb-1.0" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
-       echo "$UDEV_PKG_ERRORS" >&5
+       echo "$USB_PKG_ERRORS" >&5
 
-       as_fn_error $? "libudev >= 143 is required" "$LINENO" 5
+       as_fn_error $? "USB library is required" "$LINENO" 5
 elif test $pkg_failed = untried; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-       as_fn_error $? "libudev >= 143 is required" "$LINENO" 5
+       as_fn_error $? "USB library is required" "$LINENO" 5
 else
-       UDEV_CFLAGS=$pkg_cv_UDEV_CFLAGS
-       UDEV_LIBS=$pkg_cv_UDEV_LIBS
+       USB_CFLAGS=$pkg_cv_USB_CFLAGS
+       USB_LIBS=$pkg_cv_USB_LIBS
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-       enable_udev="yes"
+       dummy=yes
 fi
-       UDEV_DATADIR="`$PKG_CONFIG --variable=udevdir udev`"
-       if (test -z "${UDEV_DATADIR}"); then
-               UDEV_DATADIR="${sysconfdir}/udev/rules.d"
-       else
-               UDEV_DATADIR="${UDEV_DATADIR}/rules.d"
-       fi
+
 
 fi
+ if test "${enable_tools}" = "yes"; then
+  TOOLS_TRUE=
+  TOOLS_FALSE='#'
+else
+  TOOLS_TRUE='#'
+  TOOLS_FALSE=
+fi
 
 
- if test "${enable_udev}" = "yes"; then
-  UDEV_TRUE=
-  UDEV_FALSE='#'
+# Check whether --enable-dundee was given.
+if test "${enable_dundee+set}" = set; then :
+  enableval=$enable_dundee; enable_dundee=${enableval}
+fi
+
+ if test "${enable_dundee}" = "yes"; then
+  DUNDEE_TRUE=
+  DUNDEE_FALSE='#'
 else
-  UDEV_TRUE='#'
-  UDEV_FALSE=
+  DUNDEE_TRUE='#'
+  DUNDEE_FALSE=
 fi
 
 
-# Check whether --enable-tools was given.
-if test "${enable_tools+set}" = set; then :
-  enableval=$enable_tools; enable_tools=${enableval}
+# Check whether --enable-udev was given.
+if test "${enable_udev+set}" = set; then :
+  enableval=$enable_udev; enable_udev=${enableval}
 fi
 
-if (test "${enable_tools}" = "yes"); then
+if (test "${enable_udev}" != "no"); then
 
 pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for USB" >&5
-$as_echo_n "checking for USB... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UDEV" >&5
+$as_echo_n "checking for UDEV... " >&6; }
 
-if test -n "$USB_CFLAGS"; then
-    pkg_cv_USB_CFLAGS="$USB_CFLAGS"
+if test -n "$UDEV_CFLAGS"; then
+    pkg_cv_UDEV_CFLAGS="$UDEV_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libusb-1.0\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "libusb-1.0") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 143\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libudev >= 143") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_USB_CFLAGS=`$PKG_CONFIG --cflags "libusb-1.0" 2>/dev/null`
+  pkg_cv_UDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev >= 143" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
  else
     pkg_failed=untried
 fi
-if test -n "$USB_LIBS"; then
-    pkg_cv_USB_LIBS="$USB_LIBS"
+if test -n "$UDEV_LIBS"; then
+    pkg_cv_UDEV_LIBS="$UDEV_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libusb-1.0\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "libusb-1.0") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 143\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libudev >= 143") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_USB_LIBS=`$PKG_CONFIG --libs "libusb-1.0" 2>/dev/null`
+  pkg_cv_UDEV_LIBS=`$PKG_CONFIG --libs "libudev >= 143" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -12806,48 +12923,41 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               USB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libusb-1.0" 2>&1`
+               UDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev >= 143" 2>&1`
         else
-               USB_PKG_ERRORS=`$PKG_CONFIG --print-errors "libusb-1.0" 2>&1`
+               UDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev >= 143" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
-       echo "$USB_PKG_ERRORS" >&5
+       echo "$UDEV_PKG_ERRORS" >&5
 
-       as_fn_error $? "USB library is required" "$LINENO" 5
+       as_fn_error $? "libudev >= 143 is required" "$LINENO" 5
 elif test $pkg_failed = untried; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-       as_fn_error $? "USB library is required" "$LINENO" 5
+       as_fn_error $? "libudev >= 143 is required" "$LINENO" 5
 else
-       USB_CFLAGS=$pkg_cv_USB_CFLAGS
-       USB_LIBS=$pkg_cv_USB_LIBS
+       UDEV_CFLAGS=$pkg_cv_UDEV_CFLAGS
+       UDEV_LIBS=$pkg_cv_UDEV_LIBS
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-       dummy=yes
+       enable_udev="yes"
 fi
+       UDEV_DATADIR="`$PKG_CONFIG --variable=udevdir udev`"
+       if (test -z "${UDEV_DATADIR}"); then
+               UDEV_DATADIR="${sysconfdir}/udev/rules.d"
+       else
+               UDEV_DATADIR="${UDEV_DATADIR}/rules.d"
+       fi
 
-
-fi
- if test "${enable_tools}" = "yes"; then
-  TOOLS_TRUE=
-  TOOLS_FALSE='#'
-else
-  TOOLS_TRUE='#'
-  TOOLS_FALSE=
 fi
 
 
-# Check whether --enable-dundee was given.
-if test "${enable_dundee+set}" = set; then :
-  enableval=$enable_dundee; enable_dundee=${enableval}
-fi
-
- if test "${enable_dundee}" = "yes"; then
-  DUNDEE_TRUE=
-  DUNDEE_FALSE='#'
+ if test "${enable_udev}" = "yes"; then
+  UDEV_TRUE=
+  UDEV_FALSE='#'
 else
-  DUNDEE_TRUE='#'
-  DUNDEE_FALSE=
+  UDEV_TRUE='#'
+  UDEV_FALSE=
 fi
 
 
@@ -12943,6 +13053,7 @@ if test -n "$BLUEZ_CFLAGS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_BLUEZ_CFLAGS=`$PKG_CONFIG --cflags "bluez >= 4.99" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -12959,6 +13070,7 @@ if test -n "$BLUEZ_LIBS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_BLUEZ_LIBS=`$PKG_CONFIG --libs "bluez >= 4.99" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -12978,9 +13090,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               BLUEZ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "bluez >= 4.99" 2>&1`
+               BLUEZ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bluez >= 4.99" 2>&1`
         else
-               BLUEZ_PKG_ERRORS=`$PKG_CONFIG --print-errors "bluez >= 4.99" 2>&1`
+               BLUEZ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bluez >= 4.99" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$BLUEZ_PKG_ERRORS" >&5
@@ -13047,6 +13159,7 @@ $as_echo_n "checking for mobile-broadband-provider-info... " >&6; }
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_PROVIDER_DATABASE=`$PKG_CONFIG --variable=database "mobile-broadband-provider-info" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -13254,16 +13367,12 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
   as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${TEST_TRUE}" && test -z "${TEST_FALSE}"; then
-  as_fn_error $? "conditional \"TEST\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${SYSTEMD_TRUE}" && test -z "${SYSTEMD_FALSE}"; then
   as_fn_error $? "conditional \"SYSTEMD\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${UDEV_TRUE}" && test -z "${UDEV_FALSE}"; then
-  as_fn_error $? "conditional \"UDEV\" was never defined.
+if test -z "${TEST_TRUE}" && test -z "${TEST_FALSE}"; then
+  as_fn_error $? "conditional \"TEST\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${TOOLS_TRUE}" && test -z "${TOOLS_FALSE}"; then
@@ -13274,6 +13383,10 @@ if test -z "${DUNDEE_TRUE}" && test -z "${DUNDEE_FALSE}"; then
   as_fn_error $? "conditional \"DUNDEE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${UDEV_TRUE}" && test -z "${UDEV_FALSE}"; then
+  as_fn_error $? "conditional \"UDEV\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${ATMODEM_TRUE}" && test -z "${ATMODEM_FALSE}"; then
   as_fn_error $? "conditional \"ATMODEM\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -13604,16 +13717,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -13673,28 +13786,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -13715,8 +13816,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by ofono $as_me 1.11, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+This file was extended by ofono $as_me 1.12, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -13781,11 +13882,11 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-ofono config.status 1.11
-configured by $0, generated by GNU Autoconf 2.68,
+ofono config.status 1.12
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -13876,7 +13977,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -13918,6 +14019,7 @@ pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
 enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
 SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
 ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
 host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
 host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
 host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
@@ -14000,7 +14102,6 @@ with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
 allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
 no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
 hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
 hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
 hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
 hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
@@ -14056,6 +14157,7 @@ _LTECHO_EOF'
 # Quote evaled strings.
 for var in SHELL \
 ECHO \
+PATH_SEPARATOR \
 SED \
 GREP \
 EGREP \
@@ -14106,7 +14208,6 @@ with_gnu_ld \
 allow_undefined_flag \
 no_undefined_flag \
 hardcode_libdir_flag_spec \
-hardcode_libdir_flag_spec_ld \
 hardcode_libdir_separator \
 exclude_expsyms \
 include_expsyms \
@@ -14906,8 +15007,8 @@ $as_echo X"$file" |
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 #
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-#                 Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 #   This file is part of GNU Libtool.
@@ -14961,6 +15062,9 @@ SHELL=$lt_SHELL
 # An echo program that protects backslashes.
 ECHO=$lt_ECHO
 
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
 # The host system.
 host_alias=$host_alias
 host=$host
@@ -15262,10 +15366,6 @@ no_undefined_flag=$lt_no_undefined_flag
 # This must work even if \$libdir does not exist
 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
 
-# If ld is used when linking, flag to hardcode \$libdir into a binary
-# during linking.  This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator
 
index 2d6247d..450352b 100644 (file)
@@ -1,5 +1,5 @@
 AC_PREREQ(2.60)
-AC_INIT(ofono, 1.11)
+AC_INIT(ofono, 1.12)
 
 AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
 AM_CONFIG_HEADER(config.h)
@@ -22,7 +22,7 @@ AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_CC_PIE
 AC_PROG_INSTALL
-AM_PROG_MKDIR_P
+AC_PROG_MKDIR_P
 
 m4_define([_LT_AC_TAGCONFIG], [])
 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
@@ -45,10 +45,6 @@ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
        fi
 ])
 
-AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
-               [enable test/example scripts]), [enable_test=${enableval}])
-AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
-
 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
                        [enable position independent executables flag]), [
        if (test "${enableval}" = "yes" &&
@@ -114,8 +110,26 @@ if (test -n "${path_systemdunit}"); then
 fi
 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
 
+AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
+               [enable test/example scripts]), [enable_test=${enableval}])
+AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
+
+AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
+               [enable testing tools]), [enable_tools=${enableval}])
+if (test "${enable_tools}" = "yes"); then
+       PKG_CHECK_MODULES(USB, libusb-1.0, dummy=yes,
+                               AC_MSG_ERROR(USB library is required))
+       AC_SUBST(USB_CFLAGS)
+       AC_SUBST(USB_LIBS)
+fi
+AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
+
+AC_ARG_ENABLE(dundee, AC_HELP_STRING([--enable-dundee],
+               [enable dialup deamon support]), [enable_dundee=${enableval}])
+AM_CONDITIONAL(DUNDEE, test "${enable_dundee}" = "yes")
+
 AC_ARG_ENABLE(udev, AC_HELP_STRING([--disable-udev],
-                       [don't use udev support even if available]),
+                       [disable udev modem detection support]),
                                                [enable_udev=${enableval}])
 if (test "${enable_udev}" != "no"); then
        PKG_CHECK_MODULES(UDEV, libudev >= 143, [enable_udev="yes"],
@@ -132,20 +146,6 @@ AC_SUBST(UDEV_CFLAGS)
 AC_SUBST(UDEV_LIBS)
 AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
 
-AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
-               [enable testing tools]), [enable_tools=${enableval}])
-if (test "${enable_tools}" = "yes"); then
-       PKG_CHECK_MODULES(USB, libusb-1.0, dummy=yes,
-                               AC_MSG_ERROR(USB library is required))
-       AC_SUBST(USB_CFLAGS)
-       AC_SUBST(USB_LIBS)
-fi
-AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
-
-AC_ARG_ENABLE(dundee, AC_HELP_STRING([--enable-dundee],
-               [enable DUN deamon support]), [enable_dundee=${enableval}])
-AM_CONDITIONAL(DUNDEE, test "${enable_dundee}" = "yes")
-
 AC_ARG_ENABLE(atmodem, AC_HELP_STRING([--disable-atmodem],
                                [disable ETSI AT modem support]),
                                        [enable_atmodem=${enableval}])
diff --git a/depcomp b/depcomp
index df8eea7..25a39e6 100755 (executable)
--- a/depcomp
+++ b/depcomp
@@ -1,10 +1,10 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-03-27.16; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
+# 2011, 2012 Free Software Foundation, Inc.
 
 # 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
@@ -28,7 +28,7 @@ scriptversion=2009-04-28.21; # UTC
 
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
      exit 1;
      ;;
   -h | --h*)
@@ -40,11 +40,11 @@ as side-effects.
 
 Environment variables:
   depmode     Dependency tracking mode.
-  source      Source file read by `PROGRAMS ARGS'.
-  object      Object file output by `PROGRAMS ARGS'.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
   DEPDIR      directory where to store dependencies.
   depfile     Dependency file to output.
-  tmpdepfile  Temporary file to use when outputing dependencies.
+  tmpdepfile  Temporary file to use when outputting dependencies.
   libtool     Whether libtool is used (yes/no).
 
 Report bugs to <bug-automake@gnu.org>.
@@ -57,6 +57,12 @@ EOF
     ;;
 esac
 
+# A tabulation character.
+tab='  '
+# A newline character.
+nl='
+'
+
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
   exit 1
@@ -90,10 +96,24 @@ if test "$depmode" = msvcmsys; then
    # This is just like msvisualcpp but w/o cygpath translation.
    # Just convert the backslash-escaped backslashes to single forward
    # slashes to satisfy depend.m4
-   cygpath_u="sed s,\\\\\\\\,/,g"
+   cygpath_u='sed s,\\\\,/,g'
    depmode=msvisualcpp
 fi
 
+if test "$depmode" = msvc7msys; then
+   # This is just like msvc7 but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u='sed s,\\\\,/,g'
+   depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+   # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
+   gccflag=-qmakedep=gcc,-MF
+   depmode=gcc
+fi
+
 case "$depmode" in
 gcc3)
 ## gcc 3 implements dependency tracking that does exactly what
@@ -148,20 +168,21 @@ gcc)
 ## The second -e expression handles DOS-style file names with drive letters.
   sed -e 's/^[^:]*: / /' \
       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
+## This next piece of magic avoids the "deleted header file" problem.
 ## The problem is that when a header file which appears in a .P file
 ## is deleted, the dependency causes make to die (because there is
 ## typically no way to rebuild the header).  We avoid this by adding
 ## dummy dependencies for each header file.  Too bad gcc doesn't do
 ## this for us directly.
-  tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'.  On the theory
+  tr ' ' "$nl" < "$tmpdepfile" |
+## Some versions of gcc put a space before the ':'.  On the theory
 ## that the space means something, we add a space to the output as
-## well.
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+      | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -193,18 +214,15 @@ sgi)
     # clever and replace this with sed code, as IRIX sed won't handle
     # lines with more than a fixed number of characters (4096 in
     # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
-    # the IRIX cc adds comments like `#:fec' to the end of the
+    # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
-    tr ' ' '
-' < "$tmpdepfile" \
+    tr ' ' "$nl" < "$tmpdepfile" \
     | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr '
-' ' ' >> "$depfile"
+    tr "$nl" ' ' >> "$depfile"
     echo >> "$depfile"
 
     # The second pass generates a dummy entry for each header file.
-    tr ' ' '
-' < "$tmpdepfile" \
+    tr ' ' "$nl" < "$tmpdepfile" \
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
    >> "$depfile"
   else
@@ -216,10 +234,17 @@ sgi)
   rm -f "$tmpdepfile"
   ;;
 
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 aix)
   # The C for AIX Compiler uses -M and outputs the dependencies
   # in a .u file.  In older versions, this file always lives in the
-  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
@@ -249,12 +274,11 @@ aix)
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    # Each line is of the form `foo.o: dependent.h'.
+    # Each line is of the form 'foo.o: dependent.h'.
     # Do two passes, one to just change these to
-    # `$object: dependent.h' and one to simply `dependent.h:'.
+    # '$object: dependent.h' and one to simply 'dependent.h:'.
     sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    # That's a tab and a space in the [].
-    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+    sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -265,23 +289,26 @@ aix)
   ;;
 
 icc)
-  # Intel's C compiler understands `-MD -MF file'.  However on
-  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
+  # However on
+  #    $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
   # ICC 7.0 will fill foo.d with something like
   #    foo.o: sub/foo.c
   #    foo.o: sub/foo.h
-  # which is wrong.  We want:
+  # which is wrong.  We want
   #    sub/foo.o: sub/foo.c
   #    sub/foo.o: sub/foo.h
   #    sub/foo.c:
   #    sub/foo.h:
   # ICC 7.1 will output
   #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using :
+  # and will wrap long lines using '\':
   #    foo.o: sub/foo.c ... \
   #     sub/foo.h ... \
   #     ...
-
+  # tcc 0.9.26 (FIXME still under development at the moment of writing)
+  # will emit a similar output, but also prepend the continuation lines
+  # with horizontal tabulation characters.
   "$@" -MD -MF "$tmpdepfile"
   stat=$?
   if test $stat -eq 0; then :
@@ -290,15 +317,21 @@ icc)
     exit $stat
   fi
   rm -f "$depfile"
-  # Each line is of the form `foo.o: dependent.h',
-  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Each line is of the form 'foo.o: dependent.h',
+  # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
   # Do two passes, one to just change these to
-  # `$object: dependent.h' and one to simply `dependent.h:'.
-  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
-  # Some versions of the HPUX 10.20 sed can't process this invocation
-  # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
-    sed -e 's/$/ :/' >> "$depfile"
+  # '$object: dependent.h' and one to simply 'dependent.h:'.
+  sed -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
+    < "$tmpdepfile" > "$depfile"
+  sed '
+    s/[ '"$tab"'][ '"$tab"']*/ /g
+    s/^ *//
+    s/ *\\*$//
+    s/^[^:]*: *//
+    /^$/d
+    /:$/d
+    s/$/ :/
+  ' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -334,7 +367,7 @@ hp2)
   done
   if test -f "$tmpdepfile"; then
     sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
+    # Add 'dependent.h:' lines.
     sed -ne '2,${
               s/^ *//
               s/ \\*$//
@@ -349,9 +382,9 @@ hp2)
 
 tru64)
    # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
    # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in `foo.d' instead, so we check for that too.
+   # dependencies in 'foo.d' instead, so we check for that too.
    # Subdirectories are respected.
    dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
    test "x$dir" = "x$object" && dir=
@@ -397,14 +430,59 @@ tru64)
    done
    if test -f "$tmpdepfile"; then
       sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      # That's a tab and a space in the [].
-      sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+      sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    else
       echo "#dummy" > "$depfile"
    fi
    rm -f "$tmpdepfile"
    ;;
 
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test "$stat" = 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 #nosideeffect)
   # This comment above is used by automake to tell side-effect
   # dependency tracking mechanisms from slower ones.
@@ -422,7 +500,7 @@ dashmstdout)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -442,15 +520,14 @@ dashmstdout)
   done
 
   test -z "$dashmflag" && dashmflag=-M
-  # Require at least two characters before searching for `:'
+  # Require at least two characters before searching for ':'
   # in the target name.  This is to cope with DOS-style filenames:
-  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+    sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' '
-' < "$tmpdepfile" | \
+  tr ' ' "$nl" < "$tmpdepfile" | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
@@ -503,9 +580,10 @@ makedepend)
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
@@ -525,7 +603,7 @@ cpp)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -594,8 +672,8 @@ msvisualcpp)
   sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
-  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
   sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
diff --git a/doc/assisted-satellite-navigation-api.txt b/doc/assisted-satellite-navigation-api.txt
deleted file mode 100644 (file)
index 296fde8..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-Assisted Satellite Navigation hierarchy [experimental]
-==========================================================
-
-Service                org.ofono
-Interface      org.ofono.AssistedSatelliteNavigation
-Object path    [variable prefix]/{modem0,modem1,...}
-
-Methods                void SendPositioningElement(string xml_element)
-
-                       Send an XML element conforming to the XML DTD for <pos>
-                       as defined in 3GPP 27.007 Table 8.55-2. This xml is
-                       used for transferring data associated with positioning
-                       requests received via control plane from the network.
-                       This includes assistance data requests and the results
-                       of positioning procedures. This method maps directly to
-                       the 3GPP 27.007 AT+CPOS command.
-
-               void RegisterPositioningRequestAgent(object path)
-
-                       Registers an agent which will be called whenever a
-                       CPOSR AT response is received. The Agent must respond
-                       to requests using SendPositioningElement.
-
-               void UnregisterPositioningRequestAgent(object path)
-
-                       Un-registers the agent.
-
-PositioningRequestAgent hierarchy
-==================================
-
-Service                unique name
-Interface      org.ofono.PositioningRequestAgent
-Object path    freely definable
-
-Methods                void Request(string xml_element)
-
-                       Receive an XML element conforming to the XML DTD for
-                       <pos> in 3GPP 27.007. This xml is used for transferring
-                       data associated with positioning requests received, via
-                       control plane, from the network. This includes
-                       measurement requests and assistance data. This method
-                       maps directly to the 3GPP defined +CPOSR unsolicited
-                       result code.
-
-               void ResetAssistanceData()
-
-                       A request has been received from the network that all
-                       assistance data should be reset.  This is used for 3gpp
-                       performance tests.
-
-               void Release()
-
-                       Agent is being released, possibly because of oFono
-                       terminating, AssistedSatelliteNavigation interface
-                       is being torn down or modem off.
-                       No UnregisterPositioningRequestAgent call is needed.
diff --git a/doc/cdma-connman-api.txt b/doc/cdma-connman-api.txt
deleted file mode 100644 (file)
index 48699a3..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-CDMA Connection Manager hierarchy [experimental]
-=================================
-
-Service                org.ofono
-Interface      org.ofono.cdma.ConnectionManager
-Object path    [variable]
-
-Methods                dict GetProperties()
-
-                       Returns all global system properties. See the
-                       properties section for available properties.
-
-                       Possible Errors: [service].Error.InvalidArguments
-
-               void SetProperty(string property, variant value)
-
-                       Sets the property to a desired value
-
-                       Possible Errors: [service].Error.InvalidArguments
-                                        [service].Error.InvalidFormat
-                                        [service].Error.Failed
-
-Signals                PropertyChanged(string property, variant value)
-
-                       This signal indicates a changed value of the given
-                       property.
-
-Properties     boolean Powered [readwrite]
-
-                       Controls whether the CDMA data connection is
-                       enabled.
-
-               boolean Dormant [readonly]
-
-                       Contains whether the connection is dormant.  Will
-                       always be false if the connection is not powered.
-
-               string Username [readwrite]
-
-                       Holds the username to be used for authentication
-                       purposes.
-
-               string Password [readwrite]
-
-                       Holds the password to be used for authentication
-                       purposes.
-
-               dict Settings [readonly, optional]
-
-                       Holds all the IP network settings
-
-                       string Interface [readonly, optional]
-
-                               Holds the interface of the network interface
-                               used by this context (e.g. "ppp0" "usb0")
-
-                       string Method [readonly, optional]
-
-                               Holds the IP network config method
-                                       "static"- Set IP network statically
-                                       "dhcp"  - Set IP network through DHCP
-
-                       string Address [readonly, optional]
-
-                               Holds the IP address for this context.
-
-                       string Netmask [readonly, optional]
-
-                               Holds the Netmask for this context.
-
-                       array{string} DomainNameServers [readonly, optional]
-
-                               Holds the list of domain name servers for this
-                               context.
-
-                       string Gateway [readonly, optional]
-
-                               Holds the gateway IP for this connection.
diff --git a/doc/cdma-messagemanager-api.txt b/doc/cdma-messagemanager-api.txt
deleted file mode 100644 (file)
index 8e6b9ea..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-CDMA Message Manager hierarchy [experimental]
-==============================
-
-Service                org.ofono
-Interface      org.ofono.cdma.MessageManager
-Object path    [variable prefix]/{modem0,modem1,...}
-
-Methods                dict GetProperties()
-
-                       Returns properties for the manager object. See
-                       the properties section for available properties.
-
-                       Possible Errors: [service].Error.InvalidArguments
-
-               array{object,dict} GetMessages()
-
-                       Get an array of message object paths and properties
-                       that represents the currently pending messages.
-
-                       This method call should only be used once when an
-                       application starts up.  Further message additions
-                       and removal shall be monitored via MessageAdded and
-                       MessageRemoved signals.
-
-               void SetProperty(string name, variant value)
-
-                       Changes the value of the specified property. Only
-                       properties that are listed as readwrite are
-                       changeable. On success a PropertyChanged signal
-                       will be emitted.
-
-                       Possible Errors: [service].Error.InvalidArguments
-                                        [service].Error.DoesNotExist
-
-               object SendMessage(dict message_info)
-
-                       The dictionary can contain the following keys:
-
-                       string "To" - Address of the receiver
-
-                       string "Text" - The text to send
-
-                       string "Priority" - The value can be one of:
-                               "normal",
-                               "interactive",
-                               "urgent",
-                               "emergency",
-
-                       TODO: Figure out where this is really needed
-
-                       string "Privacy" - The value can be one of:
-                               "not restricted",
-                               "restricted",
-                               "confidential",
-                               "secret"
-
-                       TODO: Figure out where this is really needed
-
-                       If the message could be queued successfully, this
-                       method returns an object path to the created Message
-                       object.
-
-Signals                PropertyChanged(string name, variant value)
-
-                       This signal indicates a changed value of the given
-                       property.
-
-               ImmediateMessage(string message, dict info)
-
-                       New immediate SMS received. Info has Sender,
-                       LocalSentTime, SentTime, Priority, Privacy and
-                       CallbackNumber information.  Sender address is given
-                       in string format.  LocalSentTime and SentTime are
-                       given in string form using ISO8601 format.
-
-               IncomingMessage(string message, dict info)
-
-                       New incoming text SMS received. Info has Sender,
-                       LocalSentTime, SentTime, Priority, Privacy, and
-                       CallbackNumber.
-
-               MessageAdded(object path, dict properties)
-
-                       This signal is emitted whenever a new Message object
-                       has been created.
-
-               MessageRemoved(object path)
-
-                       This signal is emitted whenever a Message object
-                       has been removed, e.g. when it reaches a final state.
-
-Properties     boolean UseDeliveryAcknowledgement
-
-                       Request to be notified when the SMSC has delivered
-                       the message to the receiving user.  In effect this
-                       is the same as the GSM Status Report.
-
-               boolean UseUserAcknowledgement
-
-                       Request to be notified when the receiving user has
-                       acknowledged the message.
-
-               boolean UseReadAcknowledgement
-
-                       Request to be notified when the receiving User has
-                       read the message.
-
-               string CallbackNumber
-
-                       The call back number for the user.  If the number is
-                       empty, then the optional field is not included
-                       in the encoded PDU.
diff --git a/doc/cdma-network-api.txt b/doc/cdma-network-api.txt
deleted file mode 100644 (file)
index 62da5d8..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-CDMA Network registration hierarchy [experimental]
-===================================
-
-Service                org.ofono
-Interface      org.ofono.cdma.NetworkRegistration
-Object path    [variable prefix]/{modem0,modem1,...}
-
-Methods                dict GetProperties()
-
-                       Returns all network registration properties. See the
-                       properties section for available properties.
-
-                       Possible Errors: [service].Error.InvalidArguments
-
-               void SetProperty(string name, variant value)
-
-                       Changes the value of the specified property. Only
-                       properties that are listed as readwrite are
-                       changeable. On success a PropertyChanged signal
-                       will be emitted.
-
-                       Possible Errors: [service].Error.InvalidArguments
-                                        [service].Error.DoesNotExist
-
-Signals                PropertyChanged(string property, variant value)
-
-                       This signal indicates a changed value of the given
-                       property.
-
-Properties     string Status [readonly]
-
-                       The current registration status of a modem.
-
-                       The possible values are:
-                               "unregistered"  Not registered
-                               "registered"    Registered to home network
-                               "roaming"       Roaming
-
-               byte Strength [readonly]
-
-                       Contains the current signal strength as a percentage
-                       between 0-100 percent.
-
-               byte DataStrength [readonly]
-
-                       Contains the current signal strength of the High Data
-                       Rate network.  This is a percentage value between
-                       0-100 percent.
-
-               uint16 SystemIdentifier [readonly, optional]
-
-                       Contains the system identifier of the currently
-                       selected network.
-
-               uint16 NetworkIdentifier [readonly, optional]
-
-                       Contains the network identifier of the currently
-                       selected network.
-
-               uint16 MobileCountryCode [readonly, optional]
-
-                       Contains the Mobile Country Code (MCC).
-
-               uint16 MobileNetworkCode [readonly, optional]
-
-                       Contains the Mobile Network Code (MNC).
-
-               string Name [readonly, optional]
-
-                       Contains the name of the current network.
-
-               string RoamingPreference [readwrite]
-
-                       Contains the roaming preference used in the network
-                       selection.
-
-                       The possible values are:
-                               "home"        Home networks only
-                               "roamonly"    Roaming networks only
-                               "affiliated"  Affiliated networks only
-                               "any"         Any network
diff --git a/doc/cdma-voicecall-manager-api.txt b/doc/cdma-voicecall-manager-api.txt
deleted file mode 100644 (file)
index 535909a..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-CDMA VoiceCallManager hierarchy [experimental]
-===============================
-
-Service                org.ofono
-Interface      org.ofono.cdma.VoiceCallManager
-Object path    [variable prefix]/{modem0,modem1,...}
-
-Methods                dict GetProperties()
-
-                       Returns properties for the VoiceCallManager Interface.
-                       See the properties section for available properties.
-
-               void Dial(string number)
-
-                       Initiates a new outgoing call.  This is usually
-                       implemented using the ATD AT command.
-
-                       Possible Errors: [service].Error.InProgress
-                                        [service].Error.InvalidArguments
-                                        [service].Error.InvalidFormat
-                                        [service].Error.NotImplemented
-                                        [service].Error.Failed
-
-               void Hangup()
-
-                       Hangup all active calls.
-
-                       Possible Errors: [service].Error.InProgress
-                                        [service].Error.NotImplemented
-                                        [service].Error.Failed
-
-               void Answer()
-
-                       Answer the incoming call.  This only affects the
-                       incoming call.
-
-               void SendFlash(string flash_string)
-
-                       Sends the flash string to the network.
-
-               void SendTones(string tones)
-
-                       Sends the DTMF tones to the network.  The tones have
-                       a fixed duration.  Tones can be one of: '0' - '9',
-                       '*', '#', 'A', 'B', 'C', 'D'.  The last four are
-                       typically not used in normal circumstances.
-
-               void SetProperty(string property, variant value)
-
-                       Changes the value of the specified property. Only
-                       properties that are listed as readwrite are
-                       changeable. On success a PropertyChanged signal
-                       will be emitted.
-
-                       Possible Errors: [service].Error.InvalidArguments
-                                        [service].Error.DoesNotExist
-
-Signals                PropertyChanged(string property, variant value)
-
-                       Signal is emitted whenever a property has changed.
-                       The new value is passed as the signal argument.
-
-               DisconnectReason(string reason)
-
-                       This signal is emitted when the modem manager can
-                       provide extra information about why the call was
-                       released. The possible reason values are:
-                               "local" - The call was release due to local
-                                               user action
-                               "remote" - Remote party released the call
-                               "network" - Network released the call, most
-                                               likely due to low signal or
-                                               other network failure
-
-                       Not all implementations are able to provide this
-                       information, so applications should treat the emission
-                       of this signal as optional. This signal will be
-                       emitted before the PropertyChanged signal.
-
-Properties     string State [readonly]
-
-                       Contains the state of the current call.  The state
-                       can be one of:
-                               - "active" - The call is active
-                               - "dialing" - The call is being dialed
-                               - "alerting" - The remote party is being alerted
-                               - "incoming" - Incoming call in progress
-                               - "disconnected" - No call is connected
-
-               boolean CallWaiting [readonly]
-
-                       Contains whether a call is waiting.
-
-               string CallWaitingNumber [readonly, optional]
-
-                       Contains the call waiting number.
-
-               string ToneDuration [readwrite]
-
-                       Contains the length of the DTMF tone duration.  The
-                       currently supported values are:
-                               "short",
-                               "long"
-
-               string LineIdentification [readonly]
-
-                       Contains the Line Identification information returned
-                       by the network, if present. For incoming calls this is
-                       effectively the CLIP. For outgoing calls this attribute
-                       will hold the dialed number.
-
-                       Please note that after sending flash this property
-                       will be empty.
-
-               string StartTime [readonly, optional]
-
-                       Contains the starting time of the call.  The time is
-                       stamped when the call enters the "active" state.
-                       Client applications can use this to infer somewhat
-                       reliable call duration information.
-
-                       Please note that after sending Flash, there will not be
-                       any StartTime property change for the Flash
-                       string/number.
diff --git a/doc/coding-style.txt b/doc/coding-style.txt
deleted file mode 100644 (file)
index 287e9e9..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-Every project has its coding style, and oFono is not an exception. This
-document describes the preferred coding style for oFono code, in order to keep
-some level of consistency among developers so that code can be easily
-understood and maintained, and also to help your code survive under
-maintainer's fastidious eyes so that you can get a passport for your patch
-ASAP.
-
-First of all, oFono coding style must follow every rule for Linux kernel
-(http://www.kernel.org/doc/Documentation/CodingStyle). There also exists a tool
-named checkpatch.pl to help you check the compliance with it. Just type
-"checkpatch.pl --no-tree patch_name" to check your patch. In theory, you need
-to clean up all the warnings and errors except this one: "ERROR: Missing
-Signed-off-by: line(s)". oFono does not used Signed-Off lines, so including
-them is actually an error.  In certain circumstances one can ignore the 80
-character per line limit.  This is generally only allowed if the alternative
-would make the code even less readable.
-
-Besides the kernel coding style above, oFono has special flavors for its own.
-Some of them are mandatory (marked as 'M'), while some others are optional
-(marked as 'O'), but generally preferred.
-
-M1: Blank line before and after an if/while/do/for statement
-============================================================
-There should be a blank line before if statement unless the if is nested and
-not preceded by an expression or variable declaration.
-
-Example:
-1)
-a = 1;
-if (b) {  // wrong
-
-2)
-a = 1
-
-if (b) {
-}
-a = 2; // wrong
-
-3)
-if (a) {
-       if (b)  // correct
-
-4)
-b = 2;
-
-if (a) {       // correct
-
-}
-
-b = 3;
-
-The only exception to this rule applies when a variable is being allocated:
-array = g_try_new0(int, 20);
-if (array == NULL)     // Correct
-       return;
-
-
-M2: Multiple line comment
-=========================
-If your comments have more then one line, please start it from the second line.
-
-Example:
-/*
- * first line comment  // correct
- * ...
- * last line comment
- */
-
-
-M3: Space before and after operator
-===================================
-There should be a space before and after each operator.
-
-Example:
-a + b;  // correct
-
-
-M4: Wrap long lines
-===================
-If your condition in if, while, for statement or a function declaration is too
-long to fit in one line, the new line needs to be indented not aligned with the
-body.
-
-Example:
-1)
-if (call->status == CALL_STATUS_ACTIVE ||
-       call->status == CALL_STATUS_HELD) {  // wrong
-       ofono_dbus_dict_append();
-
-2)
-if (call->status == CALL_STATUS_ACTIVE ||
-               call->status == CALL_STATUS_HELD) {  // correct
-       ofono_dbus_dict_append();
-
-3)
-gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
-       num sim_ust_service index) // wrong
-{
-       int a;
-       ...
-}
-
-4)
-gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
-                                       enum sim_ust_service index) // correct
-{
-       int a;
-       ...
-}
-
-If the line being wrapped is a function call or function declaration, the
-preferred style is to indent at least past the opening parenthesis. Indenting
-further is acceptable as well (as long as you don't hit the 80 character
-limit).
-
-If this is not possible due to hitting the 80 character limit, then indenting
-as far as possible to the right without hitting the limit is preferred.
-
-Example:
-
-1)
-gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
-               enum sim_ust_service index); // worse
-
-2)
-gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
-                                               enum sim_ust_service index);
-                                               // better
-
-M5: Git commit message 50/72 formatting
-=======================================
-The commit message header should be within 50 characters. And if you have
-detailed explanatory text, wrap it to 72 character.
-
-
-M6: Space when doing type casting
-=================================
-There should be a space between new type and variable.
-
-Example:
-1)
-a = (int *)b;  // wrong
-2)
-a = (int *) b;  // correct
-
-
-M7: Don't initialize variable unnecessarily
-===========================================
-When declaring a variable, try not to initialize it unless necessary.
-
-Example:
-int i = 1;  // wrong
-
-for (i = 0; i < 3; i++) {
-}
-
-
-M8: Use g_try_malloc instead of g_malloc
-========================================
-When g_malloc fails, the whole program would exit. Most of time, this is not
-the expected behavior, and you may want to use g_try_malloc instead.
-
-Example:
-additional = g_try_malloc(len - 1);  // correct
-if (additional == NULL)
-       return FALSE;
-
-
-M9: Follow the order of include header elements
-===============================================
-When writing an include header the various elements should be in the following
-order:
-       - #includes
-       - forward declarations
-       - #defines
-       - enums
-       - typedefs
-       - function declarations and inline function definitions
-
-
-M10: Internal headers must not use include guards
-=================================================
-Any time when creating a new header file with non-public API, that header
-must not contain include guards.
-
-
-M11: Naming of enums
-====================
-
-Enums must have a descriptive name.  The enum type should be small caps and
-it should not be typedef-ed.  Enum contents should be in CAPITAL letters and
-prefixed by the enum type name.
-
-Example:
-
-enum animal_type {
-       ANIMAL_TYPE_FOUR_LEGS,
-       ANIMAL_TYPE_EIGHT_LEGS,
-       ANIMAL_TYPE_TWO_LEGS,
-};
-
-If the enum contents have values (e.g. from specification) the formatting
-should be as follows:
-
-enum animal_type {
-       ANIMAL_TYPE_FOUR_LEGS =         4,
-       ANIMAL_TYPE_EIGHT_LEGS =        8,
-       ANIMAL_TYPE_TWO_LEGS =          2,
-};
-
-M12: Enum as switch variable
-====================
-
-If the variable of a switch is an enum, you must not include a default in
-switch body. The reason for this is: If later on you modify the enum by adding
-a new type, and forget to change the switch accordingly, the compiler will
-complain the new added type hasn't been handled.
-
-Example:
-
-enum animal_type {
-       ANIMAL_TYPE_FOUR_LEGS =         4,
-       ANIMAL_TYPE_EIGHT_LEGS =        8,
-       ANIMAL_TYPE_TWO_LEGS =          2,
-};
-
-enum animal_type t;
-
-switch (t) {
-case ANIMAL_TYPE_FOUR_LEGS:
-       ...
-       break;
-case ANIMAL_TYPE_EIGHT_LEGS:
-       ...
-       break;
-case ANIMAL_TYPE_TWO_LEGS:
-       ...
-       break;
-default:  // wrong
-       break;
-}
-
-However if the enum comes from an external header file outside ofono
-we cannot make any assumption of how the enum is defined and this
-rule might not apply.
-
-M13: Check for pointer being NULL
-=================================
-
-When checking if a pointer or a return value is NULL, explicitly compare to
-NULL rather than use the shorter check with "!" operator.
-
-Example:
-1)
-array = g_try_new0(int, 20);
-if (!array)    // Wrong
-       return;
-
-2)
-if (!g_at_chat_get_slave(chat))        // Wrong
-       return -EINVAL;
-
-3)
-array = g_try_new0(int, 20);
-if (array == NULL)     // Correct
-       return;
-
-
-M14: Always use parenthesis with sizeof
-=======================================
-The expression argument to the sizeof operator should always be in
-parenthesis, too.
-
-Example:
-1)
-memset(stuff, 0, sizeof(*stuff));
-
-2)
-memset(stuff, 0, sizeof *stuff); // Wrong
-
-
-M15: Use void if function has no parameters
-===========================================================
-A function with no parameters must use void in the parameter list.
-
-Example:
-1)
-void foo(void)
-{
-}
-
-2)
-void foo()     // Wrong
-{
-}
-
-M16: Don't use hex value with shift operators
-==============================================
-The expression argument to the shift operators should not be in hex.
-
-Example:
-
-1)
-1 << y
-
-2)
-0x1 << y       // Wrong
-
-O1: Shorten the name
-====================
-Better to use abbreviation, rather than full name, to name a variable,
-function, struct, etc.
-
-Example:
-supplementary_service  // too long
-ss  // better
-
-
-O2: Try to avoid complex if body
-================================
-It's better not to have a complicated statement for if. You may judge its
-contrary condition and return | break | continue | goto ASAP.
-
-Example:
-1)
-if (a) {  // worse
-       struct voicecall *v;
-       call = synthesize_outgoing_call(vc, vc->pending);
-       v = voicecall_create(vc, call);
-       v->detect_time = time(NULL);
-       DBG("Registering new call: %d", call->id);
-       voicecall_dbus_register(v);
-} else
-       return;
-
-2)
-if (!a)
-       return;
-
-struct voicecall *v;
-call = synthesize_outgoing_call(vc, vc->pending);
-v = voicecall_create(vc, call);
-v->detect_time = time(NULL);
-DBG("Registering new call: %d", call->id);
-voicecall_dbus_register(v);
diff --git a/doc/dialup-command-set.txt b/doc/dialup-command-set.txt
deleted file mode 100644 (file)
index c882e52..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-This document specifies the AT command set used in the bluetooth ofono plugins.
-
-Bluetooth Dial-up Networking Profile Features Description
-=========================================================
-(Ref. document: Dial-up Networking Profile - Bluetooth specification version 1.1 - 22 February 2001)
-
-- AT COMMAND SET USED:
-Commands:
-       &C      Circuit 109 (DCD) Control
-       &D      Circuit 108 (DTR) Response
-       &F      Set to Factory Defined Configuration
-       +GCAP   Request Complete Capabilities List
-       +GMI    Request Manufacturer Identification
-       +GMM    Read Model Identification
-       +GMR    Read Revision Identification
-       A       Answer Incoming Call
-       D       Dial
-       E       Command Echo
-       H       Hang Up
-       L       Monitor Speaker Loudness
-       M       Monitor Speaker Control
-       O       Return to Online Data Mode
-       P       Select Pulse Dialling
-       Q       Result Code Suppression
-       S0      Automatic Answer Control
-       S10     Automatic Disconnect Delay Control
-       S3      Command Line Termination Character
-       S4      Response Formatting Character
-       S5      Command Line Editing Character (BACKSPACE)
-       S6      Blind Dial Delay Control
-       S7      Connection Completion Timeout
-       S8      Comma Dial Modifier Delay Control
-       T       Select Tone Dialling
-       V       DCE Response Format
-       X       Call Progress Monitoring Control
-       Z       Reset to Default Configuration
-
-Result codes:
-       OK              Acknowledge execution of a command
-       CONNECT         Connection has been established
-       RING            The DCE has detected an incoming call signal from the
-                       network
-       NO CARRIER      The connection has been terminated, or attempt to
-                       establish a connection failed
-       ERROR           Error
-       NO DIALTONE     No dial-tone detected
-       BUSY            Busy signal detected
diff --git a/doc/dialup-overview.txt b/doc/dialup-overview.txt
deleted file mode 100644 (file)
index be423ee..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-DialUp Networking diagram
-=========================
-
-This diagram explains how oFono and ConnMan are interacting to handle a data
-call from a DUN client.
-
-1) GAtServer receive ATD*99#.
-2) The GAtPPP server is setup.
-3) oFono through GAtPPP notify ConnMan that he needs a TUN/TAP interface.
-4) oFono is notified that TUN/TAP interface is created and can start exchanging
-   PPP packets with DUN client. Those PPP packets are converted into IP stream
-   and transmitted to/received from TUN/TAP interface.
-5) ConnMan is selecting which interface to send IP packets (WiFi, 3G, ...).
-
-
-*----------------*            *----------------*
-|                |  ATD*99#   |                |
-|   DUN Client   |----------->|    GAtServer   |
-|                |<---*       |                |
-*----------------*    |       *----------------*
-                      |             |
-              PPP     |             | setup_ppp()
-              Packets |             |
-                      |             |
-                      |             V           Need
-                      |    *----------------*   /dev/net/tun *----------------*
-                      *--->|                |   interface    |                |
-                           |     GAtPPP     |<-------------->|     ConnMan    |
-                      *--->|                |   interface    |                |
-                      |    *----------------*   created      *----------------*
-              IP      |                                          |
-              Stream  |                                          |Create
-                      |    *------------------------*            |/dev/net/tun
-                      |    |                        |            |interface
-                      *--->|    TUN/TAP interface   |<-----------*
-                           |                        |
-                           *------------------------*
-                                      IP | Stream
-                             routed with | ConnMan rules
-                   *---------------------*--------------------*
-                   |                     |                    |
-                   |                     |                    |
-                   V                     V                    V
-            *-------------*       *-------------*      *-------------*
-            |             |       |             |      |             |
-            |  WiFi       |       |   Modem     |      |    EthX     |
-            |             |       |             |      |             |
-            *-------------*       *-------------*      *-------------*
diff --git a/doc/dundee-api.txt b/doc/dundee-api.txt
deleted file mode 100644 (file)
index 11e988d..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-
-Manager hierarchy
-=================
-
-Service                org.ofono.dundee
-Interface      org.ofono.dundee.Manager
-Object path    /
-
-Methods                array{object,dict} GetDevices()
-
-                       Get an array of device objects and properties
-                       that represent the currently attached devices.
-
-                       This method call should only be used once when an
-                       application starts up. Further device additions
-                       and removal shall be monitored via DeviceAdded and
-                       DeviceRemoved signals.
-
-Signals                DeviceAdded(object path, dict properties)
-
-                       Signal that is sent when a new device is added.  It
-                       contains the object path of new device and its
-                       properties.
-
-               DeviceRemoved(object path)
-
-                       Signal that is sent when a device has been removed.
-                       The object path is no longer accessible after this
-                       signal and only emitted for reference.
-
-
-Device hierarchy
-================
-
-Service                org.ofono.dundee
-Interface      org.ofono.dundee.Device
-Object path    /{device0,device1,...}
-
-Methods                dict GetProperties()
-
-                       Returns properties for the device object. See
-                       the properties section for available properties.
-
-               void SetProperty(string property, variant value)
-
-                       Changes the value of the specified property. Only
-                       properties that are listed as readwrite are
-                       changeable. On success a PropertyChanged signal
-                       will be emitted.
-
-                       Possible Errors: [service].Error.Timedout
-                                        [service].Error.InvalidArguments
-                                        [service].Error.Failed
-
-Signals                PropertyChanged(string name, variant value)
-
-                       This signal indicates a changed value of the given
-                       property.
-
-Properties     string Name [readonly]
-
-                       Friendly name of the device.
-
-               boolean Active [readwrite]
-
-                       Holds whether the device is connected. A
-                       connection will be established when this value
-                       is set to true. A existing connection will be
-                       teared down when set to false.
-
-               dict Settings [readonly]
-
-                       Holds all the IP network settings.
-
-                       string Interface [readonly, optional]
-
-                               Holds the interface of the network interface
-                               used by this connection (e.g. "ppp0" "usb0")
-
-                       string Address [readonly, optional]
-
-                               Holds the IP address for this connection.
-
-                       array{string} DomainNameServers [readonly, optional]
-
-                               Holds the list of domain name servers for this
-                               connection.
diff --git a/doc/emergency-call-handling.txt b/doc/emergency-call-handling.txt
deleted file mode 100644 (file)
index 69b217d..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-This document explains what is expected from applications and what oFono
-will do for an emergency call request in different states.
-
-Case 1: Call in offline and SIM present state
-
-Expected from UI/applications:
-
-       - Online property of org.ofono.Modem interface should be set to TRUE.
-       - Dial method should be called with the dialled number.
-
-What oFono will do:
-
-       - Modem will be set to online.
-       - Post online atoms will be created.
-       - Upon reception of Dial request, Emergency mode is activated.
-       - Once the call is ended, Emergency mode is deactivated.
-       - Modem remains in online mode with full funcationality.
-
-Case 2: Call in SIM Present and PIN required state
-
-Expected from UI/applications:
-
-       - If the user enters emergency number in the PIN entry dialog, then
-         Online property on org.ofono.Modem interface should be set to TRUE.
-               - List of Emergency numbers can be known from the
-                 EmergencyNumbers property on the org.ofono.VoiceCallManager
-                 interface.
-       - Dial method should be called with the dialled number
-
-What oFono will do:
-
-       - Modem will be set to online.
-       - Upon reception of Dial request, Emergency mode is activated.
-       - Once the call is ended, Emergency mode is deactivated.
-       - Modem remains in online mode but the functionalities will be
-         limited.
-
-Case 3: Call in SIM Present and PIN required state - Dial cancelled by user
-
-Expected from UI/applications:
-
-       - If the user enters emergency number in the PIN entry dialog, then
-         Online property on org.ofono.Modem interface should be set to TRUE.
-               - List of Emergency numbers can be known from the
-                 EmergencyNumbers property on the org.ofono.VoiceCallManager
-                 interface.
-       - Dial method should be called with the dialled number
-       - Upon dial cancellation by user, HangupAll should be called.
-
-What oFono will do:
-
-       - Modem will be set to online.
-       - Post SIM and Post online atoms are not created.
-       - Upon reception of Dial request, Emergency mode is activated.
-       - Upon dial cancellation(HangupAll request), Emergency mode is
-         deactivated.
-       - Modem remains in online mode but the functionalities will be
-         limited.
-
-Case 4: Call in No SIM state
-
-Expected from UI/applications:
-
-       - Online property on org.ofono.Modem interface should be set to TRUE.
-       - Dial method should be called with the dialled number
-
-What oFono will do:
-
-       - Modem will be set to online.
-       - Post SIM and Post online atoms not created.
-       - If the dialed number is an Emergeny number, Emergency mode is
-         activated.
-       - Once the call is ended, Emergency mode is deactivated.
-       - Modem remains in online mode but the functionalities will be
-         limited.
-
-Case 5: Call in No SIM state - PIN disabled SIM inserted during emergency call
-
-Expected from UI/applications:
-
-       - Online property on org.ofono.Modem interface should be set to TRUE.
-       - Dial method should be called with the dialled number
-
-What oFono will do:
-
-       - Modem will be set to online.
-       - Post SIM and Post online atoms are not created.
-       - If the dialed number is an Emergeny number, Emergency mode is
-         activated.
-       - Upon PIN disabled SIM detection, Post SIM and Post online
-         atoms are created.
-       - Once the call is ended, Emergency mode is deactivated.
-       - Modem remains in online mode with full functionality.
-
-Case 6: Call in No SIM state - PIN enabled SIM inserted during emergency call
-
-Expected from UI/applications:
-
-       - Online property on org.ofono.Modem interface should be set to TRUE.
-       - Dial method should be called with the dialled number
-
-What oFono will do:
-
-       - Modem will be set to online.
-       - Post SIM and Post online atoms are not created.
-       - If the dialed number is an Emergeny number, Emergency mode is
-         activated.
-       - Upon PIN enabled SIM detection, applications will be informed
-         of the pin status via PinRequired property on the
-         org.ofono.SimManager interface.
-       - Once the call is ended, Emergency mode is deactivated.
-       - Modem remains in online mode but the functionalities will be
-         limited.
diff --git a/doc/handsfree-api.txt b/doc/handsfree-api.txt
deleted file mode 100644 (file)
index 7f9deec..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-Handsfree hierarchy
-===================
-
-Service                org.ofono
-Interface      org.ofono.Handsfree
-Object path    [variable prefix]/{modem0,modem1,...}
-
-Methods                dict GetProperties()
-
-                       Returns properties for the Handsfree Interface. See the
-                       properties section for available properties.
-
-               void SetProperty(string property, variant value)
-
-                       Changes the value of the specified property. Only
-                       properties that are listed as readwrite are
-                       changeable. On success a PropertyChanged signal
-                       will be emitted.
-
-                       Possible Errors: [service].Error.InProgress
-                                        [service].Error.InvalidArguments
-
-               string RequestPhoneNumber()
-
-                       Request a phone number from the AG, corresponding to the
-                       last voice tag recorded in the HF. The AG may accept or
-                       reject this request depending on its internal state.
-
-                       This functionality is generally implemented by using
-                       the +BINP=1 AT command.
-
-                       Possible Errors: [service].Error.InProgress
-                                        [service].Error.InvalidArguments
-                                        [service].Error.Failed
-
-Signals                PropertyChanged(string property, variant value)
-
-                       Signal is emitted whenever a property has changed.
-                       The new value is passed as the signal argument.
-
-Properties     array{string} Features [readonly]
-
-                       List of features supported by the AG. The currently
-                       supported values are:
-                               "voice-recognition"
-                               "attach-voice-tag"
-
-               boolean InbandRinging [readonly]
-
-                       Boolean representing whether inband ringing is enabled.
-
-               boolean VoiceRecognition [readwrite]
-
-                       Boolean representing whether voice recognition is
-                       currently active in the AG. This property may be written
-                       to activate or deactivate the function from the HF, or
-                       the AG could autonomously initiate it.
diff --git a/doc/hardware-support.txt b/doc/hardware-support.txt
deleted file mode 100644 (file)
index 7dafc52..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-Hardware support
-****************
-
-Voice and data modems
-=====================
-
- - Infineon (IFX)
-
-       Fully supported modem with voice calls, text messaging,
-       supplementary services, data connections, SIM Toolkit  etc.
-
-       Supports multiple GPRS connections with RawIP interface.
-
- - ST-Ericsson (STE)
-
-       Fully supported modem with voice calls, text messaging,
-       supplementary service, data connections, SIM Toolkit etc.
-
-       Supports multiple GPRS connections via CAIF subsystem.
-
- - Nokia Phonet/ISI
-
-       Supports majority of phone features used on the N900
-       phone from Nokia.
-
-       Supports multiple GPRS connections via Phonet pipes.
-
-  - Calypso / Openmoko Freerunner
-
-       Fully supported modem with voice calls, text messaging,
-       supplementary services, data connections, SIM Toolkit  etc.
-
-       GPRS connection support is limited due to hardware design.
-
-
-Data only modems
-================
-
- - Ericsson MBM
-
-       Fully supported data only modem with extra support for
-       text messaging, USSD and SIM Toolkit.
-
-       Support for one high-speed CDC Ethernet GPRS connection
-       and one PPP connection.
-
-       Sony-Ericsson   MD-300
-       Toshiba         F3607gw
-       Lenovo          F3507g and F3607gw
-       Dell            5530, F3607gw and F3307
-
- - Option HSO
-
-       Fully supported data only modem with extra support for
-       text messaging and USSD.
-
-       Support for one high-speed point-to-point GRPS connection.
-
- - Huawei
-
-       Support for one PPP based GPRS connection.
-
-       Limited support for text messaging and USSD.
-
-       Modems based on EM770 have voice call support.
-
- - Novatel
-
-       Support for one PPP based GPRS connection.
-
-       Limited support for text messaging and USSD.
-
- - ZTE
-
-       Support for one PPP based GPRS connection.
-
-       Limited support for text messaging and USSD.
-
- - Sierra
-
-       Support for PPP based GPRS connection still work in progress.
-
-       Limited support for text messaging and USSD.
-
- - Nvidia Icera
-
-       Fully support data only modem with extra support for
-       text messaging and USSD.
-
- - Qualcomm Gobi
-
-       Fully supported data only modem with extra support for
-       text messaging and GPS location reporting.
-
-       Support for voice calls, USSD and SS is work in progress.
-
-
-Other modems
-============
-
- - Phonesim
-
-       Fully supported emulator for testing.
-
- - Bluetooth Handsfree
-
-       Special Bluetooth Handsfree client support.
diff --git a/doc/hfp-overview.txt b/doc/hfp-overview.txt
deleted file mode 100644 (file)
index 3ca1213..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-HandsFree Profile Audio Gateway diagram
-=======================================
-
-This diagram explains how oFono manages HFP AG.
-
-AT commands and unsolicited results are managed in their related atom (eg. ATA
-is managed in voicecall atom).
-The emulator atom is managing AT commands or unsolicited results that are not
-falling into a specific atom.
-
-1) HFP AG plugin registers a HFP AG server as soon as a voicecall atom exist.
-2) When a connection occurs on this server, HFP AG plugin creates and registers
-   an emulator atom.
-3) Emulator atom will start a GAtServer and registers non-atom-specific
-   AT commands to it.
-4) On emulator atom registration, voice call related atoms (voicecall, network
-   and sim) register AT callbacks they managed through emulator atom.
-
-
-*===========*                *-----------------*
-|           |   Register     |                 |
-|   BlueZ   |<---------------|  HFP AG plugin  |
-|           |   SDP record   |                 |
-*===========*                *-----------------*
-                                      |
-                                      | Start emulator on connection
-                                      |
-                                      V
-                             *-----------------*
-                             |                 |
-                   *-------->|  Emulator Atom  |
-                   |         |                 |
-                   |         *-----------------*
-                   |                  |
-         Register  |                  | Register AT commands
-            AT     |                  V
-         callbacks |         *-----------------*
-                   |         |                 |
-                   |         |    GAtServer    |
-                   |         |                 |
-                   |         *-----------------*
-                   |
-                   *---------------------*-------------------*
-                   |                     |                   |
-          *----------------*     *--------------*     *-------------*
-          |                |     |              |     |             |
-          | Voicecall atom |     | Network atom |     |  SIM atom   |
-          |                |     |              |     |             |
-          *----------------*     *--------------*     *-------------*
diff --git a/doc/mmi-codes.txt b/doc/mmi-codes.txt
deleted file mode 100644 (file)
index c1c041d..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-Man-Machine Interface (MMI) Codes and oFono
-===========================================
-
-1.0 Introduction
-
-3GPP 22.030 describes the structure of MMI codes for User Equipment.  All user
-equipment that wishes to be compliant with the Global Certification Forum
-(GCF) must recognize such codes in the dialer application.  This document
-describes the basic design principles for how to handle MMI codes with oFono.
-
-
-2.0 Basic MMI structure
-
-The MMI codes fall into two broad categories: codes that are followed by
-<SEND> and standalone codes.  oFono handles all codes that are followed by
-<SEND> while the UI is expected to handle standalone codes.
-
-2.1 Supplementary Service Control Codes
-
-The following codes are followed by <SEND> and are handled by oFono.  The
-general structure of the codes is as follows:
-
-* Activation   - '*SC*SI#'
-* Registration - '*SC*SI#' and '**SC*SI#'
-* Erasure      - '##SC*SI#'
-* Deactivation - '#SC*SI#'
-* Interrogation        - '*#SC*SI#'
-
-Please refer to 3GPP 22.030 for detailed explanation of the structure of SI
-and SC.  oFono currently handles the following SCs:
-
-* 33 - Call Barring - All Outgoing
-* 331 - Call Barring - Outgoing International
-* 332 - Call Barring - Outgoing International except Home Country
-* 35 - Call Barring - All Incoming
-* 351 - Call Barring - All Incoming when Roaming
-* 330 - Call Barring - All Barrring Services
-* 333 - Call Barring - All Outgoing Services (e.g. 33, 331, 332)
-* 335 - Call Barring - All Incoming Services (e.g. 35, 351)
-
-* 21 - Unconditional Call Forwarding
-* 67 - Call Forwarding on Busy
-* 61 - Call Forwarding on No Reply
-* 62 - Call Forwarding on Unreachable
-* 002 - Call Forwarding All Conditional
-* 004 - Call Forwarding All
-
-* 30 - CLIP
-* 31 - CLIR
-* 76 - COLP
-* 77 - COLR
-* 43 - Call Waiting
-* 300 - CNAP
-
-2.2 Registration of a new password
-
-The following password change strings are followed by <SEND> and are recognized
-by oFono:
-
-* 03 * ZZ * OLD_PASSWORD * NEW_PASSWORD * NEW_PASSWORD #
-** 03 * ZZ * OLD_PASSWORD * NEW_PASSWORD * NEW_PASSWORD #
-* 03 ** OLD_PASSWORD * NEW_PASSWORD * NEW_PASSWORD #
-** 03 ** OLD_PASSWORD * NEW_PASSWORD * NEW_PASSWORD #
-
-NOTE: ZZ is the Call Barring supplementary service code.
-
-2.3 Change of PIN/PIN2
-
-The following string allows the user to change the PIN:
-
-PIN1: **04*OLD_PIN*NEW_PIN*NEW_PIN#
-PIN2: **042*OLD-PIN2*NEW_PIN2*NEW_PIN2#
-
-The following string allows the user to unblock the PIN:
-
-PIN1: **05*PIN_UNBLOCKING_KEY*NEW_PIN*NEW_PIN#
-PIN2: **052*PIN2_UNBLOCKING_KEY*NEW_PIN2*NEW_PIN2#
-
-Please note that this procedure is not followed by <SEND>.  It is up to the
-dialer to recognize this string and act accordingly by using the appropriate
-method on the SimManager interface.
-
-2.4 IMEI Display
-
-The following string can be used to obtain the IMEI:
-
-*#06#
-
-Please note that this procedure is not followed by <SEND>.  It is up to the
-dialer to recognize this string and display the SerialNumber property of the
-Modem Interface.
-
-3.0 General Application Guidelines
-
-When the application is taking user input it is expected to match the input
-against all possible strings that are not to be followed by <SEND>.  At a
-minimum the PIN change or unlock and the IMEI display strings must be handled
-by the application.  Any additional manufacturer-specific strings are also to
-be handled by the application.
-
-Once the user presses <SEND> the request should be sent to the
-SupplementaryServices.Initiate() method.  If the string is recognized as a
-control string, then the return value will be interpreted according to
-structure specified in doc/supplementaryservices-api.txt.  If the error
-NotRecognized is returned, then the string is not recognized as a
-supplementary service string and should be treated as a call setup request
-instead.  In this case the application should forward the string to
-VoiceCallManager.Dial() method.
index 1c4e440..9fd23ba 100644 (file)
@@ -167,4 +167,4 @@ Properties  boolean Powered [readwrite]
                        not give any hints on which Interfaces will be
                        supported by this modem.
 
-                       Possible values are "hfp", "sap" and "hardware".
+                       Possible values are "test", "hfp", "sap" and "hardware".
diff --git a/doc/sim900-modem.txt b/doc/sim900-modem.txt
deleted file mode 100644 (file)
index e9f051c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-SIM900 modem usage
-===================
-
-To enable SIM900 module support you need to put the following
-udev rule into appropriate file in /{etc,lib}/udev/rules.d:
-
-KERNEL=="gsmtty3", ENV{OFONO_DRIVER}="sim900"
-
-On the i-Tetra tracking device, the SIM900 is accessed
-via N_GSM mux device. We use ofono as SMS message
-service and incoming voice calls service, so we
-use /dev/gsmtty1 provided by N_GSM mux.
diff --git a/doc/standards.txt b/doc/standards.txt
deleted file mode 100644 (file)
index bdbc0d1..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-Referencing standards in the source
-===================================
-
-When referencing standard documents use raw numbers xx.xxx for 3GPP
-documents or xxx.xxx for ETSI document (eg: 23.040). If needing to
-point to an specific section/subsection, explicitly say "Section foo"
-
-3GPP specs can be found in http://3gpp.org/ftp/Specs.
-
-Core 3GPP Specifications
-========================
-
-- 22.030: Man-Machine Interface (MMI) of the User Equipment (UE)
-
-Describes the various supplementary service magic strings, how Abbreviated
-Dialing Numbers are used and general UI interaction.  This spec is
-particularly important for its description of how calls are put on hold,
-transferred, swapped, etc.
-
-- 22.038: Alphabets and Language Specific Information
-
-Describes the GSM 7-bit character set, bit packing for SMS, CBS and USSD.
-Also describes UCS2 and how it is encoded for SMS, CBS and USSD.
-
-- 27.007: AT command set for User Equipment (UE)
-
-Describes the AT command set for all GSM modems.  oFono atom driver APIs are
-largely based on the AT commands defined in this document.
-
-- 27.005: Short Message Service (SMS) & Cell Broadcast Service (CBS)
-
-Describes the AT command set for SMS and CBS interaction.
-
-- 23.040: Technical realization of the Short Message Service (SMS)
-
-Describes the SMS service in detail, including the various PDUs, headers,
-EMS messages, MWI messages and other aspects of SMS.
-
-- 23.041: Technical realization of Cell Broadcast Service (CBS)
-
-Describes the CBS service in detail, including the PDU structure, ETWS and
-other aspects.
-
-- 31.102: Characteristics of the (USIM) application
-
-Describes the contents of the SIM, SIM initialization procedures, elementary
-file permissions and formats.
-
-- 31.111: Universal Subscriber Identity Module (USIM) Application Toolkit (USAT)
-
-Describes 3GPP specific aspects of Card Application Toolkit (CAT) / STK.
-
-- 31.124: USAT conformance test specification
-
-Describes the testing parameters and test cases for 31.111.
-
-
-Security Specifications
-=======================
-
-- 33.220  Generic bootstrapping architecture (GBA)
-
-Describes the generic bootstrapping architecture used to leverage
-SIM-based authentication.
-
-- 24.109  Bootstrapping interface (Ub) and NAF interface (Ua)
-
-Describes how the GBA authentication is used with, e.g., HTTP.
-
-
-3GPP Specific Services
-======================
-
-- 22.072: Call Deflection
-- 22.081: Line Identification
-- 22.082: Call Forwarding
-- 22.083: Call Waiting and Call Hold
-- 22.084: Multiparty (MPTY)
-- 22.085: Closed User Group
-- 22.086: Advice of Charge
-- 22.088: Call Barring
-- 22.090: Unstructured Supplementary Service Data (USSD)
-- 22.091: Explicit Call Transfer
-
-
-ETSI Card Application Toolkit (Sim Toolkit)
-===========================================
-
-- 102.223: Card Application Toolkit (CAT)
-
-Describes the core functionality of CAT, but does not describe network
-technology specific features (e.g. UMTS/CDMA).
-
-- 102.384: Card Application Toolkit (CAT) conformance specification
-
-Describes test methodology and test cases for 102.223.
-
-
-
-Core 3GPP2 Specifications
-========================
-- C.R1001-G: Administration of Parameter Value Assignments for cdma2000
-       Spread Spectrum Standards - Release G
-
-Describes the value of various parameters that defined in other specifications
-
-- C.S0015-B: Short Message Service (SMS) for Wideband Spread Spectrum Systems
-
-Describes the SMS service(include broadcast short message)in detail. providing
-delivery of text and numeric information for paging, messaging, and voice mail
-notification.
-
-- C.S0023-D: Removable User Identity Module for Spread Spectrum Systems
-
-Describes the contents of the R-UIM, R-UIM initialization procedures, functions,
-commands, file architecture and the coding of elementary files.
-
-- C.S0035-A: CDMA Card Application Toolkit (CCAT)
-
-Describes the core functionality of CCAT.
-
-- S.R0006-000 Wireless Features Description
-
-Describes the general definitions and concepts of a subset of wireless features.
-
-- S.R0006-100 Wireless Features Description: General Background and Assumptions
-
-Describes the general background and assumption of wireless features.
-
-3GPP2 Wireless Features Description
-===================================
-- S.R0006-501: Call Delivery
-- S.R0006-502: Call Forwarding--Busy
-- S.R0006-503: Call Forwarding--Default
-- S.R0006-504: Call Forwarding--No Answer
-- S.R0006-505: Call Forwarding--Unconditional
-- S.R0006-506: Call Transfer
-- S.R0006-507: Call Waiting
-- S.R0006-508: Calling Number Identification Presentation
-- S.R0006-509: Calling Number Identification Restriction
-- S.R0006-510: Conference Calling
-- S.R0006-511: Do Not Disturb
-- S.R0006-512: Flexible Alerting
-- S.R0006-513: Message Waiting Notification
-- S.R0006-514: Mobile Access Hunting
-- S.R0006-515: Password Call Acceptance
-- S.R0006-516: Preferred Language
-- S.R0006-517: Priority Access and Channel Assignment
-- S.R0006-518: Remote Feature Control
-- S.R0006-519: Selective Call Acceptance
-- S.R0006-520: Subscriber PIN Access
-- S.R0006-521: Subscriber PIN Intercept
-- S.R0006-522: Three-Way Calling
-- S.R0006-523: Voice Message Retrieval
-- S.R0006-524: Voice Privacy
-- S.R0006-525: Asynchronous Data Service
-- S.R0006-526: Calling Name Presentation
-- S.R0006-527: Calling Name Restriction
-- S.R0006-528: Data Privacy
-- S.R0006-529: Emergency Services
-- S.R0006-530: Group 3 Facsimile Service
-- S.R0006-531: Network Directed System Selection
-- S.R0006-532: Non-Public Service Mode
-- S.R0006-533: Over-the-Air Service Provisioning
-- S.R0006-534: Service Negotiation
-- S.R0006-535: User Group
-- S.R0006-536: Group 3 Analog Facsimile Service
-- S.R0006-601: Short Message Delivery - Point-to-Point Bearer Service
-- S.R0006-602: Wireless Features Description: Wireless Messaging Teleservice
-- S.R0006-603: Wireless Features Description: Wireless Paging Teleservice
-- S.R0006-701: Wireless Features Description: Mobile Station Functionality
-- S.R0006-801: Wireless Features Description: System Functionality
-- S.R0006-802: Wireless Features Description: Subscriber Confidentiality
-- S.R0006-803: Wireless Features Description: Network Services
-- S.R0006-804: Wireless Features Description: Enhanced Security Services
-- S.R0006-805: Wireless Features Description: CDMA Packet Data Service
-- S.R0006-806: Wireless Features Description: Over-the-Air Parameter Administration
-- S.R0006-807: Wireless Features Description: Generic Broadcast Teleservice Transport
-       Capability: Network Perspective
-- S.R0006-808: Wireless Features Description: Circuit Switched Call Precedence Over
-       CDMA Packet Data Session
-
-Common PCN Handset Specification (CPHS)
-=======================================
-
-This specification includes certain pre-standard extensions to GSM
-standards. oFono implements some of the features found in the Phase 2
-specification, version 4.2.
-
-The specification itself is not publicly available.
-
-Bluetooth Specifications
-========================
-- Dial-up Networking Profile - Bluetooth specification version 1.1 - 22 February 2001
index 8e8f2b6..5924f25 100644 (file)
@@ -35,6 +35,7 @@ Methods               string, variant Initiate(string command)
                                         [service].Error.AccessDenied
                                         [service].Error.Failed
                                         [service].Error.NotRecognized
+                                        [service].Error.Terminated
 
                string Respond(string reply)
 
@@ -48,6 +49,7 @@ Methods               string, variant Initiate(string command)
                                         [service].Error.InvalidArguments
                                         [service].Error.InvalidFormat
                                         [service].Error.Failed
+                                        [service].Error.Terminated
 
                void Cancel()
 
index 78960a1..2d715be 100644 (file)
@@ -58,7 +58,10 @@ Methods              dict GetProperties()
 
                        NOTE: Releasing active calls does not produce
                        side-effects.  That is the state of held or waiting
-                       calls is not affected.
+                       calls is not affected.  As an exception, in the case
+                       where a single active call and a waiting call are
+                       present, releasing the active call will result in the
+                       waiting call transitioning to the 'incoming' state.
 
                        Possible Errors: [service].Error.InProgress
                                         [service].Error.Failed
index b17a4a5..48b9b0d 100644 (file)
@@ -112,11 +112,6 @@ static inline int at_util_convert_signal_strength(int strength)
        return result;
 }
 
-#define DECLARE_FAILURE(e)                     \
-       struct ofono_error e;                   \
-       e.type = OFONO_ERROR_TYPE_FAILURE;      \
-       e.error = 0                             \
-
 #define CALLBACK_WITH_FAILURE(cb, args...)             \
        do {                                            \
                struct ofono_error cb_e;                \
index a2417c7..1239d05 100644 (file)
@@ -207,6 +207,7 @@ static void at_call_barring_remove(struct ofono_call_barring *cb)
 {
        GAtChat *chat = ofono_call_barring_get_data(cb);
 
+       g_idle_remove_by_data(cb);
        g_at_chat_unref(chat);
        ofono_call_barring_set_data(cb, NULL);
 }
index cbe4b24..e2020d3 100644 (file)
@@ -259,6 +259,7 @@ static void at_ccfc_remove(struct ofono_call_forwarding *cf)
 {
        GAtChat *chat = ofono_call_forwarding_get_data(cf);
 
+       g_idle_remove_by_data(cf);
        g_at_chat_unref(chat);
        ofono_call_forwarding_set_data(cf, NULL);
 }
index 2dc16e4..f017ab5 100644 (file)
@@ -393,6 +393,7 @@ static void at_call_settings_remove(struct ofono_call_settings *cs)
 {
        GAtChat *chat = ofono_call_settings_get_data(cs);
 
+       g_idle_remove_by_data(cs);
        g_at_chat_unref(chat);
        ofono_call_settings_set_data(cs, NULL);
 }
index 217445f..3c491be 100644 (file)
@@ -45,7 +45,6 @@ static const char *cscb_prefix[] = { "+CSCB:", NULL };
 
 struct cbs_data {
        GAtChat *chat;
-       gboolean cscb_mode_1;
        unsigned int vendor;
 };
 
@@ -118,14 +117,11 @@ static void at_cbs_set_topics(struct ofono_cbs *cbs, const char *topics,
        /* For the Qualcomm based devices it is required to clear
         * the list of topics first.  Otherwise setting the new
         * topic ranges will fail.
-        *
-        * In addition only AT+CSCB=1 seems to work.  Providing
-        * a topic range for clearing makes AT+CSBC=0,... fail.
         */
        switch (data->vendor) {
        case OFONO_VENDOR_GOBI:
        case OFONO_VENDOR_QUALCOMM_MSM:
-               g_at_chat_send(data->chat, "AT+CSCB=1", none_prefix,
+               g_at_chat_send(data->chat, "AT+CSCB=0", none_prefix,
                                NULL, NULL, NULL);
                break;
        default:
@@ -152,16 +148,10 @@ static void at_cbs_clear_topics(struct ofono_cbs *cbs,
 {
        struct cbs_data *data = ofono_cbs_get_data(cbs);
        struct cb_data *cbd = cb_data_new(cb, user_data);
-       char buf[256];
 
        DBG("");
 
-       if (data->cscb_mode_1)
-               snprintf(buf, sizeof(buf), "AT+CSCB=1,\"0-65535\"");
-       else
-               snprintf(buf, sizeof(buf), "AT+CSCB=0,\"\"");
-
-       if (g_at_chat_send(data->chat, buf, none_prefix,
+       if (g_at_chat_send(data->chat, "AT+CSCB=0", none_prefix,
                                at_cscb_set_cb, cbd, g_free) > 0)
                return;
 
@@ -194,7 +184,6 @@ static void at_cscb_support_cb(gboolean ok, GAtResult *result, gpointer user)
        struct cbs_data *data = ofono_cbs_get_data(cbs);
        gint range[2];
        GAtResultIter iter;
-       char buf[256];
 
        if (!ok)
                goto error;
@@ -208,21 +197,12 @@ static void at_cscb_support_cb(gboolean ok, GAtResult *result, gpointer user)
                goto error;
 
        while (g_at_result_iter_next_range(&iter, &range[0], &range[1]))
-               if (1 >= range[0] && 1 <= range[1])
-                       data->cscb_mode_1 = TRUE;
-
-       g_at_result_iter_close_list(&iter);
+               ;
 
-       /* Assume that if CSCB mode 1 is supported, then we need to use
-        * it to remove topics, otherwise we need to set the entire list
-        * of new topics using CSCB mode 0.
-        */
-       if (data->cscb_mode_1)
-               snprintf(buf, sizeof(buf), "AT+CSCB=1,\"0-65535\"");
-       else
-               snprintf(buf, sizeof(buf), "AT+CSCB=0,\"\"");
+       if (!g_at_result_iter_close_list(&iter))
+               goto error;
 
-       if (g_at_chat_send(data->chat, buf, none_prefix,
+       if (g_at_chat_send(data->chat, "AT+CSCB=0", none_prefix,
                                at_cbs_register, cbs, NULL) > 0)
                return;
 
index 3d09913..19b19b2 100644 (file)
@@ -47,6 +47,7 @@ static const char *creg_prefix[] = { "+CREG:", NULL };
 static const char *cops_prefix[] = { "+COPS:", NULL };
 static const char *csq_prefix[] = { "+CSQ:", NULL };
 static const char *cind_prefix[] = { "+CIND:", NULL };
+static const char *cmer_prefix[] = { "+CMER:", NULL };
 static const char *zpas_prefix[] = { "+ZPAS:", NULL };
 static const char *option_tech_prefix[] = { "_OCTI:", "_OUWCTI:", NULL };
 
@@ -678,6 +679,54 @@ static void ifx_xhomezr_notify(GAtResult *result, gpointer user_data)
        ofono_info("Home zone: %s", label);
 }
 
+static void ifx_xreg_notify(GAtResult *result, gpointer user_data)
+{
+       struct ofono_netreg *netreg = user_data;
+       struct netreg_data *nd = ofono_netreg_get_data(netreg);
+       int state;
+       const char *band;
+       GAtResultIter iter;
+
+       g_at_result_iter_init(&iter, result);
+
+       if (!g_at_result_iter_next(&iter, "+XREG:"))
+               return;
+
+       if (!g_at_result_iter_next_number(&iter, &state))
+               return;
+
+       if (!g_at_result_iter_next_unquoted_string(&iter, &band))
+
+       DBG("state %d band %s", state, band);
+
+       switch (state) {
+       case 0: /* not registered */
+               nd->tech = -1;
+               break;
+       case 1: /* registered, GPRS attached */
+               nd->tech = ACCESS_TECHNOLOGY_GSM;
+               break;
+       case 2: /* registered, EDGE attached */
+               nd->tech = ACCESS_TECHNOLOGY_GSM_EGPRS;
+               break;
+       case 3: /* registered, WCDMA attached */
+               nd->tech = ACCESS_TECHNOLOGY_UTRAN;
+               break;
+       case 4: /* registered, HSDPA attached */
+               nd->tech = ACCESS_TECHNOLOGY_UTRAN_HSDPA;
+               break;
+       case 5: /* registered, HSUPA attached */
+               nd->tech = ACCESS_TECHNOLOGY_UTRAN_HSUPA;
+               break;
+       case 6: /* registered, HSUPA and HSDPA attached */
+               nd->tech = ACCESS_TECHNOLOGY_UTRAN_HSDPA_HSUPA;
+               break;
+       case 7: /* registered, GSM */
+               nd->tech = ACCESS_TECHNOLOGY_GSM;
+               break;
+       }
+}
+
 static void ifx_xciev_notify(GAtResult *result, gpointer user_data)
 {
        //struct ofono_netreg *netreg = user_data;
@@ -758,6 +807,37 @@ static void ciev_notify(GAtResult *result, gpointer user_data)
        ofono_netreg_strength_notify(netreg, strength);
 }
 
+static void telit_ciev_notify(GAtResult *result, gpointer user_data)
+{
+       struct ofono_netreg *netreg = user_data;
+       struct netreg_data *nd = ofono_netreg_get_data(netreg);
+       const char *signal_identifier = "rssi";
+       const char *ind_str;
+       int strength;
+       GAtResultIter iter;
+
+       g_at_result_iter_init(&iter, result);
+
+       if (!g_at_result_iter_next(&iter, "+CIEV:"))
+               return;
+
+       if (!g_at_result_iter_next_unquoted_string(&iter, &ind_str))
+               return;
+
+       if (!g_str_equal(signal_identifier, ind_str))
+               return;
+
+       if (!g_at_result_iter_next_number(&iter, &strength))
+               return;
+
+       if (strength == nd->signal_invalid)
+               strength = -1;
+       else
+               strength = (strength * 100) / (nd->signal_max - nd->signal_min);
+
+       ofono_netreg_strength_notify(netreg, strength);
+}
+
 static void ctzv_notify(GAtResult *result, gpointer user_data)
 {
        struct ofono_netreg *netreg = user_data;
@@ -1395,6 +1475,176 @@ notify:
        ofono_netreg_status_notify(netreg, status, lac, ci, tech);
 }
 
+static void at_cmer_not_supported(struct ofono_netreg *netreg)
+{
+       ofono_error("+CMER not supported by this modem.  If this is an error"
+                       " please submit patches to support this hardware");
+
+       ofono_netreg_remove(netreg);
+}
+
+static void at_cmer_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+       struct ofono_netreg *netreg = user_data;
+       struct netreg_data *nd = ofono_netreg_get_data(netreg);
+
+       if (!ok) {
+               at_cmer_not_supported(netreg);
+               return;
+       }
+
+       /*
+        * Telit uses strings instead of numbers to identify indicators
+        * in a +CIEV URC.
+        * Handle them in a separate function to keep the code clean.
+        */
+       if (nd->vendor == OFONO_VENDOR_TELIT)
+               g_at_chat_register(nd->chat, "+CIEV:",
+                               telit_ciev_notify, FALSE, netreg, NULL);
+       else
+               g_at_chat_register(nd->chat, "+CIEV:",
+                               ciev_notify, FALSE, netreg, NULL);
+
+       g_at_chat_register(nd->chat, "+CREG:",
+                               creg_notify, FALSE, netreg, NULL);
+
+       ofono_netreg_register(netreg);
+}
+
+static inline char wanted_cmer(int supported, const char *pref)
+{
+       while (*pref) {
+               if (supported & (1 << (*pref - '0')))
+                       return *pref;
+
+               pref++;
+       }
+
+       return '\0';
+}
+
+static inline ofono_bool_t append_cmer_element(char *buf, int *len, int cap,
+                                               const char *wanted,
+                                               ofono_bool_t last)
+{
+       char setting = wanted_cmer(cap, wanted);
+
+       if (!setting)
+               return FALSE;
+
+       buf[*len] = setting;
+
+       if (last)
+               buf[*len + 1] = '\0';
+       else
+               buf[*len + 1] = ',';
+
+       *len += 2;
+
+       return TRUE;
+}
+
+static ofono_bool_t build_cmer_string(char *buf, int *cmer_opts,
+                                       struct netreg_data *nd)
+{
+       const char *mode;
+       int len = sprintf(buf, "AT+CMER=");
+
+       DBG("");
+
+       /*
+        * Forward unsolicited result codes directly to the TE;
+        * TA‑TE link specific inband technique used to embed result codes and
+        * data when TA is in on‑line data mode
+        */
+       if (!append_cmer_element(buf, &len, cmer_opts[0], "3", FALSE))
+               return FALSE;
+
+       /* No keypad event reporting */
+       if (!append_cmer_element(buf, &len, cmer_opts[1], "0", FALSE))
+               return FALSE;
+
+       /* No display event reporting */
+       if (!append_cmer_element(buf, &len, cmer_opts[2], "0", FALSE))
+               return FALSE;
+
+       switch (nd->vendor) {
+       case OFONO_VENDOR_TELIT:
+               /*
+                * Telit does not support mode 1.
+                * All indicator events shall be directed from TA to TE.
+                */
+               mode = "2";
+               break;
+       default:
+               /*
+                * Only those indicator events, which are not caused by +CIND
+                * shall be indicated by the TA to the TE.
+                */
+               mode = "1";
+               break;
+       }
+
+       /*
+        * Indicator event reporting using URC +CIEV: <ind>,<value>.
+        * <ind> indicates the indicator order number (as specified for +CIND)
+        * and <value> is the new value of indicator.
+        */
+       if (!append_cmer_element(buf, &len, cmer_opts[3], mode, TRUE))
+               return FALSE;
+
+       return TRUE;
+}
+
+static void at_cmer_query_cb(ofono_bool_t ok, GAtResult *result,
+                               gpointer user_data)
+{
+       struct ofono_netreg *netreg = user_data;
+       struct netreg_data *nd = ofono_netreg_get_data(netreg);
+       GAtResultIter iter;
+       int cmer_opts_cnt = 5; /* See 27.007 Section 8.10 */
+       int cmer_opts[cmer_opts_cnt];
+       int opt;
+       int mode;
+       char buf[128];
+
+       if (!ok)
+               goto error;
+
+       memset(cmer_opts, 0, sizeof(cmer_opts));
+
+       g_at_result_iter_init(&iter, result);
+
+       if (!g_at_result_iter_next(&iter, "+CMER:"))
+               goto error;
+
+       for (opt = 0; opt < cmer_opts_cnt; opt++) {
+               int min, max;
+
+               if (!g_at_result_iter_open_list(&iter))
+                       goto error;
+
+               while (g_at_result_iter_next_range(&iter, &min, &max)) {
+                       for (mode = min; mode <= max; mode++)
+                               cmer_opts[opt] |= 1 << mode;
+               }
+
+               if (!g_at_result_iter_close_list(&iter))
+                       goto error;
+       }
+
+       if (build_cmer_string(buf, cmer_opts, nd) == FALSE)
+               goto error;
+
+       g_at_chat_send(nd->chat, buf, cmer_prefix,
+                       at_cmer_set_cb, netreg, NULL);
+
+       return;
+
+error:
+       at_cmer_not_supported(netreg);
+}
+
 static void cind_support_cb(gboolean ok, GAtResult *result, gpointer user_data)
 {
        struct ofono_netreg *netreg = user_data;
@@ -1465,14 +1715,9 @@ static void cind_support_cb(gboolean ok, GAtResult *result, gpointer user_data)
        if (nd->signal_index == 0)
                goto error;
 
-       g_at_chat_send(nd->chat, "AT+CMER=3,0,0,1", NULL,
-                       NULL, NULL, NULL);
-       g_at_chat_register(nd->chat, "+CIEV:",
-                               ciev_notify, FALSE, netreg, NULL);
-       g_at_chat_register(nd->chat, "+CREG:",
-                               creg_notify, FALSE, netreg, NULL);
+       g_at_chat_send(nd->chat, "AT+CMER=?", cmer_prefix,
+                               at_cmer_query_cb, netreg, NULL);
 
-       ofono_netreg_register(netreg);
        return;
 
 error:
@@ -1590,6 +1835,16 @@ static void at_creg_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
                g_at_chat_send(nd->chat, "AT+XMER=1", none_prefix,
                                                NULL, NULL, NULL);
 
+               /* Register for network technology updates */
+               g_at_chat_register(nd->chat, "+XREG:", ifx_xreg_notify,
+                                               FALSE, netreg, NULL);
+               g_at_chat_send(nd->chat, "AT+XREG=1", none_prefix,
+                                               NULL, NULL, NULL);
+               g_at_chat_send(nd->chat, "AT+XBANDSEL?", none_prefix,
+                                               NULL, NULL, NULL);
+               g_at_chat_send(nd->chat, "AT+XUBANDSEL?", none_prefix,
+                                               NULL, NULL, NULL);
+
                /* Register for home zone reports */
                g_at_chat_register(nd->chat, "+XHOMEZR:", ifx_xhomezr_notify,
                                                FALSE, netreg, NULL);
index 9ce810f..271ceed 100644 (file)
@@ -139,6 +139,7 @@ static void at_sim_auth_remove(struct ofono_sim_auth *sa)
 {
        struct sim_auth_data *sad = ofono_sim_auth_get_data(sa);
 
+       g_idle_remove_by_data(sa);
        ofono_sim_auth_set_data(sa, NULL);
 
        g_at_chat_unref(sad->chat);
index cf3345c..4448e3d 100644 (file)
@@ -66,6 +66,7 @@ static const char *cpinr_prefixes[] = { "+CPINR:", "+CPINRE:", NULL };
 static const char *epin_prefix[] = { "*EPIN:", NULL };
 static const char *spic_prefix[] = { "+SPIC:", NULL };
 static const char *pct_prefix[] = { "#PCT:", NULL };
+static const char *pnnm_prefix[] = { "+PNNM:", NULL };
 static const char *none_prefix[] = { NULL };
 
 static void at_crsm_info_cb(gboolean ok, GAtResult *result, gpointer user_data)
@@ -132,12 +133,14 @@ error:
 }
 
 static void at_sim_read_info(struct ofono_sim *sim, int fileid,
-                                       ofono_sim_file_info_cb_t cb,
-                                       void *data)
+                               const unsigned char *path,
+                               unsigned int path_len,
+                               ofono_sim_file_info_cb_t cb, void *data)
 {
        struct sim_data *sd = ofono_sim_get_data(sim);
        struct cb_data *cbd;
-       char buf[64];
+       char buf[128];
+       unsigned int len;
 
        if (sd->vendor == OFONO_VENDOR_OPTION_HSO) {
                unsigned char access[3] = { 0x00, 0x00, 0x00 };
@@ -151,18 +154,34 @@ static void at_sim_read_info(struct ofono_sim *sim, int fileid,
 
        cbd = cb_data_new(cb, data);
 
-       snprintf(buf, sizeof(buf), "AT+CRSM=192,%i", fileid);
+       len = snprintf(buf, sizeof(buf), "AT+CRSM=192,%i", fileid);
 
        switch (sd->vendor) {
+       default:
+               if (path_len == 0)
+                       break;
+
+               /* Fall through */
        case OFONO_VENDOR_ZTE:
        case OFONO_VENDOR_HUAWEI:
        case OFONO_VENDOR_SIERRA:
        case OFONO_VENDOR_SPEEDUP:
        case OFONO_VENDOR_QUALCOMM_MSM:
-               strcat(buf, ",0,0,255"); /* Maximum possible length */
+               /* Maximum possible length */
+               len += sprintf(buf + len, ",0,0,255");
                break;
        }
 
+       if (path_len > 0) {
+               len += sprintf(buf + len, ",,\"");
+
+               for (; path_len; path_len--)
+                       len += sprintf(buf + len, "%02hhX", *path++);
+
+               buf[len++] = '\"';
+               buf[len] = '\0';
+       }
+
        if (g_at_chat_send(sd->chat, buf, crsm_prefix,
                                at_crsm_info_cb, cbd, g_free) > 0)
                return;
@@ -222,16 +241,31 @@ static void at_crsm_read_cb(gboolean ok, GAtResult *result,
 }
 
 static void at_sim_read_binary(struct ofono_sim *sim, int fileid,
-                                       int start, int length,
-                                       ofono_sim_read_cb_t cb, void *data)
+                               int start, int length,
+                               const unsigned char *path,
+                               unsigned int path_len,
+                               ofono_sim_read_cb_t cb, void *data)
 {
        struct sim_data *sd = ofono_sim_get_data(sim);
        struct cb_data *cbd = cb_data_new(cb, data);
        char buf[64];
+       unsigned int len;
 
-       snprintf(buf, sizeof(buf), "AT+CRSM=176,%i,%i,%i,%i", fileid,
+       len = snprintf(buf, sizeof(buf), "AT+CRSM=176,%i,%i,%i,%i", fileid,
                        start >> 8, start & 0xff, length);
 
+       if (path_len > 0) {
+               buf[len++] = ',';
+               buf[len++] = ',';
+               buf[len++] = '\"';
+
+               for (; path_len; path_len--)
+                       len += sprintf(buf + len, "%02hhX", *path++);
+
+               buf[len++] = '\"';
+               buf[len] = '\0';
+       }
+
        if (g_at_chat_send(sd->chat, buf, crsm_prefix,
                                at_crsm_read_cb, cbd, g_free) > 0)
                return;
@@ -242,12 +276,14 @@ static void at_sim_read_binary(struct ofono_sim *sim, int fileid,
 }
 
 static void at_sim_read_record(struct ofono_sim *sim, int fileid,
-                                       int record, int length,
-                                       ofono_sim_read_cb_t cb, void *data)
+                               int record, int length,
+                               const unsigned char *path,
+                               unsigned int path_len,
+                               ofono_sim_read_cb_t cb, void *data)
 {
        struct sim_data *sd = ofono_sim_get_data(sim);
        struct cb_data *cbd = cb_data_new(cb, data);
-       char buf[64];
+       char buf[128];
 
        snprintf(buf, sizeof(buf), "AT+CRSM=178,%i,%i,4,%i", fileid,
                        record, length);
@@ -303,42 +339,29 @@ static void at_crsm_update_cb(gboolean ok, GAtResult *result,
 static void at_sim_update_file(struct ofono_sim *sim, int cmd, int fileid,
                                int p1, int p2, int p3,
                                const unsigned char *value,
+                               const unsigned char *path,
+                               unsigned int path_len,
                                ofono_sim_write_cb_t cb, void *data)
 {
        struct sim_data *sd = ofono_sim_get_data(sim);
        struct cb_data *cbd = cb_data_new(cb, data);
        char *buf;
-       gboolean quote = FALSE;
        int len, ret;
-       int size = 36 + p3 * 2;
+       int size = 38 + p3 * 2;
 
        DBG("");
 
-       /* Add quotes */
-       switch (sd->vendor) {
-       case OFONO_VENDOR_MBM:
-       case OFONO_VENDOR_ZTE:
-       case OFONO_VENDOR_HUAWEI:
-       case OFONO_VENDOR_SPEEDUP:
-               quote = TRUE;
-               size += 2;
-               break;
-       }
-
        buf = g_try_new(char, size);
        if (buf == NULL)
                goto error;
 
-       len = sprintf(buf, "AT+CRSM=%i,%i,%i,%i,%i,", cmd, fileid,p1, p2, p3);
-
-       if (quote)
-               buf[len++] = '\"';
+       len = sprintf(buf, "AT+CRSM=%i,%i,%i,%i,%i,\"", cmd, fileid,p1, p2, p3);
 
        for (; p3; p3--)
                len += sprintf(buf + len, "%02hhX", *value++);
 
-       if (quote)
-               buf[len++] = '\"';
+       buf[len++] = '\"';
+       buf[len] = '\0';
 
        ret = g_at_chat_send(sd->chat, buf, crsm_prefix,
                                at_crsm_update_cb, cbd, g_free);
@@ -357,26 +380,33 @@ error:
 static void at_sim_update_binary(struct ofono_sim *sim, int fileid,
                                        int start, int length,
                                        const unsigned char *value,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_write_cb_t cb, void *data)
 {
        at_sim_update_file(sim, 214, fileid, start >> 8, start & 0xff,
-                               length, value, cb, data);
+                               length, value, path, path_len, cb, data);
 }
 
 static void at_sim_update_record(struct ofono_sim *sim, int fileid,
                                        int record, int length,
                                        const unsigned char *value,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_write_cb_t cb, void *data)
 {
        at_sim_update_file(sim, 220, fileid, record, 4, length,
-                               value, cb, data);
+                               value, path, path_len, cb, data);
 }
 
 static void at_sim_update_cyclic(struct ofono_sim *sim, int fileid,
                                        int length, const unsigned char *value,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_write_cb_t cb, void *data)
 {
-       at_sim_update_file(sim, 220, fileid, 0, 3, length, value, cb, data);
+       at_sim_update_file(sim, 220, fileid, 0, 3, length, value,
+                               path, path_len, cb, data);
 }
 
 static void at_cimi_cb(gboolean ok, GAtResult *result, gpointer user_data)
@@ -899,6 +929,43 @@ error:
        CALLBACK_WITH_FAILURE(cb, NULL, cbd->data);
 }
 
+static void at_pnnm_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+       struct cb_data *cbd = user_data;
+       ofono_sim_pin_retries_cb_t cb = cbd->cb;
+       const char *final = g_at_result_final_response(result);
+       GAtResultIter iter;
+       struct ofono_error error;
+       int retries[OFONO_SIM_PASSWORD_INVALID];
+       size_t i;
+       static enum ofono_sim_password_type password_types[] = {
+               OFONO_SIM_PASSWORD_SIM_PIN,
+               OFONO_SIM_PASSWORD_SIM_PUK,
+       };
+
+       decode_at_error(&error, final);
+
+       if (!ok) {
+               cb(&error, NULL, cbd->data);
+               return;
+       }
+
+       g_at_result_iter_init(&iter, result);
+
+       if (!g_at_result_iter_next(&iter, "+PNNM:"))
+               goto error;
+
+       BUILD_PIN_RETRIES_ARRAY(password_types, ARRAY_SIZE(password_types),
+                               retries);
+
+       cb(&error, retries, cbd->data);
+
+       return;
+
+error:
+       CALLBACK_WITH_FAILURE(cb, NULL, cbd->data);
+}
+
 static void at_pin_retries_query(struct ofono_sim *sim,
                                        ofono_sim_pin_retries_cb_t cb,
                                        void *data)
@@ -955,6 +1022,11 @@ static void at_pin_retries_query(struct ofono_sim *sim,
                                        at_pct_cb, cbd, g_free) > 0)
                        return;
                break;
+       case OFONO_VENDOR_ALCATEL:
+               if (g_at_chat_send(sd->chat, "AT+PNNM?", pnnm_prefix,
+                                       at_pnnm_cb, cbd, g_free) > 0)
+                       return;
+               break;
        default:
                if (g_at_chat_send(sd->chat, "AT+CPINR", cpinr_prefixes,
                                        at_cpinr_cb, cbd, g_free) > 0)
@@ -967,6 +1039,12 @@ static void at_pin_retries_query(struct ofono_sim *sim,
        CALLBACK_WITH_FAILURE(cb, NULL, data);
 }
 
+static int needs_wavecom_sim_quirk(int vendor)
+{
+       return vendor == OFONO_VENDOR_WAVECOM ||
+                       vendor == OFONO_VENDOR_WAVECOM_Q2XXX;
+}
+
 static void at_cpin_cb(gboolean ok, GAtResult *result, gpointer user_data)
 {
        struct cb_data *cbd = user_data;
@@ -980,7 +1058,7 @@ static void at_cpin_cb(gboolean ok, GAtResult *result, gpointer user_data)
        int len = sizeof(at_sim_name) / sizeof(*at_sim_name);
        const char *final = g_at_result_final_response(result);
 
-       if (sd->vendor == OFONO_VENDOR_WAVECOM && ok && strlen(final) > 7)
+       if (needs_wavecom_sim_quirk(sd->vendor) && ok && strlen(final) > 7)
                decode_at_error(&error, "OK");
        else
                decode_at_error(&error, final);
@@ -990,8 +1068,7 @@ static void at_cpin_cb(gboolean ok, GAtResult *result, gpointer user_data)
                return;
        }
 
-       if (sd->vendor == OFONO_VENDOR_WAVECOM ||
-                       sd->vendor == OFONO_VENDOR_WAVECOM_Q2XXX) {
+       if (needs_wavecom_sim_quirk(sd->vendor)) {
                /* +CPIN: <pin> */
                pin_required = final + 7;
        } else {
@@ -1059,7 +1136,6 @@ static void at_xsim_notify(GAtResult *result, gpointer user_data)
 
        switch (state) {
        case 3: /* PIN verified – Ready */
-       case 7: /* ready for attach (+COPS) */
                break;
        default:
                return;
@@ -1102,7 +1178,7 @@ static void at_qss_notify(GAtResult *result, gpointer user_data)
                return;
 
        switch (state) {
-       case 2: /* PIN unlocked */
+       case 3: /* SIM inserted and READY. */
                break;
        default:
                return;
@@ -1174,6 +1250,8 @@ static void at_pin_send_cb(gboolean ok, GAtResult *result,
                                                        FALSE, cbd, g_free);
                return;
        case OFONO_VENDOR_ZTE:
+       case OFONO_VENDOR_ALCATEL:
+       case OFONO_VENDOR_HUAWEI:
                /*
                 * On ZTE modems, after pin is entered, SIM state is checked
                 * by polling CPIN as their modem doesn't provide unsolicited
@@ -1402,19 +1480,8 @@ static int at_sim_probe(struct ofono_sim *sim, unsigned int vendor,
        sd->chat = g_at_chat_clone(chat);
        sd->vendor = vendor;
 
-       switch (sd->vendor) {
-       case OFONO_VENDOR_WAVECOM:
-               g_at_chat_add_terminator(sd->chat, "+CPIN:", 6, TRUE);
-               break;
-       case OFONO_VENDOR_MBM:
+       if (sd->vendor == OFONO_VENDOR_MBM)
                g_at_chat_send(sd->chat, "AT*EPEE=1", NULL, NULL, NULL, NULL);
-               break;
-       case OFONO_VENDOR_WAVECOM_Q2XXX:
-               g_at_chat_add_terminator(chat, "+CPIN: READY", -1, TRUE);
-               break;
-       default:
-               break;
-       }
 
        ofono_sim_set_data(sim, sd);
        g_idle_add(at_sim_register, sim);
@@ -1426,6 +1493,7 @@ static void at_sim_remove(struct ofono_sim *sim)
 {
        struct sim_data *sd = ofono_sim_get_data(sim);
 
+       g_idle_remove_by_data(sim);
        /* Cleanup potential SIM state polling */
        at_util_sim_state_query_free(sd->sim_state_query);
 
index f0bd3a0..b4fb2f2 100644 (file)
@@ -216,6 +216,7 @@ static void at_stk_remove(struct ofono_stk *stk)
 {
        struct stk_data *sd = ofono_stk_get_data(stk);
 
+       g_idle_remove_by_data(stk);
        ofono_stk_set_data(stk, NULL);
 
        g_at_chat_unref(sd->chat);
index 80aed3e..0532d10 100644 (file)
@@ -41,4 +41,5 @@ enum ofono_vendor {
        OFONO_VENDOR_SIMCOM,
        OFONO_VENDOR_ICERA,
        OFONO_VENDOR_WAVECOM_Q2XXX,
+       OFONO_VENDOR_ALCATEL
 };
index abe2ad2..cb3f5a3 100644 (file)
@@ -48,6 +48,7 @@ static const char *bvra_prefix[] = { "+BVRA:", NULL };
 struct hf_data {
        GAtChat *chat;
        unsigned int ag_features;
+       int battchg_index;
        guint register_source;
 };
 
@@ -97,6 +98,31 @@ static void bvra_notify(GAtResult *result, gpointer user_data)
        ofono_handsfree_voice_recognition_notify(hf, (ofono_bool_t) value);
 }
 
+static void ciev_notify(GAtResult *result, gpointer user_data)
+{
+       struct ofono_handsfree *hf = user_data;
+       struct hf_data *hd = ofono_handsfree_get_data(hf);
+       int index;
+       int value;
+       GAtResultIter iter;
+
+       g_at_result_iter_init(&iter, result);
+
+       if (!g_at_result_iter_next(&iter, "+CIEV:"))
+               return;
+
+       if (!g_at_result_iter_next_number(&iter, &index))
+               return;
+
+       if (index != hd->battchg_index)
+               return;
+
+       if (!g_at_result_iter_next_number(&iter, &value))
+               return;
+
+       ofono_handsfree_battchg_notify(hf, value);
+}
+
 static gboolean hfp_handsfree_register(gpointer user_data)
 {
        struct ofono_handsfree *hf = user_data;
@@ -106,6 +132,7 @@ static gboolean hfp_handsfree_register(gpointer user_data)
 
        g_at_chat_register(hd->chat, "+BSIR:", bsir_notify, FALSE, hf, NULL);
        g_at_chat_register(hd->chat, "+BVRA:", bvra_notify, FALSE, hf, NULL);
+       g_at_chat_register(hd->chat, "+CIEV:", ciev_notify, FALSE, hf, NULL);
 
        if (hd->ag_features & HFP_AG_FEATURE_IN_BAND_RING_TONE)
                ofono_handsfree_set_inband_ringing(hf, TRUE);
@@ -129,6 +156,10 @@ static int hfp_handsfree_probe(struct ofono_handsfree *hf,
 
        ofono_handsfree_set_data(hf, hd);
 
+       hd->battchg_index = info->cind_pos[HFP_INDICATOR_BATTCHG];
+       ofono_handsfree_battchg_notify(hf,
+                                       info->cind_val[HFP_INDICATOR_BATTCHG]);
+
        hd->register_source = g_idle_add(hfp_handsfree_register, hf);
 
        return 0;
index 5d4d207..7c27642 100644 (file)
@@ -169,11 +169,19 @@ static void xcallstat_notify(GAtResult *result, gpointer user_data)
                break;
        }
        case CALL_STATUS_DIALING:
+               new_call = create_call(vc, 0, CALL_DIRECTION_MOBILE_ORIGINATED,
+                                       status, NULL, 128,
+                                       CLIP_VALIDITY_NOT_AVAILABLE, id);
+               if (new_call == NULL) {
+                       ofono_error("Unable to malloc. "
+                                       "Call management is fubar");
+                       return;
+               }
+
+               ofono_voicecall_notify(vc, new_call);
+               break;
        case CALL_STATUS_WAITING:
        case CALL_STATUS_INCOMING:
-       {
-               int direction;
-
                /* Handle the following situation:
                 * Active Call + Waiting Call. Active Call is Released.
                 * The Waiting call becomes Incoming. In this case, no
@@ -185,13 +193,8 @@ static void xcallstat_notify(GAtResult *result, gpointer user_data)
                        return;
                }
 
-               if (status == CALL_STATUS_DIALING)
-                       direction = CALL_DIRECTION_MOBILE_ORIGINATED;
-               else
-                       direction = CALL_DIRECTION_MOBILE_TERMINATED;
-
-               new_call = create_call(vc, 0, direction, status,
-                                       NULL, 128,
+               new_call = create_call(vc, 0, CALL_DIRECTION_MOBILE_TERMINATED,
+                                       status, NULL, 128,
                                        CLIP_VALIDITY_NOT_AVAILABLE, id);
                if (new_call == NULL) {
                        ofono_error("Unable to malloc. "
@@ -199,9 +202,7 @@ static void xcallstat_notify(GAtResult *result, gpointer user_data)
                        return;
                }
 
-               new_call->id = id;
                break;
-       }
        case CALL_STATUS_ALERTING:
        case CALL_STATUS_ACTIVE:
        case CALL_STATUS_HELD:
index b316391..74c6b0d 100644 (file)
@@ -129,6 +129,8 @@ static gboolean fake_file_info(gpointer user)
 }
 
 static void isi_read_file_info(struct ofono_sim *sim, int fileid,
+                               const unsigned char *path,
+                               unsigned int path_len,
                                ofono_sim_file_info_cb_t cb, void *data)
 {
        int i;
@@ -246,6 +248,8 @@ static gboolean isi_read_iccid(struct ofono_sim *sim, struct isi_cb_data *cbd)
 
 static void isi_read_file_transparent(struct ofono_sim *sim, int fileid,
                                        int start, int length,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_read_cb_t cb, void *data)
 {
        struct isi_cb_data *cbd;
@@ -280,6 +284,8 @@ error:
 
 static void isi_read_file_linear(struct ofono_sim *sim, int fileid,
                                        int record, int length,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_read_cb_t cb, void *data)
 {
        DBG("Fileid %04X not implemented", fileid);
@@ -288,6 +294,8 @@ static void isi_read_file_linear(struct ofono_sim *sim, int fileid,
 
 static void isi_read_file_cyclic(struct ofono_sim *sim, int fileid,
                                        int record, int length,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_read_cb_t cb, void *data)
 {
        DBG("Fileid %04X not implemented", fileid);
@@ -297,6 +305,8 @@ static void isi_read_file_cyclic(struct ofono_sim *sim, int fileid,
 static void isi_write_file_transparent(struct ofono_sim *sim, int fileid,
                                        int start, int length,
                                        const unsigned char *value,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_write_cb_t cb, void *data)
 {
        DBG("Fileid %04X not implemented", fileid);
@@ -306,6 +316,8 @@ static void isi_write_file_transparent(struct ofono_sim *sim, int fileid,
 static void isi_write_file_linear(struct ofono_sim *sim, int fileid,
                                        int record, int length,
                                        const unsigned char *value,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_write_cb_t cb, void *data)
 {
        DBG("Fileid %04X not implemented", fileid);
@@ -314,6 +326,8 @@ static void isi_write_file_linear(struct ofono_sim *sim, int fileid,
 
 static void isi_write_file_cyclic(struct ofono_sim *sim, int fileid,
                                        int length, const unsigned char *value,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_write_cb_t cb, void *data)
 {
        DBG("Fileid %04X not implemented", fileid);
index 1d7ef21..0a5121d 100644 (file)
@@ -395,6 +395,8 @@ static gboolean send_uicc_read_file_info(GIsiClient *client, uint8_t app_id,
 }
 
 static void uicc_read_file_info(struct ofono_sim *sim, int fileid,
+                               const unsigned char *path,
+                               unsigned int path_len,
                                ofono_sim_file_info_cb_t cb, void *data)
 {
        struct uicc_sim_data *sd = ofono_sim_get_data(sim);
@@ -531,6 +533,8 @@ static gboolean send_uicc_read_file_transparent(GIsiClient *client,
 
 static void uicc_read_file_transparent(struct ofono_sim *sim, int fileid,
                                        int start, int length,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_read_cb_t cb, void *data)
 {
        struct uicc_sim_data *sd = ofono_sim_get_data(sim);
@@ -653,8 +657,10 @@ static gboolean send_uicc_read_file_linear(GIsiClient *client, uint8_t app_id,
 }
 
 static void uicc_read_file_linear(struct ofono_sim *sim, int fileid, int record,
-                                       int rec_length, ofono_sim_read_cb_t cb,
-                                       void *data)
+                                       int rec_length,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
+                                       ofono_sim_read_cb_t cb, void *data)
 {
        struct uicc_sim_data *sd = ofono_sim_get_data(sim);
        struct isi_cb_data *cbd = isi_cb_data_new(sim, cb, data);
@@ -686,6 +692,8 @@ error:
 
 static void uicc_read_file_cyclic(struct ofono_sim *sim, int fileid,
                                        int record, int length,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_read_cb_t cb, void *data)
 {
        DBG("Not implemented");
@@ -695,6 +703,8 @@ static void uicc_read_file_cyclic(struct ofono_sim *sim, int fileid,
 static void uicc_write_file_transparent(struct ofono_sim *sim, int fileid,
                                        int start, int length,
                                        const unsigned char *value,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_write_cb_t cb, void *data)
 {
        DBG("Not implemented");
@@ -703,14 +713,19 @@ static void uicc_write_file_transparent(struct ofono_sim *sim, int fileid,
 
 static void uicc_write_file_linear(struct ofono_sim *sim, int fileid, int record,
                                        int length, const unsigned char *value,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_write_cb_t cb, void *data)
 {
        DBG("Not implemented");
        CALLBACK_WITH_FAILURE(cb, data);
 }
 
-static void uicc_write_file_cyclic(struct ofono_sim *sim, int fileid, int length,
+static void uicc_write_file_cyclic(struct ofono_sim *sim, int fileid,
+                                       int length,
                                        const unsigned char *value,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
                                        ofono_sim_write_cb_t cb, void *data)
 {
        DBG("Not implemented");
index 2f38f68..460e34e 100644 (file)
@@ -1504,7 +1504,17 @@ static void isi_dial(struct ofono_voicecall *ovc,
 static void isi_answer(struct ofono_voicecall *ovc, ofono_voicecall_cb_t cb,
                        void *data)
 {
-       isi_call_answer_req(ovc, CALL_ID_ALL, cb, data);
+       struct isi_voicecall *ivc = ofono_voicecall_get_data(ovc);
+       int id;
+
+       for (id = 1; id <= 7; id++)
+               if (ivc->calls[id].status == CALL_STATUS_MT_ALERTING)
+                       goto answer_by_id;
+
+       id = CALL_ID_ALL;
+
+answer_by_id:
+       isi_call_answer_req(ovc, id, cb, data);
 }
 
 static void isi_hangup_current(struct ofono_voicecall *ovc,
index dd80f89..3389bb1 100644 (file)
@@ -327,6 +327,8 @@ static const char *__service_type_to_string(uint8_t type)
                return "TS";
        case QMI_SERVICE_TMD:
                return "TMS";
+       case QMI_SERVICE_PDC:
+               return "PDC";
        case QMI_SERVICE_CAT_OLD:
                return "CAT";
        case QMI_SERVICE_RMS:
@@ -338,6 +340,103 @@ static const char *__service_type_to_string(uint8_t type)
        return NULL;
 }
 
+static const struct {
+       uint16_t err;
+       const char *str;
+} __error_table[] = {
+       { 0x0000, "NONE"                        },
+       { 0x0001, "MALFORMED_MSG"               },
+       { 0x0002, "NO_MEMORY"                   },
+       { 0x0003, "INTERNAL"                    },
+       { 0x0004, "ABORTED"                     },
+       { 0x0005, "CLIENT_IDS_EXHAUSTED"        },
+       { 0x0006, "UNABORTABLE_TRANSACTION"     },
+       { 0x0007, "INVALID_CLIENT_ID"           },
+       { 0x0008, "NO_THRESHOLDS"               },
+       { 0x0009, "INVALID_HANDLE"              },
+       { 0x000a, "INVALID_PROFILE"             },
+       { 0x000b, "INVALID_PINID"               },
+       { 0x000c, "INCORRECT_PIN"               },
+       { 0x000d, "NO_NETWORK_FOUND"            },
+       { 0x000e, "CALL_FAILED"                 },
+       { 0x000f, "OUT_OF_CALL"                 },
+       { 0x0010, "NOT_PROVISIONED"             },
+       { 0x0011, "MISSING_ARG"                 },
+       { 0x0013, "ARG_TOO_LONG"                },
+       { 0x0016, "INVALID_TX_ID"               },
+       { 0x0017, "DEVICE_IN_USE"               },
+       { 0x0018, "OP_NETWORK_UNSUPPORTED"      },
+       { 0x0019, "OP_DEVICE_UNSUPPORTED"       },
+       { 0x001a, "NO_EFFECT"                   },
+       { 0x001b, "NO_FREE_PROFILE"             },
+       { 0x001c, "INVALID_PDP_TYPE"            },
+       { 0x001d, "INVALID_TECH_PREF"           },
+       { 0x001e, "INVALID_PROFILE_TYPE"        },
+       { 0x001f, "INVALID_SERVICE_TYPE"        },
+       { 0x0020, "INVALID_REGISTER_ACTION"     },
+       { 0x0021, "INVALID_PS_ATTACH_ACTION"    },
+       { 0x0022, "AUTHENTICATION_FAILED"       },
+       { 0x0023, "PIN_BLOCKED"                 },
+       { 0x0024, "PIN_PERM_BLOCKED"            },
+       { 0x0025, "UIM_NOT_INITIALIZED"         },
+       { 0x0026, "MAX_QOS_REQUESTS_IN_USE"     },
+       { 0x0027, "INCORRECT_FLOW_FILTER"       },
+       { 0x0028, "NETWORK_QOS_UNAWARE"         },
+       { 0x0029, "INVALID_QOS_ID/INVALID_ID"   },
+       { 0x002a, "REQUESTED_NUM_UNSUPPORTED"   },
+       { 0x002b, "INTERFACE_NOT_FOUND"         },
+       { 0x002c, "FLOW_SUSPENDED"              },
+       { 0x002d, "INVALID_DATA_FORMAT"         },
+       { 0x002e, "GENERAL"                     },
+       { 0x002f, "UNKNOWN"                     },
+       { 0x0030, "INVALID_ARG"                 },
+       { 0x0031, "INVALID_INDEX"               },
+       { 0x0032, "NO_ENTRY"                    },
+       { 0x0033, "DEVICE_STORAGE_FULL"         },
+       { 0x0034, "DEVICE_NOT_READY"            },
+       { 0x0035, "NETWORK_NOT_READY"           },
+       { 0x0036, "CAUSE_CODE"                  },
+       { 0x0037, "MESSAGE_NOT_SENT"            },
+       { 0x0038, "MESSAGE_DELIVERY_FAILURE"    },
+       { 0x0039, "INVALID_MESSAGE_ID"          },
+       { 0x003a, "ENCODING"                    },
+       { 0x003b, "AUTHENTICATION_LOCK"         },
+       { 0x003c, "INVALID_TRANSACTION"         },
+       { 0x0041, "SESSION_INACTIVE"            },
+       { 0x0042, "SESSION_INVALID"             },
+       { 0x0043, "SESSION_OWNERSHIP"           },
+       { 0x0044, "INSUFFICIENT_RESOURCES"      },
+       { 0x0045, "DISABLED"                    },
+       { 0x0046, "INVALID_OPERATION"           },
+       { 0x0047, "INVALID_QMI_CMD"             },
+       { 0x0048, "TPDU_TYPE"                   },
+       { 0x0049, "SMSC_ADDR"                   },
+       { 0x004a, "INFO_UNAVAILABLE"            },
+       { 0x004b, "SEGMENT_TOO_LONG"            },
+       { 0x004c, "SEGEMENT_ORDER"              },
+       { 0x004d, "BUNDLING_NOT_SUPPORTED"      },
+       { 0x004f, "POLICY_MISMATCH"             },
+       { 0x0050, "SIM_FILE_NOT_FOUND"          },
+       { 0x0051, "EXTENDED_INTERNAL"           },
+       { 0x0052, "ACCESS_DENIED"               },
+       { 0x0053, "HARDWARE_RESTRICTED"         },
+       { 0x0054, "ACK_NOT_SENT"                },
+       { 0x0055, "INJECT_TIMEOUT"              },
+       { }
+};
+
+static const char *__error_to_string(uint16_t error)
+{
+       int i;
+
+       for (i = 0; __error_table[i].str; i++) {
+               if (__error_table[i].err == error)
+                       return __error_table[i].str;
+       }
+
+       return NULL;
+}
+
 static void __debug_msg(const char dir, const void *buf, size_t len,
                                qmi_debug_func_t function, void *user_data)
 {
@@ -347,6 +446,7 @@ static void __debug_msg(const char dir, const void *buf, size_t len,
        const void *ptr;
        uint16_t offset;
        char strbuf[72 + 16], *str;
+       bool pending_print = false;
 
        if (!function || !len)
                return;
@@ -442,25 +542,36 @@ static void __debug_msg(const char dir, const void *buf, size_t len,
                if (tlv->type == 0x02 && tlv_length == QMI_RESULT_CODE_SIZE) {
                        const struct qmi_result_code *result = ptr + offset +
                                                        QMI_TLV_HDR_SIZE;
-
-                       str += sprintf(str, " {type=%d,error=%d}", tlv->type,
-                                               GUINT16_FROM_LE(result->error));
+                       uint16_t error = GUINT16_FROM_LE(result->error);
+                       const char *error_str;
+
+                       error_str = __error_to_string(error);
+                       if (error_str)
+                               str += sprintf(str, " {type=%d,error=%s}",
+                                                       tlv->type, error_str);
+                       else
+                               str += sprintf(str, " {type=%d,error=%d}",
+                                                       tlv->type, error);
                } else {
                        str += sprintf(str, " {type=%d,len=%d}", tlv->type,
                                                                tlv_length);
                }
 
-               if (str - strbuf > 72) {
+               if (str - strbuf > 60) {
                        function(strbuf, user_data);
 
                        str = strbuf;
                        str += sprintf(str, "      ");
-               }
+
+                       pending_print = false;
+               } else
+                       pending_print = true;
 
                offset += QMI_TLV_HDR_SIZE + tlv_length;
        }
 
-       function(strbuf, user_data);
+       if (pending_print)
+               function(strbuf, user_data);
 }
 
 static void __debug_device(struct qmi_device *device,
@@ -925,6 +1036,7 @@ static void discover_callback(uint16_t message, uint16_t length,
                uint16_t minor =
                        GUINT16_FROM_LE(service_list->services[i].minor);
                uint8_t type = service_list->services[i].type;
+               const char *name = __service_type_to_string(type);
 
                if (type == QMI_SERVICE_CONTROL) {
                        device->control_major = major;
@@ -935,9 +1047,16 @@ static void discover_callback(uint16_t message, uint16_t length,
                list[count].type = type;
                list[count].major = major;
                list[count].minor = minor;
-               list[count].name = __service_type_to_string(type);
+               list[count].name = name;
 
                count++;
+
+               if (name)
+                       __debug_device(device, "found service [%s %d.%d]",
+                                                       name, major, minor);
+               else
+                       __debug_device(device, "found service [%d %d.%d]",
+                                                       type, major, minor);
        }
 
        ptr = tlv_get(buffer, length, 0x10, &len);
@@ -1262,6 +1381,17 @@ bool qmi_result_set_error(struct qmi_result *result, uint16_t *error)
        return true;
 }
 
+const char *qmi_result_get_error(struct qmi_result *result)
+{
+       if (!result)
+               return NULL;
+
+       if (result->result == 0x0000)
+               return NULL;
+
+       return __error_to_string(result->error);
+}
+
 const void *qmi_result_get(struct qmi_result *result, uint8_t type,
                                                        uint16_t *length)
 {
index 81cfac9..dca115c 100644 (file)
@@ -42,6 +42,7 @@
 #define QMI_SERVICE_EFS                21      /* Embedded file system service */
 #define QMI_SERVICE_TS         23      /* Thermal sensors service */
 #define QMI_SERVICE_TMD                24      /* Thermal mitigation device service */
+#define QMI_SERVICE_PDC                36      /* Persistent device configuration service */
 #define QMI_SERVICE_CAT_OLD    224     /* Card application toolkit service */
 #define QMI_SERVICE_RMS                225     /* Remote management service */
 #define QMI_SERVICE_OMA                226     /* OMA device management service */
@@ -104,6 +105,7 @@ struct qmi_param *qmi_param_new_uint32(uint8_t type, uint32_t value);
 struct qmi_result;
 
 bool qmi_result_set_error(struct qmi_result *result, uint16_t *error);
+const char *qmi_result_get_error(struct qmi_result *result);
 
 const void *qmi_result_get(struct qmi_result *result, uint8_t type,
                                                        uint16_t *length);
index 170e84c..959a901 100644 (file)
@@ -34,6 +34,7 @@ static int qmimodem_init(void)
        qmi_netreg_init();
        qmi_voicecall_init();
        qmi_sim_legacy_init();
+       qmi_sim_init();
        qmi_sms_init();
        qmi_ussd_init();
        qmi_gprs_init();
@@ -52,6 +53,7 @@ static void qmimodem_exit(void)
        qmi_gprs_exit();
        qmi_ussd_exit();
        qmi_sms_exit();
+       qmi_sim_exit();
        qmi_sim_legacy_exit();
        qmi_voicecall_exit();
        qmi_netreg_exit();
index 74edf89..1fc8682 100644 (file)
@@ -33,6 +33,9 @@ extern void qmi_voicecall_exit(void);
 extern void qmi_sim_legacy_init(void);
 extern void qmi_sim_legacy_exit(void);
 
+extern void qmi_sim_init(void);
+extern void qmi_sim_exit(void);
+
 extern void qmi_sms_init(void);
 extern void qmi_sms_exit(void);
 
index 3435bec..318b1ae 100644 (file)
@@ -42,6 +42,8 @@ struct sim_data {
 };
 
 static void qmi_read_file_info(struct ofono_sim *sim, int fileid,
+                               const unsigned char *path,
+                               unsigned int path_len,
                                ofono_sim_file_info_cb_t cb, void *user_data)
 {
        unsigned char access[3] = { 0x0f, 0xff, 0xff };
@@ -94,8 +96,10 @@ static void get_iccid_cb(struct qmi_result *result, void *user_data)
 }
 
 static void qmi_read_file_transparent(struct ofono_sim *sim,
-                               int fileid, int start, int length,
-                               ofono_sim_read_cb_t cb, void *user_data)
+                                       int fileid, int start, int length,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
+                                       ofono_sim_read_cb_t cb, void *user_data)
 {
        struct sim_data *data = ofono_sim_get_data(sim);
        struct cb_data *cbd = cb_data_new(cb, user_data);
diff --git a/drivers/qmimodem/sim.c b/drivers/qmimodem/sim.c
new file mode 100644 (file)
index 0000000..6c121c2
--- /dev/null
@@ -0,0 +1,530 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2008-2012  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+
+#include <ofono/log.h>
+#include <ofono/modem.h>
+#include <ofono/sim.h>
+
+#include "qmi.h"
+#include "uim.h"
+
+#include "qmimodem.h"
+#include "simutil.h"
+
+#define EF_STATUS_INVALIDATED 0
+#define EF_STATUS_VALID 1
+
+struct sim_data {
+       struct qmi_service *uim;
+       uint32_t event_mask;
+       uint8_t card_state;
+       uint8_t app_type;
+       uint8_t passwd_state;
+       int retries[OFONO_SIM_PASSWORD_INVALID];
+};
+
+static int create_fileid_data(uint8_t app_type, int fileid,
+                                       const unsigned char *path,
+                                       unsigned int path_len,
+                                       unsigned char *fileid_data)
+{
+       unsigned char db_path[6];
+       unsigned int len;
+
+       if (path_len > 0) {
+               memcpy(db_path, path, path_len);
+               len = path_len;
+       } else {
+               switch (app_type) {
+               case 0x01:      /* SIM card */
+                       len = sim_ef_db_get_path_2g(fileid, db_path);
+                       break;
+               case 0x02:      /* USIM application */
+                       len = sim_ef_db_get_path_3g(fileid, db_path);
+                       break;
+               default:
+                       len = 0;
+                       break;
+               }
+       }
+
+       /* Minimum length of path is 2 bytes */
+       if (len < 2)
+               return -1;
+
+       fileid_data[0] = fileid & 0xff;
+       fileid_data[1] = (fileid & 0xff00) >> 8;
+       fileid_data[2] = len;
+       fileid_data[3] = db_path[1];
+       fileid_data[4] = db_path[0];
+       fileid_data[5] = db_path[3];
+       fileid_data[6] = db_path[2];
+       fileid_data[7] = db_path[5];
+       fileid_data[8] = db_path[4];
+
+       return len + 3;
+}
+
+static void get_file_attributes_cb(struct qmi_result *result, void *user_data)
+{
+        struct cb_data *cbd = user_data;
+       ofono_sim_file_info_cb_t cb = cbd->cb;
+       struct sim_data *data = ofono_sim_get_data(cbd->user);
+       const struct qmi_uim_file_attributes *attr;
+       uint16_t len, raw_len;
+       int flen, rlen, str;
+       unsigned char access[3];
+       unsigned char file_status;
+       gboolean ok;
+
+       DBG("");
+
+       if (qmi_result_set_error(result, NULL))
+               goto error;
+
+       attr = qmi_result_get(result, 0x11, &len);
+       if (!attr)
+               goto error;
+
+       raw_len = GUINT16_FROM_LE(attr->raw_len);
+
+       switch (data->app_type) {
+       case 0x01:      /* SIM card */
+               ok = sim_parse_2g_get_response(attr->raw_value, raw_len,
+                               &flen, &rlen, &str, access, &file_status);
+               break;
+       case 0x02:      /* USIM application */
+               ok = sim_parse_3g_get_response(attr->raw_value, raw_len,
+                                        &flen, &rlen, &str, access, NULL);
+               file_status = EF_STATUS_VALID;
+               break;
+       default:
+               ok = FALSE;
+               break;
+       }
+
+       if (ok) {
+               CALLBACK_WITH_SUCCESS(cb, flen, str, rlen, access,
+                                               file_status, cbd->data);
+               return;
+       }
+
+error:
+       CALLBACK_WITH_FAILURE(cb, -1, -1, -1, NULL,
+                                       EF_STATUS_INVALIDATED, cbd->data);
+}
+
+static void qmi_read_attributes(struct ofono_sim *sim, int fileid,
+                               const unsigned char *path,
+                               unsigned int path_len,
+                               ofono_sim_file_info_cb_t cb, void *user_data)
+{
+       struct sim_data *data = ofono_sim_get_data(sim);
+       struct cb_data *cbd = cb_data_new(cb, user_data);
+       unsigned char aid_data[2] = { 0x06, 0x00 };
+       unsigned char fileid_data[9];
+       int fileid_len;
+       struct qmi_param *param;
+
+       DBG("file id 0x%04x path len %d", fileid, path_len);
+
+       cbd->user = sim;
+
+       fileid_len = create_fileid_data(data->app_type, fileid,
+                                               path, path_len, fileid_data);
+       if (fileid_len < 0)
+               goto error;
+
+       param = qmi_param_new();
+       if (!param)
+               goto error;
+
+       qmi_param_append(param, 0x01, sizeof(aid_data), aid_data);
+       qmi_param_append(param, 0x02, fileid_len, fileid_data);
+
+       if (qmi_service_send(data->uim, QMI_UIM_GET_FILE_ATTRIBUTES, param,
+                               get_file_attributes_cb, cbd, g_free) > 0)
+               return;
+
+       qmi_param_free(param);
+
+error:
+       CALLBACK_WITH_FAILURE(cb, -1, -1, -1, NULL,
+                                       EF_STATUS_INVALIDATED, cbd->data);
+
+       g_free(cbd);
+}
+
+static void read_generic_cb(struct qmi_result *result, void *user_data)
+{
+        struct cb_data *cbd = user_data;
+       ofono_sim_read_cb_t cb = cbd->cb;
+       const unsigned char *content;
+       uint16_t len;
+
+       DBG("");
+
+       if (qmi_result_set_error(result, NULL)) {
+               CALLBACK_WITH_FAILURE(cb, NULL, 0, cbd->data);
+               return;
+       }
+
+       content = qmi_result_get(result, 0x11, &len);
+       if (!content) {
+               CALLBACK_WITH_FAILURE(cb, NULL, 0, cbd->data);
+               return;
+       }
+
+       CALLBACK_WITH_SUCCESS(cb, content + 2, len - 2, cbd->data);
+}
+
+static void qmi_read_transparent(struct ofono_sim *sim,
+                               int fileid, int start, int length,
+                               const unsigned char *path,
+                               unsigned int path_len,
+                               ofono_sim_read_cb_t cb, void *user_data)
+{
+       struct sim_data *data = ofono_sim_get_data(sim);
+       struct cb_data *cbd = cb_data_new(cb, user_data);
+       unsigned char aid_data[2] = { 0x06, 0x00 };
+       unsigned char read_data[4];
+       unsigned char fileid_data[9];
+       int fileid_len;
+       struct qmi_param *param;
+
+       DBG("file id 0x%04x path len %d", fileid, path_len);
+
+       fileid_len = create_fileid_data(data->app_type, fileid,
+                                               path, path_len, fileid_data);
+       if (fileid_len < 0)
+               goto error;
+
+       read_data[0] = start & 0xff;
+       read_data[1] = (start & 0xff00) >> 8;
+       read_data[2] = length & 0xff;
+       read_data[3] = (length & 0xff00) >> 8;
+
+       param = qmi_param_new();
+       if (!param)
+               goto error;
+
+       qmi_param_append(param, 0x01, sizeof(aid_data), aid_data);
+       qmi_param_append(param, 0x02, fileid_len, fileid_data);
+       qmi_param_append(param, 0x03, sizeof(read_data), read_data);
+
+       if (qmi_service_send(data->uim, QMI_UIM_READ_TRANSPARENT, param,
+                                       read_generic_cb, cbd, g_free) > 0)
+               return;
+
+       qmi_param_free(param);
+
+error:
+       CALLBACK_WITH_FAILURE(cb, NULL, 0, user_data);
+
+       g_free(cbd);
+}
+
+static void qmi_read_record(struct ofono_sim *sim,
+                               int fileid, int record, int length,
+                               const unsigned char *path,
+                               unsigned int path_len,
+                               ofono_sim_read_cb_t cb, void *user_data)
+{
+       struct sim_data *data = ofono_sim_get_data(sim);
+       struct cb_data *cbd = cb_data_new(cb, user_data);
+       unsigned char aid_data[2] = { 0x06, 0x00 };
+       unsigned char read_data[4];
+       unsigned char fileid_data[9];
+       int fileid_len;
+       struct qmi_param *param;
+
+       DBG("file id 0x%04x path len %d", fileid, path_len);
+
+       fileid_len = create_fileid_data(data->app_type, fileid,
+                                               path, path_len, fileid_data);
+       if (fileid_len < 0)
+               goto error;
+
+       read_data[0] = record & 0xff;
+       read_data[1] = (record & 0xff00) >> 8;
+       read_data[2] = length & 0xff;
+       read_data[3] = (length & 0xff00) >> 8;
+
+       param = qmi_param_new();
+       if (!param)
+               goto error;
+
+       qmi_param_append(param, 0x01, sizeof(aid_data), aid_data);
+       qmi_param_append(param, 0x02, fileid_len, fileid_data);
+       qmi_param_append(param, 0x03, sizeof(read_data), read_data);
+
+       if (qmi_service_send(data->uim, QMI_UIM_READ_RECORD, param,
+                                       read_generic_cb, cbd, g_free) > 0)
+               return;
+
+       qmi_param_free(param);
+
+error:
+       CALLBACK_WITH_FAILURE(cb, NULL, 0, user_data);
+
+       g_free(cbd);
+}
+
+static void qmi_query_passwd_state(struct ofono_sim *sim,
+                               ofono_sim_passwd_cb_t cb, void *user_data)
+{
+       struct sim_data *data = ofono_sim_get_data(sim);
+
+       DBG("passwd state %d", data->passwd_state);
+
+       if (data->passwd_state == OFONO_SIM_PASSWORD_INVALID) {
+               CALLBACK_WITH_FAILURE(cb, -1, user_data);
+               return;
+       }
+
+       CALLBACK_WITH_SUCCESS(cb, data->passwd_state, user_data);
+}
+
+static void qmi_query_pin_retries(struct ofono_sim *sim,
+                               ofono_sim_pin_retries_cb_t cb, void *user_data)
+{
+       struct sim_data *data = ofono_sim_get_data(sim);
+
+       DBG("passwd state %d", data->passwd_state);
+
+       if (data->passwd_state == OFONO_SIM_PASSWORD_INVALID) {
+               CALLBACK_WITH_FAILURE(cb, NULL, user_data);
+               return;
+       }
+
+       CALLBACK_WITH_SUCCESS(cb, data->retries, user_data);
+}
+
+static void card_setup(const struct qmi_uim_slot_info *slot,
+                                       const struct qmi_uim_app_info1 *info1,
+                                       const struct qmi_uim_app_info2 *info2,
+                                                       struct sim_data *data)
+{
+       data->card_state = slot->card_state;
+       data->app_type = info1->app_type;
+
+       switch (info1->app_state) {
+       case 0x02:      /* PIN1 or UPIN is required */
+               data->passwd_state = OFONO_SIM_PASSWORD_SIM_PIN;
+               break;
+       case 0x03:      /* PUK1 or PUK for UPIN is required */
+               data->passwd_state = OFONO_SIM_PASSWORD_SIM_PUK;
+               break;
+       case 0x07:      /* Ready */
+               data->passwd_state = OFONO_SIM_PASSWORD_NONE;
+               break;
+       default:
+               data->passwd_state = OFONO_SIM_PASSWORD_INVALID;
+               break;
+       }
+
+       data->retries[OFONO_SIM_PASSWORD_SIM_PIN] = info2->pin1_retries;
+       data->retries[OFONO_SIM_PASSWORD_SIM_PUK] = info2->puk1_retries;
+
+       data->retries[OFONO_SIM_PASSWORD_SIM_PIN2] = info2->pin2_retries;
+       data->retries[OFONO_SIM_PASSWORD_SIM_PUK2] = info2->puk2_retries;
+}
+
+static void get_card_status_cb(struct qmi_result *result, void *user_data)
+{
+       struct ofono_sim *sim = user_data;
+       struct sim_data *data = ofono_sim_get_data(sim);
+       const void *ptr;
+       const struct qmi_uim_card_status *status;
+       uint16_t len, offset;
+       uint8_t i;
+
+       DBG("");
+
+       if (qmi_result_set_error(result, NULL))
+               goto done;
+
+       ptr = qmi_result_get(result, QMI_UIM_RESULT_CARD_STATUS, &len);
+       if (!ptr)
+               goto done;
+
+       status = ptr;
+       offset = sizeof(struct qmi_uim_card_status);
+
+       for (i = 0; i < status->num_slot; i++) {
+               const struct qmi_uim_slot_info *slot;
+               uint8_t n;
+
+               slot = ptr + offset;
+               offset += sizeof(struct qmi_uim_slot_info);
+
+               for (n = 0; n < slot->num_app; n++) {
+                       const struct qmi_uim_app_info1 *info1;
+                       const struct qmi_uim_app_info2 *info2;
+                       uint16_t index;
+
+                       info1 = ptr + offset;
+                       offset += sizeof(struct qmi_uim_app_info1);
+                       offset += info1->aid_len;
+
+                       info2 = ptr + offset;
+                       offset += sizeof(struct qmi_uim_app_info2);
+
+                       index = GUINT16_FROM_LE(status->index_gw_pri);
+
+                       if ((index & 0xff) == i && (index >> 8) == n)
+                               card_setup(slot, info1, info2, data);
+               }
+       }
+
+done:
+       ofono_sim_register(sim);
+
+       switch (data->card_state) {
+       case 0x00:      /* Absent */
+       case 0x02:      /* Error */
+               break;
+       case 0x01:      /* Present */
+               ofono_sim_inserted_notify(sim, TRUE);
+               break;
+       }
+}
+
+static void event_registration_cb(struct qmi_result *result, void *user_data)
+{
+       struct ofono_sim *sim = user_data;
+       struct sim_data *data = ofono_sim_get_data(sim);
+
+       DBG("");
+
+       if (qmi_result_set_error(result, NULL))
+               goto error;
+
+       if (!qmi_result_get_uint32(result, QMI_UIM_RESULT_EVENT_MASK,
+                                                       &data->event_mask))
+               goto error;
+
+       DBG("event mask 0x%04x", data->event_mask);
+
+       if (qmi_service_send(data->uim, QMI_UIM_GET_CARD_STATUS, NULL,
+                                       get_card_status_cb, sim, NULL) > 0)
+               return;
+
+error:
+       ofono_sim_remove(sim);
+}
+
+
+static void create_uim_cb(struct qmi_service *service, void *user_data)
+{
+       struct ofono_sim *sim = user_data;
+       struct sim_data *data = ofono_sim_get_data(sim);
+       struct qmi_param *param;
+       uint32_t mask = 0x0003;
+
+       DBG("");
+
+       if (!service) {
+               ofono_error("Failed to request UIM service");
+               goto error;
+       }
+
+       data->uim = qmi_service_ref(service);
+
+       param = qmi_param_new_uint32(QMI_UIM_PARAM_EVENT_MASK, mask);
+       if (!param)
+               goto error;
+
+       if (qmi_service_send(data->uim, QMI_UIM_EVENT_REGISTRATION, param,
+                                       event_registration_cb, sim, NULL) > 0)
+               return;
+
+error:
+       qmi_service_unref(data->uim);
+
+       ofono_sim_remove(sim);
+}
+
+static int qmi_sim_probe(struct ofono_sim *sim,
+                               unsigned int vendor, void *user_data)
+{
+       struct qmi_device *device = user_data;
+       struct sim_data *data;
+       int i;
+
+       DBG("");
+
+       data = g_new0(struct sim_data, 1);
+
+       data->passwd_state = OFONO_SIM_PASSWORD_INVALID;
+
+       for (i = 0; i < OFONO_SIM_PASSWORD_INVALID; i++)
+               data->retries[i] = -1;
+
+       ofono_sim_set_data(sim, data);
+
+       qmi_service_create(device, QMI_SERVICE_UIM, create_uim_cb, sim, NULL);
+
+       return 0;
+}
+
+static void qmi_sim_remove(struct ofono_sim *sim)
+{
+       struct sim_data *data = ofono_sim_get_data(sim);
+
+       DBG("");
+
+       ofono_sim_set_data(sim, NULL);
+
+       qmi_service_unregister_all(data->uim);
+
+       qmi_service_unref(data->uim);
+
+       g_free(data);
+}
+
+static struct ofono_sim_driver driver = {
+       .name                   = "qmimodem",
+       .probe                  = qmi_sim_probe,
+       .remove                 = qmi_sim_remove,
+       .read_file_info         = qmi_read_attributes,
+       .read_file_transparent  = qmi_read_transparent,
+       .read_file_linear       = qmi_read_record,
+       .read_file_cyclic       = qmi_read_record,
+       .query_passwd_state     = qmi_query_passwd_state,
+       .query_pin_retries      = qmi_query_pin_retries,
+};
+
+void qmi_sim_init(void)
+{
+       ofono_sim_driver_register(&driver);
+}
+
+void qmi_sim_exit(void)
+{
+       ofono_sim_driver_unregister(&driver);
+}
diff --git a/drivers/qmimodem/uim.h b/drivers/qmimodem/uim.h
new file mode 100644 (file)
index 0000000..8f123e7
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2008-2012  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#define QMI_UIM_READ_TRANSPARENT       32      /* Read data */
+#define QMI_UIM_READ_RECORD            33      /* Read one or more records */
+#define QMI_UIM_WRITE_TRANSPARENT      34      /* Write data */
+#define QMI_UIM_WRITE_RECORD           35      /* Write a record */
+#define QMI_UIM_GET_FILE_ATTRIBUTES    36      /* Get file attributes */
+
+#define QMI_UIM_EVENT_REGISTRATION     46      /* Register for indications */
+#define QMI_UIM_GET_CARD_STATUS                47      /* Get card status */
+
+
+/* Register for indications */
+#define QMI_UIM_PARAM_EVENT_MASK       0x01    /* uint32 */
+#define QMI_UIM_RESULT_EVENT_MASK      0x10    /* uint32 */
+
+#define QMI_UIM_RESULT_CARD_STATUS     0x10
+struct qmi_uim_card_status {
+       uint16_t index_gw_pri;
+       uint16_t index_1x_pri;
+       uint16_t index_gw_sec;
+       uint16_t index_1x_sec;
+       uint8_t num_slot;
+} __attribute__((__packed__));
+
+struct qmi_uim_slot_info {
+       uint8_t card_state;
+       uint8_t upin_state;
+       uint8_t upin_retries;
+       uint8_t upuk_retries;
+       uint8_t error_code;
+       uint8_t num_app;
+} __attribute__((__packed__));
+
+struct qmi_uim_app_info1 {
+       uint8_t app_type;
+       uint8_t app_state;
+       uint8_t perso_state;
+       uint8_t perso_feature;
+       uint8_t perso_retries;
+       uint8_t perso_unblock_retries;
+       uint8_t aid_len;
+       uint8_t aid_value[0];
+} __attribute__((__packed__));
+
+struct qmi_uim_app_info2 {
+       uint8_t univ_pin;
+       uint8_t pin1_state;
+       uint8_t pin1_retries;
+       uint8_t puk1_retries;
+       uint8_t pin2_state;
+       uint8_t pin2_retries;
+       uint8_t puk2_retries;
+} __attribute__((__packed__));
+
+struct qmi_uim_file_attributes {
+       uint16_t file_size;
+       uint16_t file_id;
+       uint8_t file_type;
+       uint16_t rec_size;
+       uint16_t rec_count;
+       uint8_t sec_read;
+       uint16_t sec_read_mask;
+       uint8_t sec_write;
+       uint16_t sec_write_mask;
+       uint8_t sec_increase;
+       uint16_t sec_increase_mask;
+       uint8_t sec_deactivate;
+       uint16_t sec_deactivate_mask;
+       uint8_t sec_activate;
+       uint16_t sec_activate_mask;
+       uint16_t raw_len;
+       uint8_t raw_value[0];
+} __attribute__((__packed__));
index c57c618..82c5ef1 100644 (file)
@@ -6,6 +6,7 @@ After=syslog.target
 Type=dbus
 BusName=org.ofono.dundee
 ExecStart=@prefix@/sbin/dundee -n
+StandardError=null
 
 [Install]
 WantedBy=multi-user.target
diff --git a/gdbus/client.c b/gdbus/client.c
new file mode 100644 (file)
index 0000000..4709cdd
--- /dev/null
@@ -0,0 +1,1140 @@
+/*
+ *
+ *  D-Bus helper library
+ *
+ *  Copyright (C) 2004-2011  Marcel Holtmann <marcel@holtmann.org>
+ *
+ *
+ *  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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <glib.h>
+#include <dbus/dbus.h>
+
+#include "gdbus.h"
+
+#define METHOD_CALL_TIMEOUT (300 * 1000)
+
+struct GDBusClient {
+       gint ref_count;
+       DBusConnection *dbus_conn;
+       char *service_name;
+       char *unique_name;
+       char *base_path;
+       GPtrArray *match_rules;
+       DBusPendingCall *pending_call;
+       GDBusWatchFunction connect_func;
+       void *connect_data;
+       GDBusWatchFunction disconn_func;
+       void *disconn_data;
+       GDBusMessageFunction signal_func;
+       void *signal_data;
+       GDBusProxyFunction proxy_added;
+       GDBusProxyFunction proxy_removed;
+       GDBusPropertyFunction property_changed;
+       void *user_data;
+       GList *proxy_list;
+};
+
+struct GDBusProxy {
+       gint ref_count;
+       GDBusClient *client;
+       char *obj_path;
+       char *interface;
+       GHashTable *prop_list;
+       char *match_rule;
+};
+
+struct prop_entry {
+       char *name;
+       int type;
+       DBusMessage *msg;
+};
+
+static void modify_match_reply(DBusPendingCall *call, void *user_data)
+{
+       DBusMessage *reply = dbus_pending_call_steal_reply(call);
+       DBusError error;
+
+       dbus_error_init(&error);
+
+       if (dbus_set_error_from_message(&error, reply) == TRUE)
+               dbus_error_free(&error);
+
+       dbus_message_unref(reply);
+}
+
+static gboolean modify_match(DBusConnection *conn, const char *member,
+                                                       const char *rule)
+{
+       DBusMessage *msg;
+       DBusPendingCall *call;
+
+       msg = dbus_message_new_method_call(DBUS_SERVICE_DBUS, DBUS_PATH_DBUS,
+                                       DBUS_INTERFACE_DBUS, member);
+       if (msg == NULL)
+               return FALSE;
+
+       dbus_message_append_args(msg, DBUS_TYPE_STRING, &rule,
+                                               DBUS_TYPE_INVALID);
+
+       if (dbus_connection_send_with_reply(conn, msg, &call, -1) == FALSE) {
+               dbus_message_unref(msg);
+               return FALSE;
+       }
+
+       dbus_pending_call_set_notify(call, modify_match_reply, NULL, NULL);
+       dbus_pending_call_unref(call);
+
+       dbus_message_unref(msg);
+
+       return TRUE;
+}
+
+static void iter_append_iter(DBusMessageIter *base, DBusMessageIter *iter)
+{
+       int type;
+
+       type = dbus_message_iter_get_arg_type(iter);
+
+       if (dbus_type_is_basic(type)) {
+               const void *value;
+
+               dbus_message_iter_get_basic(iter, &value);
+               dbus_message_iter_append_basic(base, type, &value);
+       } else if (dbus_type_is_container(type)) {
+               DBusMessageIter iter_sub, base_sub;
+               char *sig;
+
+               dbus_message_iter_recurse(iter, &iter_sub);
+
+               switch (type) {
+               case DBUS_TYPE_ARRAY:
+               case DBUS_TYPE_VARIANT:
+                       sig = dbus_message_iter_get_signature(&iter_sub);
+                       break;
+               default:
+                       sig = NULL;
+                       break;
+               }
+
+               dbus_message_iter_open_container(base, type, sig, &base_sub);
+
+               if (sig != NULL)
+                       dbus_free(sig);
+
+               while (dbus_message_iter_get_arg_type(&iter_sub) !=
+                                                       DBUS_TYPE_INVALID) {
+                       iter_append_iter(&base_sub, &iter_sub);
+                       dbus_message_iter_next(&iter_sub);
+               }
+
+               dbus_message_iter_close_container(base, &base_sub);
+       }
+}
+
+static void prop_entry_update(struct prop_entry *prop, DBusMessageIter *iter)
+{
+       DBusMessage *msg;
+       DBusMessageIter base;
+
+       msg = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN);
+       if (msg == NULL)
+               return;
+
+       dbus_message_iter_init_append(msg, &base);
+       iter_append_iter(&base, iter);
+
+       if (prop->msg != NULL)
+               dbus_message_unref(prop->msg);
+
+       prop->msg = dbus_message_copy(msg);
+       dbus_message_unref(msg);
+}
+
+static struct prop_entry *prop_entry_new(const char *name,
+                                               DBusMessageIter *iter)
+{
+       struct prop_entry *prop;
+
+       prop = g_try_new0(struct prop_entry, 1);
+       if (prop == NULL)
+               return NULL;
+
+       prop->name = g_strdup(name);
+       prop->type = dbus_message_iter_get_arg_type(iter);
+
+       prop_entry_update(prop, iter);
+
+       return prop;
+}
+
+static void prop_entry_free(gpointer data)
+{
+       struct prop_entry *prop = data;
+
+       if (prop->msg != NULL)
+               dbus_message_unref(prop->msg);
+
+       g_free(prop->name);
+
+       g_free(prop);
+}
+
+static GDBusProxy *proxy_lookup(GDBusClient *client, const char *path,
+                                               const char *interface)
+{
+       GList *list;
+
+       for (list = g_list_first(client->proxy_list); list;
+                                               list = g_list_next(list)) {
+               GDBusProxy *proxy = list->data;
+
+               if (g_str_equal(proxy->interface, interface) == TRUE &&
+                               g_str_equal(proxy->obj_path, path) == TRUE)
+                       return proxy;
+        }
+
+       return NULL;
+}
+
+static GDBusProxy *proxy_new(GDBusClient *client, const char *path,
+                                               const char *interface)
+{
+       GDBusProxy *proxy;
+
+       proxy = g_try_new0(GDBusProxy, 1);
+       if (proxy == NULL)
+               return NULL;
+
+       proxy->client = client;
+       proxy->obj_path = g_strdup(path);
+       proxy->interface = g_strdup(interface);
+
+       proxy->prop_list = g_hash_table_new_full(g_str_hash, g_str_equal,
+                                                       NULL, prop_entry_free);
+
+       proxy->match_rule = g_strdup_printf("type='signal',"
+                               "sender='%s',path='%s',interface='%s',"
+                               "member='PropertiesChanged',arg0='%s'",
+                               client->service_name, proxy->obj_path,
+                               DBUS_INTERFACE_PROPERTIES, proxy->interface);
+
+       modify_match(client->dbus_conn, "AddMatch", proxy->match_rule);
+
+       return g_dbus_proxy_ref(proxy);
+}
+
+static void proxy_free(gpointer data)
+{
+       GDBusProxy *proxy = data;
+
+       if (proxy->client) {
+               GDBusClient *client = proxy->client;
+
+               if (client->proxy_removed)
+                       client->proxy_removed(proxy, client->user_data);
+
+               modify_match(client->dbus_conn, "RemoveMatch",
+                                                       proxy->match_rule);
+
+               g_free(proxy->match_rule);
+               proxy->match_rule = NULL;
+
+               g_hash_table_remove_all(proxy->prop_list);
+
+               proxy->client = NULL;
+       }
+
+       g_dbus_proxy_unref(proxy);
+}
+
+static void proxy_remove(GDBusClient *client, const char *path,
+                                               const char *interface)
+{
+       GList *list;
+
+       for (list = g_list_first(client->proxy_list); list;
+                                               list = g_list_next(list)) {
+               GDBusProxy *proxy = list->data;
+
+               if (g_str_equal(proxy->interface, interface) == TRUE &&
+                               g_str_equal(proxy->obj_path, path) == TRUE) {
+                       client->proxy_list =
+                               g_list_delete_link(client->proxy_list, list);
+                       proxy_free(proxy);
+                       break;
+               }
+       }
+}
+
+GDBusProxy *g_dbus_proxy_ref(GDBusProxy *proxy)
+{
+       if (proxy == NULL)
+               return NULL;
+
+       g_atomic_int_inc(&proxy->ref_count);
+
+       return proxy;
+}
+
+void g_dbus_proxy_unref(GDBusProxy *proxy)
+{
+       if (proxy == NULL)
+               return;
+
+       if (g_atomic_int_dec_and_test(&proxy->ref_count) == FALSE)
+               return;
+
+       g_hash_table_destroy(proxy->prop_list);
+
+       g_free(proxy->obj_path);
+       g_free(proxy->interface);
+
+       g_free(proxy);
+}
+
+const char *g_dbus_proxy_get_path(GDBusProxy *proxy)
+{
+       if (proxy == NULL)
+               return NULL;
+
+       return proxy->obj_path;
+}
+
+const char *g_dbus_proxy_get_interface(GDBusProxy *proxy)
+{
+       if (proxy == NULL)
+               return NULL;
+
+       return proxy->interface;
+}
+
+gboolean g_dbus_proxy_get_property(GDBusProxy *proxy, const char *name,
+                                                        DBusMessageIter *iter)
+{
+       struct prop_entry *prop;
+
+       if (proxy == NULL || name == NULL)
+               return FALSE;
+
+       prop = g_hash_table_lookup(proxy->prop_list, name);
+       if (prop == NULL)
+               return FALSE;
+
+       if (prop->msg == NULL)
+               return FALSE;
+
+       if (dbus_message_iter_init(prop->msg, iter) == FALSE)
+               return FALSE;
+
+       return TRUE;
+}
+
+struct set_property_data {
+       GDBusResultFunction function;
+       void *user_data;
+       GDBusDestroyFunction destroy;
+};
+
+static void set_property_reply(DBusPendingCall *call, void *user_data)
+{
+       struct set_property_data *data = user_data;
+       DBusMessage *reply = dbus_pending_call_steal_reply(call);
+       DBusError error;
+
+       dbus_error_init(&error);
+
+       dbus_set_error_from_message(&error, reply);
+
+       if (data->function)
+               data->function(&error, data->user_data);
+
+       if (data->destroy)
+               data->destroy(data->user_data);
+
+       dbus_error_free(&error);
+
+       dbus_message_unref(reply);
+}
+
+gboolean g_dbus_proxy_set_property_basic(GDBusProxy *proxy,
+                               const char *name, int type, const void *value,
+                               GDBusResultFunction function, void *user_data,
+                               GDBusDestroyFunction destroy)
+{
+       struct set_property_data *data;
+       GDBusClient *client;
+       DBusMessage *msg;
+       DBusMessageIter iter, variant;
+       DBusPendingCall *call;
+       char type_as_str[2];
+
+       if (proxy == NULL || name == NULL || value == NULL)
+               return FALSE;
+
+       if (dbus_type_is_basic(type) == FALSE)
+               return FALSE;
+
+       client = proxy->client;
+       if (client == NULL)
+               return FALSE;
+
+       data = g_try_new0(struct set_property_data, 1);
+       if (data == NULL)
+               return FALSE;
+
+       data->function = function;
+       data->user_data = user_data;
+       data->destroy = destroy;
+
+       msg = dbus_message_new_method_call(client->service_name,
+                       proxy->obj_path, DBUS_INTERFACE_PROPERTIES, "Set");
+       if (msg == NULL) {
+               g_free(data);
+               return FALSE;
+       }
+
+       type_as_str[0] = (char) type;
+       type_as_str[1] = '\0';
+
+       dbus_message_iter_init_append(msg, &iter);
+       dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING,
+                                                       &proxy->interface);
+       dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &name);
+
+       dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT,
+                                               type_as_str, &variant);
+       dbus_message_iter_append_basic(&variant, type, value);
+       dbus_message_iter_close_container(&iter, &variant);
+
+       if (dbus_connection_send_with_reply(client->dbus_conn, msg,
+                                                       &call, -1) == FALSE) {
+               dbus_message_unref(msg);
+               g_free(data);
+               return FALSE;
+       }
+
+       dbus_pending_call_set_notify(call, set_property_reply, data, g_free);
+       dbus_pending_call_unref(call);
+
+       dbus_message_unref(msg);
+
+       return TRUE;
+}
+
+struct method_call_data {
+       GDBusReturnFunction function;
+       void *user_data;
+       GDBusDestroyFunction destroy;
+};
+
+static void method_call_reply(DBusPendingCall *call, void *user_data)
+{
+       struct method_call_data *data = user_data;
+       DBusMessage *reply = dbus_pending_call_steal_reply(call);
+
+       if (data->function)
+               data->function(reply, data->user_data);
+
+       if (data->destroy)
+               data->destroy(data->user_data);
+
+       dbus_message_unref(reply);
+}
+
+gboolean g_dbus_proxy_method_call(GDBusProxy *proxy, const char *method,
+                               GDBusSetupFunction setup,
+                               GDBusReturnFunction function, void *user_data,
+                               GDBusDestroyFunction destroy)
+{
+       struct method_call_data *data;
+       GDBusClient *client;
+       DBusMessage *msg;
+       DBusPendingCall *call;
+
+       if (proxy == NULL || method == NULL)
+               return FALSE;
+
+       client = proxy->client;
+       if (client == NULL)
+               return FALSE;
+
+       data = g_try_new0(struct method_call_data, 1);
+       if (data == NULL)
+               return FALSE;
+
+       data->function = function;
+       data->user_data = user_data;
+       data->destroy = destroy;
+
+       msg = dbus_message_new_method_call(client->service_name,
+                               proxy->obj_path, proxy->interface, method);
+       if (msg == NULL) {
+               g_free(data);
+               return FALSE;
+       }
+
+       if (setup) {
+               DBusMessageIter iter;
+
+               dbus_message_iter_init_append(msg, &iter);
+               setup(&iter, data->user_data);
+       }
+
+       if (dbus_connection_send_with_reply(client->dbus_conn, msg,
+                                       &call, METHOD_CALL_TIMEOUT) == FALSE) {
+               dbus_message_unref(msg);
+               g_free(data);
+               return FALSE;
+       }
+
+       dbus_pending_call_set_notify(call, method_call_reply, data, g_free);
+       dbus_pending_call_unref(call);
+
+       dbus_message_unref(msg);
+
+       return TRUE;
+}
+
+static void add_property(GDBusProxy *proxy, const char *name,
+                                               DBusMessageIter *iter)
+{
+       DBusMessageIter value;
+       struct prop_entry *prop;
+
+       if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_VARIANT)
+               return;
+
+       dbus_message_iter_recurse(iter, &value);
+
+       prop = g_hash_table_lookup(proxy->prop_list, name);
+       if (prop != NULL) {
+               GDBusClient *client = proxy->client;
+
+               prop_entry_update(prop, &value);
+
+               if (client == NULL)
+                       return;
+
+               if (client->property_changed)
+                       client->property_changed(proxy, name, &value,
+                                                       client->user_data);
+               return;
+       }
+
+       prop = prop_entry_new(name, &value);
+       if (prop == NULL)
+               return;
+
+       g_hash_table_replace(proxy->prop_list, prop->name, prop);
+}
+
+static void update_properties(GDBusProxy *proxy, DBusMessageIter *iter)
+{
+       DBusMessageIter dict;
+
+       if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY)
+               return;
+
+       dbus_message_iter_recurse(iter, &dict);
+
+       while (dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_DICT_ENTRY) {
+               DBusMessageIter entry;
+               const char *name;
+
+               dbus_message_iter_recurse(&dict, &entry);
+
+               if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_STRING)
+                       break;
+
+               dbus_message_iter_get_basic(&entry, &name);
+               dbus_message_iter_next(&entry);
+
+               add_property(proxy, name, &entry);
+
+               dbus_message_iter_next(&dict);
+       }
+}
+
+static void properties_changed(GDBusClient *client, const char *path,
+                                                       DBusMessage *msg)
+{
+       GDBusProxy *proxy = NULL;
+       DBusMessageIter iter, entry;
+       const char *interface;
+       GList *list;
+
+       if (dbus_message_iter_init(msg, &iter) == FALSE)
+               return;
+
+       if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
+               return;
+
+       dbus_message_iter_get_basic(&iter, &interface);
+       dbus_message_iter_next(&iter);
+
+       for (list = g_list_first(client->proxy_list); list;
+                                               list = g_list_next(list)) {
+               GDBusProxy *data = list->data;
+
+               if (g_str_equal(data->interface, interface) == TRUE &&
+                               g_str_equal(data->obj_path, path) == TRUE) {
+                       proxy = data;
+                       break;
+               }
+       }
+
+       if (proxy == NULL)
+               return;
+
+       update_properties(proxy, &iter);
+
+       dbus_message_iter_next(&iter);
+
+       if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY)
+               return;
+
+       dbus_message_iter_recurse(&iter, &entry);
+
+       while (dbus_message_iter_get_arg_type(&entry) == DBUS_TYPE_STRING) {
+               const char *name;
+
+               dbus_message_iter_get_basic(&entry, &name);
+
+               g_hash_table_remove(proxy->prop_list, name);
+
+               if (client->property_changed)
+                       client->property_changed(proxy, name, NULL,
+                                                       client->user_data);
+
+               dbus_message_iter_next(&entry);
+       }
+}
+
+static void parse_properties(GDBusClient *client, const char *path,
+                               const char *interface, DBusMessageIter *iter)
+{
+       GDBusProxy *proxy;
+
+       if (g_str_equal(interface, DBUS_INTERFACE_INTROSPECTABLE) == TRUE)
+               return;
+
+       if (g_str_equal(interface, DBUS_INTERFACE_PROPERTIES) == TRUE)
+               return;
+
+       proxy = proxy_lookup(client, path, interface);
+       if (proxy) {
+               update_properties(proxy, iter);
+               return;
+       }
+
+       proxy = proxy_new(client, path, interface);
+       if (proxy == NULL)
+               return;
+
+       update_properties(proxy, iter);
+
+       if (client->proxy_added)
+               client->proxy_added(proxy, client->user_data);
+
+       client->proxy_list = g_list_append(client->proxy_list, proxy);
+}
+
+static void parse_interfaces(GDBusClient *client, const char *path,
+                                               DBusMessageIter *iter)
+{
+       DBusMessageIter dict;
+
+       if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY)
+               return;
+
+       dbus_message_iter_recurse(iter, &dict);
+
+       while (dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_DICT_ENTRY) {
+               DBusMessageIter entry;
+               const char *interface;
+
+               dbus_message_iter_recurse(&dict, &entry);
+
+               if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_STRING)
+                       break;
+
+               dbus_message_iter_get_basic(&entry, &interface);
+               dbus_message_iter_next(&entry);
+
+               parse_properties(client, path, interface, &entry);
+
+               dbus_message_iter_next(&dict);
+       }
+}
+
+static void interfaces_added(GDBusClient *client, DBusMessage *msg)
+{
+       DBusMessageIter iter;
+       const char *path;
+
+       if (dbus_message_iter_init(msg, &iter) == FALSE)
+               return;
+
+       if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_OBJECT_PATH)
+               return;
+
+       dbus_message_iter_get_basic(&iter, &path);
+       dbus_message_iter_next(&iter);
+
+       g_dbus_client_ref(client);
+
+       parse_interfaces(client, path, &iter);
+
+       g_dbus_client_unref(client);
+}
+
+static void interfaces_removed(GDBusClient *client, DBusMessage *msg)
+{
+       DBusMessageIter iter, entry;
+       const char *path;
+
+       if (dbus_message_iter_init(msg, &iter) == FALSE)
+               return;
+
+       if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_OBJECT_PATH)
+               return;
+
+       dbus_message_iter_get_basic(&iter, &path);
+       dbus_message_iter_next(&iter);
+
+       if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY)
+               return;
+
+       dbus_message_iter_recurse(&iter, &entry);
+
+       g_dbus_client_ref(client);
+
+       while (dbus_message_iter_get_arg_type(&entry) == DBUS_TYPE_STRING) {
+               const char *interface;
+
+               dbus_message_iter_get_basic(&entry, &interface);
+               proxy_remove(client, path, interface);
+               dbus_message_iter_next(&entry);
+       }
+
+       g_dbus_client_unref(client);
+}
+
+static void parse_managed_objects(GDBusClient *client, DBusMessage *msg)
+{
+       DBusMessageIter iter, dict;
+
+       if (dbus_message_iter_init(msg, &iter) == FALSE)
+               return;
+
+       if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY)
+               return;
+
+       dbus_message_iter_recurse(&iter, &dict);
+
+       while (dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_DICT_ENTRY) {
+               DBusMessageIter entry;
+               const char *path;
+
+               dbus_message_iter_recurse(&dict, &entry);
+
+               if (dbus_message_iter_get_arg_type(&entry) !=
+                                                       DBUS_TYPE_OBJECT_PATH)
+                       break;
+
+               dbus_message_iter_get_basic(&entry, &path);
+               dbus_message_iter_next(&entry);
+
+               parse_interfaces(client, path, &entry);
+
+               dbus_message_iter_next(&dict);
+       }
+}
+
+static void get_managed_objects_reply(DBusPendingCall *call, void *user_data)
+{
+       GDBusClient *client = user_data;
+       DBusMessage *reply = dbus_pending_call_steal_reply(call);
+       DBusError error;
+
+       dbus_error_init(&error);
+
+       if (dbus_set_error_from_message(&error, reply) == TRUE) {
+               dbus_error_free(&error);
+               goto done;
+       }
+
+       parse_managed_objects(client, reply);
+
+done:
+       dbus_message_unref(reply);
+
+       dbus_pending_call_unref(client->pending_call);
+       client->pending_call = NULL;
+
+       g_dbus_client_unref(client);
+}
+
+static void get_managed_objects(GDBusClient *client)
+{
+       DBusMessage *msg;
+
+       msg = dbus_message_new_method_call("org.bluez", "/",
+                                       DBUS_INTERFACE_DBUS ".ObjectManager",
+                                                       "GetManagedObjects");
+       if (msg == NULL)
+               return;
+
+       dbus_message_append_args(msg, DBUS_TYPE_INVALID);
+
+       if (dbus_connection_send_with_reply(client->dbus_conn, msg,
+                                       &client->pending_call, -1) == FALSE) {
+               dbus_message_unref(msg);
+               return;
+       }
+
+       g_dbus_client_ref(client);
+
+       dbus_pending_call_set_notify(client->pending_call,
+                               get_managed_objects_reply, client, NULL);
+
+       dbus_message_unref(msg);
+}
+
+static void get_name_owner_reply(DBusPendingCall *call, void *user_data)
+{
+       GDBusClient *client = user_data;
+       DBusMessage *reply = dbus_pending_call_steal_reply(call);
+       DBusError error;
+       const char *name;
+
+       dbus_error_init(&error);
+
+       if (dbus_set_error_from_message(&error, reply) == TRUE) {
+               dbus_error_free(&error);
+               goto done;
+       }
+
+       if (dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING, &name,
+                                               DBUS_TYPE_INVALID) == FALSE)
+               goto done;
+
+       g_free(client->unique_name);
+       client->unique_name = g_strdup(name);
+
+       g_dbus_client_ref(client);
+
+       if (client->connect_func)
+               client->connect_func(client->dbus_conn, client->connect_data);
+
+done:
+       dbus_message_unref(reply);
+
+       dbus_pending_call_unref(client->pending_call);
+       client->pending_call = NULL;
+
+       get_managed_objects(client);
+
+       g_dbus_client_unref(client);
+}
+
+static void get_name_owner(GDBusClient *client, const char *name)
+{
+       DBusMessage *msg;
+
+       msg = dbus_message_new_method_call(DBUS_SERVICE_DBUS, DBUS_PATH_DBUS,
+                                       DBUS_INTERFACE_DBUS, "GetNameOwner");
+       if (msg == NULL)
+               return;
+
+       dbus_message_append_args(msg, DBUS_TYPE_STRING, &name,
+                                               DBUS_TYPE_INVALID);
+
+       if (dbus_connection_send_with_reply(client->dbus_conn, msg,
+                                       &client->pending_call, -1) == FALSE) {
+               dbus_message_unref(msg);
+               return;
+       }
+
+       dbus_pending_call_set_notify(client->pending_call,
+                                       get_name_owner_reply, client, NULL);
+
+       dbus_message_unref(msg);
+}
+
+static DBusHandlerResult message_filter(DBusConnection *connection,
+                                       DBusMessage *message, void *user_data)
+{
+       GDBusClient *client = user_data;
+       const char *sender;
+
+       if (dbus_message_get_type(message) != DBUS_MESSAGE_TYPE_SIGNAL)
+               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+       sender = dbus_message_get_sender(message);
+
+       if (g_str_equal(sender, DBUS_SERVICE_DBUS) == TRUE) {
+               const char *interface, *member;
+               const char *name, *old, *new;
+
+               interface = dbus_message_get_interface(message);
+
+               if (g_str_equal(interface, DBUS_INTERFACE_DBUS) == FALSE)
+                       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+               member = dbus_message_get_member(message);
+
+               if (g_str_equal(member, "NameOwnerChanged") == FALSE)
+                       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+               if (dbus_message_get_args(message, NULL,
+                                               DBUS_TYPE_STRING, &name,
+                                               DBUS_TYPE_STRING, &old,
+                                               DBUS_TYPE_STRING, &new,
+                                               DBUS_TYPE_INVALID) == FALSE)
+                       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+               if (g_str_equal(name, client->service_name) == FALSE)
+                       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+               if (*new == '\0') {
+                       if (client->disconn_func)
+                               client->disconn_func(client->dbus_conn,
+                                                       client->disconn_data);
+
+                       g_free(client->unique_name);
+                       client->unique_name = NULL;
+               } else if (*old == '\0') {
+                       g_free(client->unique_name);
+                       client->unique_name = g_strdup(new);
+
+                       if (client->connect_func)
+                               client->connect_func(client->dbus_conn,
+                                                       client->connect_data);
+
+                       get_managed_objects(client);
+               }
+
+               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+       }
+
+       if (client->unique_name == NULL)
+               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+       if (g_str_equal(sender, client->unique_name) == TRUE) {
+               const char *path, *interface, *member;
+
+               path = dbus_message_get_path(message);
+               interface = dbus_message_get_interface(message);
+               member = dbus_message_get_member(message);
+
+               if (g_str_equal(path, "/") == TRUE) {
+                       if (g_str_equal(interface, DBUS_INTERFACE_DBUS
+                                               ".ObjectManager") == FALSE)
+                               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+                       if (g_str_equal(member, "InterfacesAdded") == TRUE) {
+                               interfaces_added(client, message);
+                               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+                       }
+
+                       if (g_str_equal(member, "InterfacesRemoved") == TRUE) {
+                               interfaces_removed(client, message);
+                               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+                       }
+
+                       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+               }
+
+               if (g_str_has_prefix(path, client->base_path) == FALSE)
+                       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+               if (g_str_equal(interface, DBUS_INTERFACE_PROPERTIES) == TRUE) {
+                       if (g_str_equal(member, "PropertiesChanged") == TRUE)
+                               properties_changed(client, path, message);
+
+                       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+               }
+
+               if (client->signal_func)
+                       client->signal_func(client->dbus_conn,
+                                       message, client->signal_data);
+       }
+
+       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+GDBusClient *g_dbus_client_new(DBusConnection *connection,
+                                       const char *service, const char *path)
+{
+       GDBusClient *client;
+       unsigned int i;
+
+       if (connection == NULL)
+               return NULL;
+
+       client = g_try_new0(GDBusClient, 1);
+       if (client == NULL)
+               return NULL;
+
+       if (dbus_connection_add_filter(connection, message_filter,
+                                               client, NULL) == FALSE) {
+               g_free(client);
+               return NULL;
+       }
+
+       client->dbus_conn = dbus_connection_ref(connection);
+       client->service_name = g_strdup(service);
+       client->base_path = g_strdup(path);
+
+       get_name_owner(client, client->service_name);
+
+       client->match_rules = g_ptr_array_new_full(4, g_free);
+
+       g_ptr_array_add(client->match_rules, g_strdup_printf("type='signal',"
+                               "sender='%s',path='%s',interface='%s',"
+                               "member='NameOwnerChanged',arg0='%s'",
+                               DBUS_SERVICE_DBUS, DBUS_PATH_DBUS,
+                               DBUS_INTERFACE_DBUS, client->service_name));
+       g_ptr_array_add(client->match_rules, g_strdup_printf("type='signal',"
+                               "sender='%s',"
+                               "path='/',interface='%s.ObjectManager',"
+                               "member='InterfacesAdded'",
+                               client->service_name, DBUS_INTERFACE_DBUS));
+       g_ptr_array_add(client->match_rules, g_strdup_printf("type='signal',"
+                               "sender='%s',"
+                               "path='/',interface='%s.ObjectManager',"
+                               "member='InterfacesRemoved'",
+                               client->service_name, DBUS_INTERFACE_DBUS));
+       g_ptr_array_add(client->match_rules, g_strdup_printf("type='signal',"
+                               "sender='%s',path_namespace='%s'",
+                               client->service_name, client->base_path));
+
+       for (i = 0; i < client->match_rules->len; i++) {
+               modify_match(client->dbus_conn, "AddMatch",
+                               g_ptr_array_index(client->match_rules, i));
+       }
+
+       return g_dbus_client_ref(client);
+}
+
+GDBusClient *g_dbus_client_ref(GDBusClient *client)
+{
+       if (client == NULL)
+               return NULL;
+
+       g_atomic_int_inc(&client->ref_count);
+
+       return client;
+}
+
+void g_dbus_client_unref(GDBusClient *client)
+{
+       unsigned int i;
+
+       if (client == NULL)
+               return;
+
+       if (g_atomic_int_dec_and_test(&client->ref_count) == FALSE)
+               return;
+
+       if (client->pending_call != NULL) {
+               dbus_pending_call_cancel(client->pending_call);
+               dbus_pending_call_unref(client->pending_call);
+       }
+
+       for (i = 0; i < client->match_rules->len; i++) {
+               modify_match(client->dbus_conn, "RemoveMatch",
+                               g_ptr_array_index(client->match_rules, i));
+       }
+
+       g_ptr_array_free(client->match_rules, TRUE);
+
+       dbus_connection_remove_filter(client->dbus_conn,
+                                               message_filter, client);
+
+       g_list_free_full(client->proxy_list, proxy_free);
+
+       if (client->disconn_func)
+               client->disconn_func(client->dbus_conn, client->disconn_data);
+
+       dbus_connection_unref(client->dbus_conn);
+
+       g_free(client->service_name);
+       g_free(client->unique_name);
+       g_free(client->base_path);
+
+       g_free(client);
+}
+
+gboolean g_dbus_client_set_connect_watch(GDBusClient *client,
+                               GDBusWatchFunction function, void *user_data)
+{
+       if (client == NULL)
+               return FALSE;
+
+       client->connect_func = function;
+       client->connect_data = user_data;
+
+       return TRUE;
+}
+
+gboolean g_dbus_client_set_disconnect_watch(GDBusClient *client,
+                               GDBusWatchFunction function, void *user_data)
+{
+       if (client == NULL)
+               return FALSE;
+
+       client->disconn_func = function;
+       client->disconn_data = user_data;
+
+       return TRUE;
+}
+
+gboolean g_dbus_client_set_signal_watch(GDBusClient *client,
+                               GDBusMessageFunction function, void *user_data)
+{
+       if (client == NULL)
+               return FALSE;
+
+       client->signal_func = function;
+       client->signal_data = user_data;
+
+       return TRUE;
+}
+
+gboolean g_dbus_client_set_proxy_handlers(GDBusClient *client,
+                                       GDBusProxyFunction proxy_added,
+                                       GDBusProxyFunction proxy_removed,
+                                       GDBusPropertyFunction property_changed,
+                                       void *user_data)
+{
+       if (client == NULL)
+               return FALSE;
+
+       client->proxy_added = proxy_added;
+       client->proxy_removed = proxy_removed;
+       client->property_changed = property_changed;
+       client->user_data = user_data;
+
+       return TRUE;
+}
index 0a8a27c..0e5c012 100644 (file)
@@ -31,9 +31,23 @@ extern "C" {
 #include <dbus/dbus.h>
 #include <glib.h>
 
+typedef enum GDBusMethodFlags GDBusMethodFlags;
+typedef enum GDBusSignalFlags GDBusSignalFlags;
+typedef enum GDBusPropertyFlags GDBusPropertyFlags;
+typedef enum GDBusSecurityFlags GDBusSecurityFlags;
+
+typedef struct GDBusArgInfo GDBusArgInfo;
+typedef struct GDBusMethodTable GDBusMethodTable;
+typedef struct GDBusSignalTable GDBusSignalTable;
+typedef struct GDBusPropertyTable GDBusPropertyTable;
+typedef struct GDBusSecurityTable GDBusSecurityTable;
+
 typedef void (* GDBusWatchFunction) (DBusConnection *connection,
                                                        void *user_data);
 
+typedef void (* GDBusMessageFunction) (DBusConnection *connection,
+                                        DBusMessage *message, void *user_data);
+
 typedef gboolean (* GDBusSignalFunction) (DBusConnection *connection,
                                        DBusMessage *message, void *user_data);
 
@@ -55,6 +69,18 @@ typedef void (* GDBusDestroyFunction) (void *user_data);
 typedef DBusMessage * (* GDBusMethodFunction) (DBusConnection *connection,
                                        DBusMessage *message, void *user_data);
 
+typedef gboolean (*GDBusPropertyGetter)(const GDBusPropertyTable *property,
+                                       DBusMessageIter *iter, void *data);
+
+typedef guint32 GDBusPendingPropertySet;
+
+typedef void (*GDBusPropertySetter)(const GDBusPropertyTable *property,
+                       DBusMessageIter *value, GDBusPendingPropertySet id,
+                       void *data);
+
+typedef gboolean (*GDBusPropertyExists)(const GDBusPropertyTable *property,
+                                                               void *data);
+
 typedef guint32 GDBusPendingReply;
 
 typedef void (* GDBusSecurityFunction) (DBusConnection *connection,
@@ -62,58 +88,61 @@ typedef void (* GDBusSecurityFunction) (DBusConnection *connection,
                                                gboolean interaction,
                                                GDBusPendingReply pending);
 
-typedef enum {
+enum GDBusMethodFlags {
        G_DBUS_METHOD_FLAG_DEPRECATED = (1 << 0),
        G_DBUS_METHOD_FLAG_NOREPLY    = (1 << 1),
        G_DBUS_METHOD_FLAG_ASYNC      = (1 << 2),
-} GDBusMethodFlags;
+};
 
-typedef enum {
+enum GDBusSignalFlags {
        G_DBUS_SIGNAL_FLAG_DEPRECATED = (1 << 0),
-} GDBusSignalFlags;
+};
 
-typedef enum {
+enum GDBusPropertyFlags {
        G_DBUS_PROPERTY_FLAG_DEPRECATED = (1 << 0),
-} GDBusPropertyFlags;
+};
 
-typedef enum {
+enum GDBusSecurityFlags {
        G_DBUS_SECURITY_FLAG_DEPRECATED        = (1 << 0),
        G_DBUS_SECURITY_FLAG_BUILTIN           = (1 << 1),
        G_DBUS_SECURITY_FLAG_ALLOW_INTERACTION = (1 << 2),
-} GDBusSecurityFlags;
+};
 
-typedef struct {
+struct GDBusArgInfo {
        const char *name;
        const char *signature;
-} GDBusArgInfo;
+};
 
-typedef struct {
+struct GDBusMethodTable {
        const char *name;
        GDBusMethodFunction function;
        GDBusMethodFlags flags;
        unsigned int privilege;
        const GDBusArgInfo *in_args;
        const GDBusArgInfo *out_args;
-} GDBusMethodTable;
+};
 
-typedef struct {
+struct GDBusSignalTable {
        const char *name;
        GDBusSignalFlags flags;
        const GDBusArgInfo *args;
-} GDBusSignalTable;
+};
 
-typedef struct {
+struct GDBusPropertyTable {
        const char *name;
        const char *type;
+       GDBusPropertyGetter get;
+       GDBusPropertySetter set;
+       GDBusPropertyExists exists;
        GDBusPropertyFlags flags;
-} GDBusPropertyTable;
+};
 
-typedef struct {
+struct GDBusSecurityTable {
        unsigned int privilege;
        const char *action;
        GDBusSecurityFlags flags;
        GDBusSecurityFunction function;
-} GDBusSecurityTable;
+};
 
 #define GDBUS_ARGS(args...) (const GDBusArgInfo[]) { args, { } }
 
@@ -193,6 +222,12 @@ DBusMessage *g_dbus_create_reply_valist(DBusMessage *message,
                                                int type, va_list args);
 
 gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message);
+gboolean g_dbus_send_error(DBusConnection *connection, DBusMessage *message,
+                               const char *name, const char *format, ...)
+                                        __attribute__((format(printf, 4, 5)));
+gboolean g_dbus_send_error_valist(DBusConnection *connection,
+                                       DBusMessage *message, const char *name,
+                                       const char *format, va_list args);
 gboolean g_dbus_send_reply(DBusConnection *connection,
                                DBusMessage *message, int type, ...);
 gboolean g_dbus_send_reply_valist(DBusConnection *connection,
@@ -217,9 +252,79 @@ guint g_dbus_add_signal_watch(DBusConnection *connection,
                                const char *interface, const char *member,
                                GDBusSignalFunction function, void *user_data,
                                GDBusDestroyFunction destroy);
+guint g_dbus_add_properties_watch(DBusConnection *connection,
+                               const char *sender, const char *path,
+                               const char *interface,
+                               GDBusSignalFunction function, void *user_data,
+                               GDBusDestroyFunction destroy);
 gboolean g_dbus_remove_watch(DBusConnection *connection, guint tag);
 void g_dbus_remove_all_watches(DBusConnection *connection);
 
+void g_dbus_pending_property_success(GDBusPendingPropertySet id);
+void g_dbus_pending_property_error_valist(GDBusPendingReply id,
+                       const char *name, const char *format, va_list args);
+void g_dbus_pending_property_error(GDBusPendingReply id, const char *name,
+                                               const char *format, ...);
+void g_dbus_emit_property_changed(DBusConnection *connection,
+                               const char *path, const char *interface,
+                               const char *name);
+gboolean g_dbus_get_properties(DBusConnection *connection, const char *path,
+                               const char *interface, DBusMessageIter *iter);
+
+gboolean g_dbus_attach_object_manager(DBusConnection *connection);
+gboolean g_dbus_detach_object_manager(DBusConnection *connection);
+
+typedef struct GDBusProxy GDBusProxy;
+
+GDBusProxy *g_dbus_proxy_ref(GDBusProxy *proxy);
+void g_dbus_proxy_unref(GDBusProxy *proxy);
+
+const char *g_dbus_proxy_get_path(GDBusProxy *proxy);
+const char *g_dbus_proxy_get_interface(GDBusProxy *proxy);
+
+gboolean g_dbus_proxy_get_property(GDBusProxy *proxy, const char *name,
+                                                       DBusMessageIter *iter);
+
+typedef void (* GDBusResultFunction) (const DBusError *error, void *user_data);
+
+gboolean g_dbus_proxy_set_property_basic(GDBusProxy *proxy,
+                               const char *name, int type, const void *value,
+                               GDBusResultFunction function, void *user_data,
+                               GDBusDestroyFunction destroy);
+
+typedef void (* GDBusSetupFunction) (DBusMessageIter *iter, void *user_data);
+typedef void (* GDBusReturnFunction) (DBusMessage *message, void *user_data);
+
+gboolean g_dbus_proxy_method_call(GDBusProxy *proxy, const char *method,
+                               GDBusSetupFunction setup,
+                               GDBusReturnFunction function, void *user_data,
+                               GDBusDestroyFunction destroy);
+
+typedef struct GDBusClient GDBusClient;
+
+GDBusClient *g_dbus_client_new(DBusConnection *connection,
+                                       const char *service, const char *path);
+
+GDBusClient *g_dbus_client_ref(GDBusClient *client);
+void g_dbus_client_unref(GDBusClient *client);
+
+gboolean g_dbus_client_set_connect_watch(GDBusClient *client,
+                               GDBusWatchFunction function, void *user_data);
+gboolean g_dbus_client_set_disconnect_watch(GDBusClient *client,
+                               GDBusWatchFunction function, void *user_data);
+gboolean g_dbus_client_set_signal_watch(GDBusClient *client,
+                               GDBusMessageFunction function, void *user_data);
+
+typedef void (* GDBusProxyFunction) (GDBusProxy *proxy, void *user_data);
+typedef void (* GDBusPropertyFunction) (GDBusProxy *proxy, const char *name,
+                                       DBusMessageIter *iter, void *user_data);
+
+gboolean g_dbus_client_set_proxy_handlers(GDBusClient *client,
+                                       GDBusProxyFunction proxy_added,
+                                       GDBusProxyFunction proxy_removed,
+                                       GDBusPropertyFunction property_changed,
+                                       void *user_data);
+
 #ifdef __cplusplus
 }
 #endif
index cff326f..099b67f 100644 (file)
@@ -92,8 +92,9 @@ static gboolean watch_func(GIOChannel *chan, GIOCondition cond, gpointer data)
        struct watch_info *info = data;
        unsigned int flags = 0;
        DBusDispatchStatus status;
+       DBusConnection *conn;
 
-       dbus_connection_ref(info->conn);
+       conn = dbus_connection_ref(info->conn);
 
        if (cond & G_IO_IN)  flags |= DBUS_WATCH_READABLE;
        if (cond & G_IO_OUT) flags |= DBUS_WATCH_WRITABLE;
@@ -102,10 +103,10 @@ static gboolean watch_func(GIOChannel *chan, GIOCondition cond, gpointer data)
 
        dbus_watch_handle(info->watch, flags);
 
-       status = dbus_connection_get_dispatch_status(info->conn);
-       queue_dispatch(info->conn, status);
+       status = dbus_connection_get_dispatch_status(conn);
+       queue_dispatch(conn, status);
 
-       dbus_connection_unref(info->conn);
+       dbus_connection_unref(conn);
 
        return TRUE;
 }
index 9689006..776d35e 100644 (file)
 #define error(fmt...)
 #define debug(fmt...)
 
+#define DBUS_INTERFACE_OBJECT_MANAGER "org.freedesktop.DBus.ObjectManager"
+
+#ifndef DBUS_ERROR_UNKNOWN_PROPERTY
+#define DBUS_ERROR_UNKNOWN_PROPERTY "org.freedesktop.DBus.Error.UnknownProperty"
+#endif
+
+#ifndef DBUS_ERROR_PROPERTY_READ_ONLY
+#define DBUS_ERROR_PROPERTY_READ_ONLY "org.freedesktop.DBus.Error.PropertyReadOnly"
+#endif
+
 struct generic_data {
        unsigned int refcount;
+       DBusConnection *conn;
+       char *path;
        GSList *interfaces;
+       GSList *objects;
+       GSList *added;
+       GSList *removed;
+       guint process_id;
+       gboolean pending_prop;
        char *introspect;
+       struct generic_data *parent;
 };
 
 struct interface_data {
@@ -48,6 +66,7 @@ struct interface_data {
        const GDBusMethodTable *methods;
        const GDBusSignalTable *signals;
        const GDBusPropertyTable *properties;
+       GSList *pending_prop;
        void *user_data;
        GDBusDestroyFunction destroy;
 };
@@ -59,6 +78,19 @@ struct security_data {
        void *iface_user_data;
 };
 
+struct property_data {
+       DBusConnection *conn;
+       GDBusPendingPropertySet id;
+       DBusMessage *message;
+};
+
+static struct generic_data *root;
+
+static gboolean process_changes(gpointer user_data);
+static void process_properties_from_interface(struct generic_data *data,
+                                               struct interface_data *iface);
+static void process_property_changes(struct generic_data *data);
+
 static void print_arguments(GString *gstr, const GDBusArgInfo *args,
                                                const char *direction)
 {
@@ -76,10 +108,21 @@ static void print_arguments(GString *gstr, const GDBusArgInfo *args,
        }
 }
 
+#define G_DBUS_ANNOTATE(prefix_, name_, value_)                                \
+       prefix_ "<annotation name=\"org.freedesktop.DBus." name_ "\" "  \
+       "value=\"" value_ "\"/>\n"
+
+#define G_DBUS_ANNOTATE_DEPRECATED(prefix_) \
+       G_DBUS_ANNOTATE(prefix_, "Deprecated", "true")
+
+#define G_DBUS_ANNOTATE_NOREPLY(prefix_) \
+       G_DBUS_ANNOTATE(prefix_, "Method.NoReply", "true")
+
 static void generate_interface_xml(GString *gstr, struct interface_data *iface)
 {
        const GDBusMethodTable *method;
        const GDBusSignalTable *signal;
+       const GDBusPropertyTable *property;
 
        for (method = iface->methods; method && method->name; method++) {
                gboolean deprecated = method->flags &
@@ -90,19 +133,22 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
                if (!deprecated && !noreply &&
                                !(method->in_args && method->in_args->name) &&
                                !(method->out_args && method->out_args->name))
-                       g_string_append_printf(gstr, "\t\t<method name=\"%s\"/>\n",
-                                                               method->name);
+                       g_string_append_printf(gstr,
+                                               "\t\t<method name=\"%s\"/>\n",
+                                               method->name);
                else {
-                       g_string_append_printf(gstr, "\t\t<method name=\"%s\">\n",
-                                                               method->name);
+                       g_string_append_printf(gstr,
+                                               "\t\t<method name=\"%s\">\n",
+                                               method->name);
                        print_arguments(gstr, method->in_args, "in");
                        print_arguments(gstr, method->out_args, "out");
 
                        if (deprecated)
-                               g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n");
-
+                               g_string_append_printf(gstr,
+                                       G_DBUS_ANNOTATE_DEPRECATED("\t\t\t"));
                        if (noreply)
-                               g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Method.NoReply\" value=\"true\"/>\n");
+                               g_string_append_printf(gstr,
+                                       G_DBUS_ANNOTATE_NOREPLY("\t\t\t"));
 
                        g_string_append_printf(gstr, "\t\t</method>\n");
                }
@@ -113,19 +159,40 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
                                                G_DBUS_SIGNAL_FLAG_DEPRECATED;
 
                if (!deprecated && !(signal->args && signal->args->name))
-                       g_string_append_printf(gstr, "\t\t<signal name=\"%s\"/>\n",
-                                                               signal->name);
+                       g_string_append_printf(gstr,
+                                               "\t\t<signal name=\"%s\"/>\n",
+                                               signal->name);
                else {
-                       g_string_append_printf(gstr, "\t\t<signal name=\"%s\">\n",
-                                                               signal->name);
+                       g_string_append_printf(gstr,
+                                               "\t\t<signal name=\"%s\">\n",
+                                               signal->name);
                        print_arguments(gstr, signal->args, NULL);
 
                        if (deprecated)
-                               g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n");
+                               g_string_append_printf(gstr,
+                                       G_DBUS_ANNOTATE_DEPRECATED("\t\t\t"));
 
                        g_string_append_printf(gstr, "\t\t</signal>\n");
                }
        }
+
+       for (property = iface->properties; property && property->name;
+                                                               property++) {
+               gboolean deprecated = property->flags &
+                                       G_DBUS_PROPERTY_FLAG_DEPRECATED;
+
+               g_string_append_printf(gstr, "\t\t<property name=\"%s\""
+                                       " type=\"%s\" access=\"%s%s\"",
+                                       property->name, property->type,
+                                       property->get ? "read" : "",
+                                       property->set ? "write" : "");
+
+               if (!deprecated)
+                       g_string_append_printf(gstr, "/>\n");
+               else
+                       g_string_append_printf(gstr,
+                               G_DBUS_ANNOTATE_DEPRECATED(">\n\t\t\t"));
+       }
 }
 
 static void generate_introspection_xml(DBusConnection *conn,
@@ -226,7 +293,7 @@ void g_dbus_pending_success(DBusConnection *connection,
 {
        GSList *list;
 
-        for (list = pending_security; list; list = list->next) {
+       for (list = pending_security; list; list = list->next) {
                struct security_data *secdata = list->data;
 
                if (secdata->pending != pending)
@@ -240,7 +307,7 @@ void g_dbus_pending_success(DBusConnection *connection,
                dbus_message_unref(secdata->message);
                g_free(secdata);
                return;
-        }
+       }
 }
 
 void g_dbus_pending_error_valist(DBusConnection *connection,
@@ -249,7 +316,7 @@ void g_dbus_pending_error_valist(DBusConnection *connection,
 {
        GSList *list;
 
-        for (list = pending_security; list; list = list->next) {
+       for (list = pending_security; list; list = list->next) {
                struct security_data *secdata = list->data;
                DBusMessage *reply;
 
@@ -268,7 +335,7 @@ void g_dbus_pending_error_valist(DBusConnection *connection,
                dbus_message_unref(secdata->message);
                g_free(secdata);
                return;
-        }
+       }
 }
 
 void g_dbus_pending_error(DBusConnection *connection,
@@ -364,12 +431,177 @@ static gboolean check_privilege(DBusConnection *conn, DBusMessage *msg,
        return FALSE;
 }
 
-static void generic_unregister(DBusConnection *connection, void *user_data)
+static GDBusPendingPropertySet next_pending_property = 1;
+static GSList *pending_property_set;
+
+static struct property_data *remove_pending_property_data(
+                                               GDBusPendingPropertySet id)
 {
-       struct generic_data *data = user_data;
+       struct property_data *propdata;
+       GSList *l;
 
-       g_free(data->introspect);
-       g_free(data);
+       for (l = pending_property_set; l != NULL; l = l->next) {
+               propdata = l->data;
+               if (propdata->id != id)
+                       continue;
+
+               break;
+       }
+
+       if (l == NULL)
+               return NULL;
+
+       pending_property_set = g_slist_delete_link(pending_property_set, l);
+
+       return propdata;
+}
+
+void g_dbus_pending_property_success(GDBusPendingPropertySet id)
+{
+       struct property_data *propdata;
+
+       propdata = remove_pending_property_data(id);
+       if (propdata == NULL)
+               return;
+
+       g_dbus_send_reply(propdata->conn, propdata->message,
+                                                       DBUS_TYPE_INVALID);
+       dbus_message_unref(propdata->message);
+       g_free(propdata);
+}
+
+void g_dbus_pending_property_error_valist(GDBusPendingReply id,
+                                       const char *name, const char *format,
+                                       va_list args)
+{
+       struct property_data *propdata;
+       DBusMessage *reply;
+
+       propdata = remove_pending_property_data(id);
+       if (propdata == NULL)
+               return;
+
+       reply = g_dbus_create_error_valist(propdata->message, name, format,
+                                                                       args);
+       if (reply != NULL) {
+               dbus_connection_send(propdata->conn, reply, NULL);
+               dbus_message_unref(reply);
+       }
+
+       dbus_message_unref(propdata->message);
+       g_free(propdata);
+}
+
+void g_dbus_pending_property_error(GDBusPendingReply id, const char *name,
+                                               const char *format, ...)
+{
+       va_list args;
+
+       va_start(args, format);
+
+       g_dbus_pending_property_error_valist(id, name, format, args);
+
+       va_end(args);
+}
+
+static void reset_parent(gpointer data, gpointer user_data)
+{
+       struct generic_data *child = data;
+       struct generic_data *parent = user_data;
+
+       child->parent = parent;
+}
+
+static void append_property(struct interface_data *iface,
+                       const GDBusPropertyTable *p, DBusMessageIter *dict)
+{
+       DBusMessageIter entry, value;
+
+       dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY, NULL,
+                                                               &entry);
+       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &p->name);
+       dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT, p->type,
+                                                               &value);
+
+       p->get(p, &value, iface->user_data);
+
+       dbus_message_iter_close_container(&entry, &value);
+       dbus_message_iter_close_container(dict, &entry);
+}
+
+static void append_properties(struct interface_data *data,
+                                                       DBusMessageIter *iter)
+{
+       DBusMessageIter dict;
+       const GDBusPropertyTable *p;
+
+       dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
+                               DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+                               DBUS_TYPE_STRING_AS_STRING
+                               DBUS_TYPE_VARIANT_AS_STRING
+                               DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
+
+       for (p = data->properties; p && p->name; p++) {
+               if (p->get == NULL)
+                       continue;
+
+               if (p->exists != NULL && !p->exists(p, data->user_data))
+                       continue;
+
+               append_property(data, p, &dict);
+       }
+
+       dbus_message_iter_close_container(iter, &dict);
+}
+
+static void append_interface(gpointer data, gpointer user_data)
+{
+       struct interface_data *iface = data;
+       DBusMessageIter *array = user_data;
+       DBusMessageIter entry;
+
+       dbus_message_iter_open_container(array, DBUS_TYPE_DICT_ENTRY, NULL,
+                                                               &entry);
+       dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &iface->name);
+       append_properties(data, &entry);
+       dbus_message_iter_close_container(array, &entry);
+}
+
+static void emit_interfaces_added(struct generic_data *data)
+{
+       DBusMessage *signal;
+       DBusMessageIter iter, array;
+
+       if (root == NULL || data == root)
+               return;
+
+       signal = dbus_message_new_signal(root->path,
+                                       DBUS_INTERFACE_OBJECT_MANAGER,
+                                       "InterfacesAdded");
+       if (signal == NULL)
+               return;
+
+       dbus_message_iter_init_append(signal, &iter);
+       dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
+                                                               &data->path);
+
+       dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
+                               DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+                               DBUS_TYPE_STRING_AS_STRING
+                               DBUS_TYPE_ARRAY_AS_STRING
+                               DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+                               DBUS_TYPE_STRING_AS_STRING
+                               DBUS_TYPE_VARIANT_AS_STRING
+                               DBUS_DICT_ENTRY_END_CHAR_AS_STRING
+                               DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &array);
+
+       g_slist_foreach(data->added, append_interface, &array);
+       g_slist_free(data->added);
+       data->added = NULL;
+
+       dbus_message_iter_close_container(&iter, &array);
+
+       g_dbus_send_message(data->conn, signal);
 }
 
 static struct interface_data *find_interface(GSList *interfaces,
@@ -410,6 +642,370 @@ static gboolean g_dbus_args_have_signature(const GDBusArgInfo *args,
        return TRUE;
 }
 
+static gboolean remove_interface(struct generic_data *data, const char *name)
+{
+       struct interface_data *iface;
+
+       iface = find_interface(data->interfaces, name);
+       if (iface == NULL)
+               return FALSE;
+
+       process_properties_from_interface(data, iface);
+
+       data->interfaces = g_slist_remove(data->interfaces, iface);
+
+       if (iface->destroy) {
+               iface->destroy(iface->user_data);
+               iface->user_data = NULL;
+       }
+
+       /*
+        * Interface being removed was just added, on the same mainloop
+        * iteration? Don't send any signal
+        */
+       if (g_slist_find(data->added, iface)) {
+               data->added = g_slist_remove(data->added, iface);
+               g_free(iface->name);
+               g_free(iface);
+               return TRUE;
+       }
+
+       if (data->parent == NULL) {
+               g_free(iface->name);
+               g_free(iface);
+               return TRUE;
+       }
+
+       data->removed = g_slist_prepend(data->removed, iface->name);
+       g_free(iface);
+
+       if (data->process_id > 0)
+               return TRUE;
+
+       data->process_id = g_idle_add(process_changes, data);
+
+       return TRUE;
+}
+
+static struct generic_data *invalidate_parent_data(DBusConnection *conn,
+                                               const char *child_path)
+{
+       struct generic_data *data = NULL, *child = NULL, *parent = NULL;
+       char *parent_path, *slash;
+
+       parent_path = g_strdup(child_path);
+       slash = strrchr(parent_path, '/');
+       if (slash == NULL)
+               goto done;
+
+       if (slash == parent_path && parent_path[1] != '\0')
+               parent_path[1] = '\0';
+       else
+               *slash = '\0';
+
+       if (!strlen(parent_path))
+               goto done;
+
+       if (dbus_connection_get_object_path_data(conn, parent_path,
+                                                       (void *) &data) == FALSE) {
+               goto done;
+       }
+
+       parent = invalidate_parent_data(conn, parent_path);
+
+       if (data == NULL) {
+               data = parent;
+               if (data == NULL)
+                       goto done;
+       }
+
+       g_free(data->introspect);
+       data->introspect = NULL;
+
+       if (!dbus_connection_get_object_path_data(conn, child_path,
+                                                       (void *) &child))
+               goto done;
+
+       if (child == NULL || g_slist_find(data->objects, child) != NULL)
+               goto done;
+
+       data->objects = g_slist_prepend(data->objects, child);
+       child->parent = data;
+
+done:
+       g_free(parent_path);
+       return data;
+}
+
+static inline const GDBusPropertyTable *find_property(const GDBusPropertyTable *properties,
+                                                       const char *name)
+{
+       const GDBusPropertyTable *p;
+
+       for (p = properties; p && p->name; p++) {
+               if (strcmp(name, p->name) == 0)
+                       return p;
+       }
+
+       return NULL;
+}
+
+static DBusMessage *properties_get(DBusConnection *connection,
+                                       DBusMessage *message, void *user_data)
+{
+       struct generic_data *data = user_data;
+       struct interface_data *iface;
+       const GDBusPropertyTable *property;
+       const char *interface, *name;
+       DBusMessageIter iter, value;
+       DBusMessage *reply;
+
+       if (!dbus_message_get_args(message, NULL,
+                                       DBUS_TYPE_STRING, &interface,
+                                       DBUS_TYPE_STRING, &name,
+                                       DBUS_TYPE_INVALID))
+               return NULL;
+
+       iface = find_interface(data->interfaces, interface);
+       if (iface == NULL)
+               return g_dbus_create_error(message, DBUS_ERROR_INVALID_ARGS,
+                               "No such interface '%s'", interface);
+
+       property = find_property(iface->properties, name);
+       if (property == NULL)
+               return g_dbus_create_error(message, DBUS_ERROR_INVALID_ARGS,
+                               "No such property '%s'", name);
+
+       if (property->exists != NULL &&
+                       !property->exists(property, iface->user_data))
+               return g_dbus_create_error(message, DBUS_ERROR_INVALID_ARGS,
+                                       "No such property '%s'", name);
+
+       if (property->get == NULL)
+               return g_dbus_create_error(message, DBUS_ERROR_INVALID_ARGS,
+                               "Property '%s' is not readable", name);
+
+       reply = dbus_message_new_method_return(message);
+       if (reply == NULL)
+               return NULL;
+
+       dbus_message_iter_init_append(reply, &iter);
+       dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT,
+                                               property->type, &value);
+
+       if (!property->get(property, &value, iface->user_data)) {
+               dbus_message_unref(reply);
+               return NULL;
+       }
+
+       dbus_message_iter_close_container(&iter, &value);
+
+       return reply;
+}
+
+static DBusMessage *properties_get_all(DBusConnection *connection,
+                                       DBusMessage *message, void *user_data)
+{
+       struct generic_data *data = user_data;
+       struct interface_data *iface;
+       const char *interface;
+       DBusMessageIter iter;
+       DBusMessage *reply;
+
+       if (!dbus_message_get_args(message, NULL,
+                                       DBUS_TYPE_STRING, &interface,
+                                       DBUS_TYPE_INVALID))
+               return NULL;
+
+       iface = find_interface(data->interfaces, interface);
+       if (iface == NULL)
+               return g_dbus_create_error(message, DBUS_ERROR_INVALID_ARGS,
+                                       "No such interface '%s'", interface);
+
+       reply = dbus_message_new_method_return(message);
+       if (reply == NULL)
+               return NULL;
+
+       dbus_message_iter_init_append(reply, &iter);
+
+       append_properties(iface, &iter);
+
+       return reply;
+}
+
+static DBusMessage *properties_set(DBusConnection *connection,
+                                       DBusMessage *message, void *user_data)
+{
+       struct generic_data *data = user_data;
+       DBusMessageIter iter, sub;
+       struct interface_data *iface;
+       const GDBusPropertyTable *property;
+       const char *name, *interface;
+       struct property_data *propdata;
+
+       if (!dbus_message_iter_init(message, &iter))
+               return g_dbus_create_error(message, DBUS_ERROR_INVALID_ARGS,
+                                                       "No arguments given");
+
+       if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
+               return g_dbus_create_error(message, DBUS_ERROR_INVALID_ARGS,
+                                       "Invalid argument type: '%c'",
+                                       dbus_message_iter_get_arg_type(&iter));
+
+       dbus_message_iter_get_basic(&iter, &interface);
+       dbus_message_iter_next(&iter);
+
+       if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
+               return g_dbus_create_error(message, DBUS_ERROR_INVALID_ARGS,
+                                       "Invalid argument type: '%c'",
+                                       dbus_message_iter_get_arg_type(&iter));
+
+       dbus_message_iter_get_basic(&iter, &name);
+       dbus_message_iter_next(&iter);
+
+       if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT)
+               return g_dbus_create_error(message, DBUS_ERROR_INVALID_ARGS,
+                                       "Invalid argument type: '%c'",
+                                       dbus_message_iter_get_arg_type(&iter));
+
+       dbus_message_iter_recurse(&iter, &sub);
+
+       iface = find_interface(data->interfaces, interface);
+       if (iface == NULL)
+               return g_dbus_create_error(message, DBUS_ERROR_INVALID_ARGS,
+                                       "No such interface '%s'", interface);
+
+       property = find_property(iface->properties, name);
+       if (property == NULL)
+               return g_dbus_create_error(message,
+                                               DBUS_ERROR_UNKNOWN_PROPERTY,
+                                               "No such property '%s'", name);
+
+       if (property->set == NULL)
+               return g_dbus_create_error(message,
+                                       DBUS_ERROR_PROPERTY_READ_ONLY,
+                                       "Property '%s' is not writable", name);
+
+       if (property->exists != NULL &&
+                       !property->exists(property, iface->user_data))
+               return g_dbus_create_error(message,
+                                               DBUS_ERROR_UNKNOWN_PROPERTY,
+                                               "No such property '%s'", name);
+
+       propdata = g_new(struct property_data, 1);
+       propdata->id = next_pending_property++;
+       propdata->message = dbus_message_ref(message);
+       propdata->conn = connection;
+       pending_property_set = g_slist_prepend(pending_property_set, propdata);
+
+       property->set(property, &sub, propdata->id, iface->user_data);
+
+       return NULL;
+}
+
+static const GDBusMethodTable properties_methods[] = {
+       { GDBUS_METHOD("Get",
+                       GDBUS_ARGS({ "interface", "s" }, { "name", "s" }),
+                       GDBUS_ARGS({ "value", "v" }),
+                       properties_get) },
+       { GDBUS_ASYNC_METHOD("Set",
+                       GDBUS_ARGS({ "interface", "s" }, { "name", "s" },
+                                                       { "value", "v" }),
+                       NULL,
+                       properties_set) },
+       { GDBUS_METHOD("GetAll",
+                       GDBUS_ARGS({ "interface", "s" }),
+                       GDBUS_ARGS({ "properties", "a{sv}" }),
+                       properties_get_all) },
+       { }
+};
+
+static const GDBusSignalTable properties_signals[] = {
+       { GDBUS_SIGNAL("PropertiesChanged",
+                       GDBUS_ARGS({ "interface", "s" },
+                                       { "changed_properties", "a{sv}" },
+                                       { "invalidated_properties", "as"})) },
+       { }
+};
+
+static void append_name(gpointer data, gpointer user_data)
+{
+       char *name = data;
+       DBusMessageIter *iter = user_data;
+
+       dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &name);
+}
+
+static void emit_interfaces_removed(struct generic_data *data)
+{
+       DBusMessage *signal;
+       DBusMessageIter iter, array;
+
+       if (root == NULL || data == root)
+               return;
+
+       signal = dbus_message_new_signal(root->path,
+                                       DBUS_INTERFACE_OBJECT_MANAGER,
+                                       "InterfacesRemoved");
+       if (signal == NULL)
+               return;
+
+       dbus_message_iter_init_append(signal, &iter);
+       dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
+                                                               &data->path);
+       dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
+                                       DBUS_TYPE_STRING_AS_STRING, &array);
+
+       g_slist_foreach(data->removed, append_name, &array);
+       g_slist_free_full(data->removed, g_free);
+       data->removed = NULL;
+
+       dbus_message_iter_close_container(&iter, &array);
+
+       g_dbus_send_message(data->conn, signal);
+}
+
+static gboolean process_changes(gpointer user_data)
+{
+       struct generic_data *data = user_data;
+
+       data->process_id = 0;
+
+       if (data->added != NULL)
+               emit_interfaces_added(data);
+
+       /* Flush pending properties */
+       if (data->pending_prop == TRUE)
+               process_property_changes(data);
+
+       if (data->removed != NULL)
+               emit_interfaces_removed(data);
+
+       return FALSE;
+}
+
+static void generic_unregister(DBusConnection *connection, void *user_data)
+{
+       struct generic_data *data = user_data;
+       struct generic_data *parent = data->parent;
+
+       if (parent != NULL)
+               parent->objects = g_slist_remove(parent->objects, data);
+
+       if (data->process_id > 0) {
+               g_source_remove(data->process_id);
+               process_changes(data);
+       }
+
+       g_slist_foreach(data->objects, reset_parent, data->parent);
+       g_slist_free(data->objects);
+
+       dbus_connection_unref(data->conn);
+       g_free(data->introspect);
+       g_free(data->path);
+       g_free(data);
+}
+
 static DBusHandlerResult generic_message(DBusConnection *connection,
                                        DBusMessage *message, void *user_data)
 {
@@ -450,48 +1046,100 @@ static DBusObjectPathVTable generic_table = {
        .message_function       = generic_message,
 };
 
-static void invalidate_parent_data(DBusConnection *conn, const char *child_path)
+static const GDBusMethodTable introspect_methods[] = {
+       { GDBUS_METHOD("Introspect", NULL,
+                       GDBUS_ARGS({ "xml", "s" }), introspect) },
+       { }
+};
+
+static void append_interfaces(struct generic_data *data, DBusMessageIter *iter)
 {
-       struct generic_data *data = NULL;
-       char *parent_path, *slash;
+       DBusMessageIter array;
 
-       parent_path = g_strdup(child_path);
-       slash = strrchr(parent_path, '/');
-       if (slash == NULL)
-               goto done;
+       dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
+                               DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+                               DBUS_TYPE_STRING_AS_STRING
+                               DBUS_TYPE_ARRAY_AS_STRING
+                               DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+                               DBUS_TYPE_STRING_AS_STRING
+                               DBUS_TYPE_VARIANT_AS_STRING
+                               DBUS_DICT_ENTRY_END_CHAR_AS_STRING
+                               DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &array);
 
-       if (slash == parent_path && parent_path[1] != '\0')
-               parent_path[1] = '\0';
-       else
-               *slash = '\0';
+       g_slist_foreach(data->interfaces, append_interface, &array);
 
-       if (!strlen(parent_path))
-               goto done;
+       dbus_message_iter_close_container(iter, &array);
+}
 
-       if (dbus_connection_get_object_path_data(conn, parent_path,
-                                                       (void *) &data) == FALSE) {
-               goto done;
-       }
+static void append_object(gpointer data, gpointer user_data)
+{
+       struct generic_data *child = data;
+       DBusMessageIter *array = user_data;
+       DBusMessageIter entry;
+
+       dbus_message_iter_open_container(array, DBUS_TYPE_DICT_ENTRY, NULL,
+                                                               &entry);
+       dbus_message_iter_append_basic(&entry, DBUS_TYPE_OBJECT_PATH,
+                                                               &child->path);
+       append_interfaces(child, &entry);
+       dbus_message_iter_close_container(array, &entry);
+
+       g_slist_foreach(child->objects, append_object, user_data);
+}
 
-       invalidate_parent_data(conn, parent_path);
+static DBusMessage *get_objects(DBusConnection *connection,
+                               DBusMessage *message, void *user_data)
+{
+       struct generic_data *data = user_data;
+       DBusMessage *reply;
+       DBusMessageIter iter;
+       DBusMessageIter array;
 
-       if (data == NULL)
-               goto done;
+       reply = dbus_message_new_method_return(message);
+       if (reply == NULL)
+               return NULL;
 
-       g_free(data->introspect);
-       data->introspect = NULL;
+       dbus_message_iter_init_append(reply, &iter);
 
-done:
-       g_free(parent_path);
+       dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
+                                       DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+                                       DBUS_TYPE_OBJECT_PATH_AS_STRING
+                                       DBUS_TYPE_ARRAY_AS_STRING
+                                       DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+                                       DBUS_TYPE_STRING_AS_STRING
+                                       DBUS_TYPE_ARRAY_AS_STRING
+                                       DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+                                       DBUS_TYPE_STRING_AS_STRING
+                                       DBUS_TYPE_VARIANT_AS_STRING
+                                       DBUS_DICT_ENTRY_END_CHAR_AS_STRING
+                                       DBUS_DICT_ENTRY_END_CHAR_AS_STRING
+                                       DBUS_DICT_ENTRY_END_CHAR_AS_STRING,
+                                       &array);
+
+       g_slist_foreach(data->objects, append_object, &array);
+
+       dbus_message_iter_close_container(&iter, &array);
+
+       return reply;
 }
 
-static const GDBusMethodTable introspect_methods[] = {
-       { GDBUS_METHOD("Introspect", NULL,
-                       GDBUS_ARGS({ "xml", "s" }), introspect) },
+static const GDBusMethodTable manager_methods[] = {
+       { GDBUS_METHOD("GetManagedObjects", NULL,
+               GDBUS_ARGS({ "objects", "a{oa{sa{sv}}}" }), get_objects) },
+       { }
+};
+
+static const GDBusSignalTable manager_signals[] = {
+       { GDBUS_SIGNAL("InterfacesAdded",
+               GDBUS_ARGS({ "object", "o" },
+                               { "interfaces", "a{sa{sv}}" })) },
+       { GDBUS_SIGNAL("InterfacesRemoved",
+               GDBUS_ARGS({ "object", "o" }, { "interfaces", "as" })) },
        { }
 };
 
-static void add_interface(struct generic_data *data, const char *name,
+static void add_interface(struct generic_data *data,
+                               const char *name,
                                const GDBusMethodTable *methods,
                                const GDBusSignalTable *signals,
                                const GDBusPropertyTable *properties,
@@ -509,6 +1157,14 @@ static void add_interface(struct generic_data *data, const char *name,
        iface->destroy = destroy;
 
        data->interfaces = g_slist_append(data->interfaces, iface);
+       if (data->parent == NULL)
+               return;
+
+       data->added = g_slist_append(data->added, iface);
+       if (data->process_id > 0)
+               return;
+
+       data->process_id = g_idle_add(process_changes, data);
 }
 
 static struct generic_data *object_path_ref(DBusConnection *connection,
@@ -525,6 +1181,8 @@ static struct generic_data *object_path_ref(DBusConnection *connection,
        }
 
        data = g_new0(struct generic_data, 1);
+       data->conn = dbus_connection_ref(connection);
+       data->path = g_strdup(path);
        data->refcount = 1;
 
        data->introspect = g_strdup(DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<node></node>");
@@ -538,31 +1196,12 @@ static struct generic_data *object_path_ref(DBusConnection *connection,
 
        invalidate_parent_data(connection, path);
 
-       add_interface(data, DBUS_INTERFACE_INTROSPECTABLE,
-                       introspect_methods, NULL, NULL, data, NULL);
+       add_interface(data, DBUS_INTERFACE_INTROSPECTABLE, introspect_methods,
+                                               NULL, NULL, data, NULL);
 
        return data;
 }
 
-static gboolean remove_interface(struct generic_data *data, const char *name)
-{
-       struct interface_data *iface;
-
-       iface = find_interface(data->interfaces, name);
-       if (iface == NULL)
-               return FALSE;
-
-       data->interfaces = g_slist_remove(data->interfaces, iface);
-
-       if (iface->destroy)
-               iface->destroy(iface->user_data);
-
-       g_free(iface->name);
-       g_free(iface);
-
-       return TRUE;
-}
-
 static void object_path_unref(DBusConnection *connection, const char *path)
 {
        struct generic_data *data = NULL;
@@ -580,10 +1219,11 @@ static void object_path_unref(DBusConnection *connection, const char *path)
                return;
 
        remove_interface(data, DBUS_INTERFACE_INTROSPECTABLE);
+       remove_interface(data, DBUS_INTERFACE_PROPERTIES);
 
-       invalidate_parent_data(connection, path);
+       invalidate_parent_data(data->conn, data->path);
 
-       dbus_connection_unregister_object_path(connection, path);
+       dbus_connection_unregister_object_path(data->conn, data->path);
 }
 
 static gboolean check_signal(DBusConnection *conn, const char *path,
@@ -678,8 +1318,14 @@ gboolean g_dbus_register_interface(DBusConnection *connection,
                return FALSE;
        }
 
-       add_interface(data, name, methods, signals,
-                       properties, user_data, destroy);
+       if (properties != NULL && !find_interface(data->interfaces,
+                                               DBUS_INTERFACE_PROPERTIES))
+               add_interface(data, DBUS_INTERFACE_PROPERTIES,
+                               properties_methods, properties_signals, NULL,
+                               data, NULL);
+
+       add_interface(data, name, methods, signals, properties, user_data,
+                                                               destroy);
 
        g_free(data->introspect);
        data->introspect = NULL;
@@ -708,7 +1354,7 @@ gboolean g_dbus_unregister_interface(DBusConnection *connection,
        g_free(data->introspect);
        data->introspect = NULL;
 
-       object_path_unref(connection, path);
+       object_path_unref(connection, data->path);
 
        return TRUE;
 }
@@ -800,6 +1446,38 @@ gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message)
        return result;
 }
 
+gboolean g_dbus_send_error_valist(DBusConnection *connection,
+                                       DBusMessage *message, const char *name,
+                                       const char *format, va_list args)
+{
+       DBusMessage *error;
+       char str[1024];
+
+       vsnprintf(str, sizeof(str), format, args);
+
+       error = dbus_message_new_error(message, name, str);
+       if (error == NULL)
+               return FALSE;
+
+       return g_dbus_send_message(connection, error);
+}
+
+gboolean g_dbus_send_error(DBusConnection *connection, DBusMessage *message,
+                               const char *name, const char *format, ...)
+{
+       va_list args;
+       gboolean result;
+
+       va_start(args, format);
+
+       result = g_dbus_send_error_valist(connection, message, name,
+                                                       format, args);
+
+       va_end(args);
+
+       return result;
+}
+
 gboolean g_dbus_send_reply_valist(DBusConnection *connection,
                                DBusMessage *message, int type, va_list args)
 {
@@ -856,3 +1534,158 @@ gboolean g_dbus_emit_signal_valist(DBusConnection *connection,
        return emit_signal_valist(connection, path, interface,
                                                        name, type, args);
 }
+
+static void process_properties_from_interface(struct generic_data *data,
+                                               struct interface_data *iface)
+{
+       GSList *l;
+       DBusMessage *signal;
+       DBusMessageIter iter, dict, array;
+       GSList *invalidated;
+
+       if (iface->pending_prop == NULL)
+               return;
+
+       signal = dbus_message_new_signal(data->path,
+                       DBUS_INTERFACE_PROPERTIES, "PropertiesChanged");
+       if (signal == NULL) {
+               error("Unable to allocate new " DBUS_INTERFACE_PROPERTIES
+                                               ".PropertiesChanged signal");
+               return;
+       }
+
+       iface->pending_prop = g_slist_reverse(iface->pending_prop);
+
+       dbus_message_iter_init_append(signal, &iter);
+       dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &iface->name);
+       dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
+                       DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+                       DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
+                       DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
+
+       invalidated = NULL;
+
+       for (l = iface->pending_prop; l != NULL; l = l->next) {
+               GDBusPropertyTable *p = l->data;
+
+               if (p->get == NULL)
+                       continue;
+
+               if (p->exists != NULL && !p->exists(p, iface->user_data)) {
+                       invalidated = g_slist_prepend(invalidated, p);
+                       continue;
+               }
+
+               append_property(iface, p, &dict);
+       }
+
+       dbus_message_iter_close_container(&iter, &dict);
+
+       dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
+                               DBUS_TYPE_STRING_AS_STRING, &array);
+       for (l = invalidated; l != NULL; l = g_slist_next(l)) {
+               GDBusPropertyTable *p = l->data;
+
+               dbus_message_iter_append_basic(&array, DBUS_TYPE_STRING,
+                                                               &p->name);
+       }
+       g_slist_free(invalidated);
+       dbus_message_iter_close_container(&iter, &array);
+
+       g_dbus_send_message(data->conn, signal);
+
+       g_slist_free(iface->pending_prop);
+       iface->pending_prop = NULL;
+}
+
+static void process_property_changes(struct generic_data *data)
+{
+       GSList *l;
+
+       for (l = data->interfaces; l != NULL; l = l->next) {
+               struct interface_data *iface = l->data;
+
+               process_properties_from_interface(data, iface);
+       }
+
+       data->pending_prop = FALSE;
+}
+
+void g_dbus_emit_property_changed(DBusConnection *connection,
+                               const char *path, const char *interface,
+                               const char *name)
+{
+       const GDBusPropertyTable *property;
+       struct generic_data *data;
+       struct interface_data *iface;
+
+       if (!dbus_connection_get_object_path_data(connection, path,
+                                       (void **) &data) || data == NULL)
+               return;
+
+       iface = find_interface(data->interfaces, interface);
+       if (iface == NULL)
+               return;
+
+       property = find_property(iface->properties, name);
+       if (property == NULL) {
+               error("Could not find property %s in %p", name,
+                                                       iface->properties);
+               return;
+       }
+
+       data->pending_prop = TRUE;
+       iface->pending_prop = g_slist_prepend(iface->pending_prop,
+                                               (void *) property);
+
+       if (!data->process_id) {
+               data->process_id = g_idle_add(process_changes, data);
+               return;
+       }
+}
+
+gboolean g_dbus_get_properties(DBusConnection *connection, const char *path,
+                               const char *interface, DBusMessageIter *iter)
+{
+       struct generic_data *data;
+       struct interface_data *iface;
+
+       if (!dbus_connection_get_object_path_data(connection, path,
+                                       (void **) &data) || data == NULL)
+               return FALSE;
+
+       iface = find_interface(data->interfaces, interface);
+       if (iface == NULL)
+               return FALSE;
+
+       append_properties(iface, iter);
+
+       return TRUE;
+}
+
+gboolean g_dbus_attach_object_manager(DBusConnection *connection)
+{
+       struct generic_data *data;
+
+       data = object_path_ref(connection, "/");
+       if (data == NULL)
+               return FALSE;
+
+       add_interface(data, DBUS_INTERFACE_OBJECT_MANAGER,
+                                       manager_methods, manager_signals,
+                                       NULL, data, NULL);
+       root = data;
+
+       return TRUE;
+}
+
+gboolean g_dbus_detach_object_manager(DBusConnection *connection)
+{
+       if (!g_dbus_unregister_interface(connection, "/",
+                                       DBUS_INTERFACE_OBJECT_MANAGER))
+               return FALSE;
+
+       root = NULL;
+
+       return TRUE;
+}
index d749176..9e4f994 100644 (file)
@@ -78,7 +78,7 @@ struct filter_data {
        gboolean registered;
 };
 
-static struct filter_data *filter_data_find(DBusConnection *connection,
+static struct filter_data *filter_data_find_match(DBusConnection *connection,
                                                        const char *name,
                                                        const char *owner,
                                                        const char *path,
@@ -95,28 +95,39 @@ static struct filter_data *filter_data_find(DBusConnection *connection,
                if (connection != data->connection)
                        continue;
 
-               if (name && data->name &&
-                               g_str_equal(name, data->name) == FALSE)
+               if (g_strcmp0(name, data->name) != 0)
                        continue;
 
-               if (owner && data->owner &&
-                               g_str_equal(owner, data->owner) == FALSE)
+               if (g_strcmp0(owner, data->owner) != 0)
                        continue;
 
-               if (path && data->path &&
-                               g_str_equal(path, data->path) == FALSE)
+               if (g_strcmp0(path, data->path) != 0)
                        continue;
 
-               if (interface && data->interface &&
-                               g_str_equal(interface, data->interface) == FALSE)
+               if (g_strcmp0(interface, data->interface) != 0)
                        continue;
 
-               if (member && data->member &&
-                               g_str_equal(member, data->member) == FALSE)
+               if (g_strcmp0(member, data->member) != 0)
                        continue;
 
-               if (argument && data->argument &&
-                               g_str_equal(argument, data->argument) == FALSE)
+               if (g_strcmp0(argument, data->argument) != 0)
+                       continue;
+
+               return data;
+       }
+
+       return NULL;
+}
+
+static struct filter_data *filter_data_find(DBusConnection *connection)
+{
+       GSList *current;
+
+       for (current = listeners;
+                       current != NULL; current = current->next) {
+               struct filter_data *data = current->data;
+
+               if (connection != data->connection)
                        continue;
 
                return data;
@@ -204,7 +215,7 @@ static struct filter_data *filter_data_get(DBusConnection *connection,
        struct filter_data *data;
        const char *name = NULL, *owner = NULL;
 
-       if (filter_data_find(connection, NULL, NULL, NULL, NULL, NULL, NULL) == NULL) {
+       if (filter_data_find(connection) == NULL) {
                if (!dbus_connection_add_filter(connection,
                                        message_filter, NULL, NULL)) {
                        error("dbus_connection_add_filter() failed");
@@ -221,16 +232,16 @@ static struct filter_data *filter_data_get(DBusConnection *connection,
                name = sender;
 
 proceed:
-       data = filter_data_find(connection, name, owner, path, interface,
-                                       member, argument);
+       data = filter_data_find_match(connection, name, owner, path,
+                                               interface, member, argument);
        if (data)
                return data;
 
        data = g_new0(struct filter_data, 1);
 
        data->connection = dbus_connection_ref(connection);
-       data->name = name ? g_strdup(name) : NULL;
-       data->owner = owner ? g_strdup(owner) : NULL;
+       data->name = g_strdup(name);
+       data->owner = g_strdup(owner);
        data->path = g_strdup(path);
        data->interface = g_strdup(interface);
        data->member = g_strdup(member);
@@ -378,8 +389,7 @@ static gboolean filter_data_remove_callback(struct filter_data *data,
        listeners = g_slist_remove(listeners, data);
 
        /* Remove filter if there are no listeners left for the connection */
-       if (filter_data_find(connection, NULL, NULL, NULL, NULL, NULL,
-                                                               NULL) == NULL)
+       if (filter_data_find(connection) == NULL)
                dbus_connection_remove_filter(connection, message_filter,
                                                NULL);
 
@@ -501,6 +511,7 @@ static DBusHandlerResult message_filter(DBusConnection *connection,
 {
        struct filter_data *data;
        const char *sender, *path, *iface, *member, *arg = NULL;
+       GSList *current, *delete_listener = NULL;
 
        /* Only filter signals */
        if (dbus_message_get_type(message) != DBUS_MESSAGE_TYPE_SIGNAL)
@@ -512,39 +523,69 @@ static DBusHandlerResult message_filter(DBusConnection *connection,
        member = dbus_message_get_member(message);
        dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &arg, DBUS_TYPE_INVALID);
 
-       /* Sender is always bus name */
-       data = filter_data_find(connection, NULL, sender, path, iface, member,
-                                       arg);
-       if (data == NULL) {
-               error("Got %s.%s signal which has no listeners", iface, member);
-               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-       }
+       /* Sender is always the owner */
 
-       if (data->handle_func) {
-               data->lock = TRUE;
+       for (current = listeners; current != NULL; current = current->next) {
+               data = current->data;
 
-               data->handle_func(connection, message, data);
+               if (connection != data->connection)
+                       continue;
 
-               data->callbacks = data->processed;
-               data->processed = NULL;
-               data->lock = FALSE;
+               if (data->owner && g_str_equal(sender, data->owner) == FALSE)
+                       continue;
+
+               if (data->path && g_str_equal(path, data->path) == FALSE)
+                       continue;
+
+               if (data->interface && g_str_equal(iface,
+                                               data->interface) == FALSE)
+                       continue;
+
+               if (data->member && g_str_equal(member, data->member) == FALSE)
+                       continue;
+
+               if (data->argument && g_str_equal(arg,
+                                               data->argument) == FALSE)
+                       continue;
+
+               if (data->handle_func) {
+                       data->lock = TRUE;
+
+                       data->handle_func(connection, message, data);
+
+                       data->callbacks = data->processed;
+                       data->processed = NULL;
+                       data->lock = FALSE;
+               }
+
+               if (!data->callbacks)
+                       delete_listener = g_slist_prepend(delete_listener,
+                                                               current);
        }
 
-       if (data->callbacks)
-               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+       for (current = delete_listener; current != NULL;
+                                       current = delete_listener->next) {
+               GSList *l = current->data;
 
-       remove_match(data);
+               data = l->data;
 
-       listeners = g_slist_remove(listeners, data);
+               /* Has any other callback added callbacks back to this data? */
+               if (data->callbacks != NULL)
+                       continue;
+
+               remove_match(data);
+               listeners = g_slist_delete_link(listeners, l);
+
+               filter_data_free(data);
+       }
+
+       g_slist_free(delete_listener);
 
        /* Remove filter if there are no listeners left for the connection */
-       if (filter_data_find(connection, NULL, NULL, NULL, NULL, NULL,
-                                                               NULL) == NULL)
+       if (filter_data_find(connection) == NULL)
                dbus_connection_remove_filter(connection, message_filter,
                                                NULL);
 
-       filter_data_free(data);
-
        return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
 
@@ -711,6 +752,34 @@ guint g_dbus_add_signal_watch(DBusConnection *connection,
        return cb->id;
 }
 
+guint g_dbus_add_properties_watch(DBusConnection *connection,
+                               const char *sender, const char *path,
+                               const char *interface,
+                               GDBusSignalFunction function, void *user_data,
+                               GDBusDestroyFunction destroy)
+{
+       struct filter_data *data;
+       struct filter_callback *cb;
+
+       data = filter_data_get(connection, signal_filter, sender, path,
+                               DBUS_INTERFACE_PROPERTIES, "PropertiesChanged",
+                               interface);
+       if (data == NULL)
+               return 0;
+
+       cb = filter_data_add_callback(data, NULL, NULL, function, destroy,
+                                       user_data);
+       if (cb == NULL)
+               return 0;
+
+       if (data->name != NULL && data->name_watch == 0)
+               data->name_watch = g_dbus_add_service_watch(connection,
+                                                       data->name, NULL,
+                                                       NULL, NULL, NULL);
+
+       return cb->id;
+}
+
 gboolean g_dbus_remove_watch(DBusConnection *connection, guint id)
 {
        struct filter_data *data;
@@ -737,8 +806,7 @@ void g_dbus_remove_all_watches(DBusConnection *connection)
 {
        struct filter_data *data;
 
-       while ((data = filter_data_find(connection, NULL, NULL, NULL, NULL,
-                                       NULL, NULL))) {
+       while ((data = filter_data_find(connection))) {
                listeners = g_slist_remove(listeners, data);
                filter_data_call_and_free(data);
        }
index 1559ba1..b5e0d5f 100644 (file)
@@ -57,6 +57,9 @@ void ofono_handsfree_set_inband_ringing(struct ofono_handsfree *hf,
 void ofono_handsfree_voice_recognition_notify(struct ofono_handsfree *hf,
                                                ofono_bool_t enabled);
 
+void ofono_handsfree_battchg_notify(struct ofono_handsfree *hf,
+                                       unsigned char level);
+
 int ofono_handsfree_driver_register(const struct ofono_handsfree_driver *d);
 void ofono_handsfree_driver_unregister(
                        const struct ofono_handsfree_driver *d);
index 87c8441..6e08275 100644 (file)
@@ -34,6 +34,7 @@ enum ofono_modem_type {
        OFONO_MODEM_TYPE_HARDWARE = 0,
        OFONO_MODEM_TYPE_HFP,
        OFONO_MODEM_TYPE_SAP,
+       OFONO_MODEM_TYPE_TEST,
 };
 
 typedef void (*ofono_modem_online_cb_t)(const struct ofono_error *error,
index 3e5797c..ed850f9 100644 (file)
@@ -77,6 +77,7 @@ enum ofono_sim_state {
        OFONO_SIM_STATE_INSERTED,
        OFONO_SIM_STATE_LOCKED_OUT,
        OFONO_SIM_STATE_READY,
+       OFONO_SIM_STATE_RESETTING,
 };
 
 typedef void (*ofono_sim_file_info_cb_t)(const struct ofono_error *error,
@@ -125,24 +126,31 @@ struct ofono_sim_driver {
        int (*probe)(struct ofono_sim *sim, unsigned int vendor, void *data);
        void (*remove)(struct ofono_sim *sim);
        void (*read_file_info)(struct ofono_sim *sim, int fileid,
+                       const unsigned char *path, unsigned int path_len,
                        ofono_sim_file_info_cb_t cb, void *data);
        void (*read_file_transparent)(struct ofono_sim *sim, int fileid,
                        int start, int length,
+                       const unsigned char *path, unsigned int path_len,
                        ofono_sim_read_cb_t cb, void *data);
        void (*read_file_linear)(struct ofono_sim *sim, int fileid,
                        int record, int length,
+                       const unsigned char *path, unsigned int path_len,
                        ofono_sim_read_cb_t cb, void *data);
        void (*read_file_cyclic)(struct ofono_sim *sim, int fileid,
                        int record, int length,
+                       const unsigned char *path, unsigned int path_len,
                        ofono_sim_read_cb_t cb, void *data);
        void (*write_file_transparent)(struct ofono_sim *sim, int fileid,
                        int start, int length, const unsigned char *value,
+                       const unsigned char *path, unsigned int path_len,
                        ofono_sim_write_cb_t cb, void *data);
        void (*write_file_linear)(struct ofono_sim *sim, int fileid,
                        int record, int length, const unsigned char *value,
+                       const unsigned char *path, unsigned int path_len,
                        ofono_sim_write_cb_t cb, void *data);
        void (*write_file_cyclic)(struct ofono_sim *sim, int fileid,
                        int length, const unsigned char *value,
+                       const unsigned char *path, unsigned int path_len,
                        ofono_sim_write_cb_t cb, void *data);
        void (*read_imsi)(struct ofono_sim *sim,
                        ofono_sim_imsi_cb_t cb, void *data);
@@ -230,6 +238,7 @@ int ofono_sim_write(struct ofono_sim_context *context, int id,
 
 int ofono_sim_read_bytes(struct ofono_sim_context *context, int id,
                        unsigned short offset, unsigned short num_bytes,
+                       const unsigned char *path, unsigned int path_len,
                        ofono_sim_file_read_cb_t cb, void *data);
 
 unsigned int ofono_sim_add_file_watch(struct ofono_sim_context *context,
index 6781b98..a9244eb 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-01-19.21; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -156,6 +156,10 @@ while test $# -ne 0; do
     -s) stripcmd=$stripprog;;
 
     -t) dst_arg=$2
+       # Protect names problematic for `test' and other utilities.
+       case $dst_arg in
+         -* | [=\(\)!]) dst_arg=./$dst_arg;;
+       esac
        shift;;
 
     -T) no_target_directory=true;;
@@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
     fi
     shift # arg
     dst_arg=$arg
+    # Protect names problematic for `test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
   done
 fi
 
@@ -200,7 +208,11 @@ if test $# -eq 0; then
 fi
 
 if test -z "$dir_arg"; then
-  trap '(exit $?); exit' 1 2 13 15
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
 
   # Set umask so as not to create temps with too-generous modes.
   # However, 'strip' requires both read and write access to temps.
@@ -228,9 +240,9 @@ fi
 
 for src
 do
-  # Protect names starting with `-'.
+  # Protect names problematic for `test' and other utilities.
   case $src in
-    -*) src=./$src;;
+    -* | [=\(\)!]) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
@@ -252,12 +264,7 @@ do
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
     dst=$dst_arg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst;;
-    esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
@@ -385,7 +392,7 @@ do
 
       case $dstdir in
        /*) prefix='/';;
-       -*) prefix='./';;
+       [-=\(\)!]*) prefix='./';;
        *)  prefix='';;
       esac
 
@@ -403,7 +410,7 @@ do
 
       for d
       do
-       test -z "$d" && continue
+       test X"$d" = X && continue
 
        prefix=$prefix$d
        if test -d "$prefix"; then
index 3061e3c..33f642a 100755 (executable)
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,9 +1,9 @@
 
-# libtool (GNU libtool) 2.4
+# libtool (GNU libtool) 2.4.2
 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -41,6 +41,7 @@
 #       --quiet, --silent    don't print informational messages
 #       --no-quiet, --no-silent
 #                            print informational messages (default)
+#       --no-warn            don't display warning messages
 #       --tag=TAG            use configuration variables from tag TAG
 #   -v, --verbose            print more informational messages than default
 #       --no-verbose         don't print the extra informational messages
@@ -69,7 +70,7 @@
 #         compiler:            $LTCC
 #         compiler flags:              $LTCFLAGS
 #         linker:              $LD (gnu? $with_gnu_ld)
-#         $progname:   (GNU libtool) 2.4
+#         $progname:   (GNU libtool) 2.4.2 Debian-2.4.2-1.1
 #         automake:    $automake_version
 #         autoconf:    $autoconf_version
 #
@@ -79,9 +80,9 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION=2.4
+VERSION="2.4.2 Debian-2.4.2-1.1"
 TIMESTAMP=""
-package_revision=1.3293
+package_revision=1.3337
 
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -136,15 +137,10 @@ progpath="$0"
 
 : ${CP="cp -f"}
 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${EGREP="grep -E"}
-: ${FGREP="grep -F"}
-: ${GREP="grep"}
-: ${LN_S="ln -s"}
 : ${MAKE="make"}
 : ${MKDIR="mkdir"}
 : ${MV="mv -f"}
 : ${RM="rm -f"}
-: ${SED="sed"}
 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
 : ${Xsed="$SED -e 1s/^X//"}
 
@@ -387,7 +383,7 @@ case $progpath in
      ;;
   *)
      save_IFS="$IFS"
-     IFS=:
+     IFS=${PATH_SEPARATOR-:}
      for progdir in $PATH; do
        IFS="$save_IFS"
        test -x "$progdir/$progname" && break
@@ -771,8 +767,8 @@ func_help ()
        s*\$LTCFLAGS*'"$LTCFLAGS"'*
        s*\$LD*'"$LD"'*
        s/\$with_gnu_ld/'"$with_gnu_ld"'/
-       s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
-       s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+       s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+       s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
        p
        d
      }
@@ -1052,6 +1048,7 @@ opt_finish=false
 opt_help=false
 opt_help_all=false
 opt_silent=:
+opt_warning=:
 opt_verbose=:
 opt_silent=false
 opt_verbose=false
@@ -1120,6 +1117,10 @@ esac
                        opt_silent=false
 func_append preserve_args " $opt"
                        ;;
+      --no-warning|--no-warn)
+                       opt_warning=false
+func_append preserve_args " $opt"
+                       ;;
       --no-verbose)
                        opt_verbose=false
 func_append preserve_args " $opt"
@@ -2059,7 +2060,7 @@ func_mode_compile ()
     *.[cCFSifmso] | \
     *.ada | *.adb | *.ads | *.asm | \
     *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
-    *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
+    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
       func_xform "$libobj"
       libobj=$func_xform_result
       ;;
@@ -3201,11 +3202,13 @@ func_mode_install ()
 
       # Set up the ranlib parameters.
       oldlib="$destdir/$name"
+      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+      tool_oldlib=$func_to_tool_file_result
 
       func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
 
       if test -n "$stripme" && test -n "$old_striplib"; then
-       func_show_eval "$old_striplib $oldlib" 'exit $?'
+       func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
       fi
 
       # Do each command in the postinstall commands.
@@ -3470,7 +3473,7 @@ static const void *lt_preloaded_setup() {
          # linked before any other PIC object.  But we must not use
          # pic_flag when linking with -static.  The problem exists in
          # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-         *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+         *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
            pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
          *-*-hpux*)
            pic_flag_for_symtable=" $pic_flag"  ;;
@@ -3982,14 +3985,17 @@ func_exec_program_core ()
 # launches target application with the remaining arguments.
 func_exec_program ()
 {
-  for lt_wr_arg
-  do
-    case \$lt_wr_arg in
-    --lt-*) ;;
-    *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
-    esac
-    shift
-  done
+  case \" \$* \" in
+  *\\ --lt-*)
+    for lt_wr_arg
+    do
+      case \$lt_wr_arg in
+      --lt-*) ;;
+      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+      esac
+      shift
+    done ;;
+  esac
   func_exec_program_core \${1+\"\$@\"}
 }
 
@@ -5057,9 +5063,15 @@ void lt_dump_script (FILE* f)
 {
 EOF
            func_emit_wrapper yes |
-              $SED -e 's/\([\\"]\)/\\\1/g' \
-                  -e 's/^/  fputs ("/' -e 's/$/\\n", f);/'
-
+             $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/  fputs ("\1", f);/p
+g
+D'
             cat <<"EOF"
 }
 EOF
@@ -5643,7 +5655,8 @@ func_mode_link ()
        continue
        ;;
 
-      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
        func_append compiler_flags " $arg"
        func_append compile_command " $arg"
        func_append finalize_command " $arg"
@@ -6111,7 +6124,10 @@ func_mode_link ()
        case $pass in
        dlopen) libs="$dlfiles" ;;
        dlpreopen) libs="$dlprefiles" ;;
-       link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+       link)
+         libs="$deplibs %DEPLIBS%"
+         test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+         ;;
        esac
       fi
       if test "$linkmode,$pass" = "lib,dlpreopen"; then
@@ -6147,7 +6163,8 @@ func_mode_link ()
        lib=
        found=no
        case $deplib in
-       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
          if test "$linkmode,$pass" = "prog,link"; then
            compile_deplibs="$deplib $compile_deplibs"
            finalize_deplibs="$deplib $finalize_deplibs"
@@ -6430,19 +6447,19 @@ func_mode_link ()
            # It is a libtool convenience library, so add in its objects.
            func_append convenience " $ladir/$objdir/$old_library"
            func_append old_convenience " $ladir/$objdir/$old_library"
+           tmp_libs=
+           for deplib in $dependency_libs; do
+             deplibs="$deplib $deplibs"
+             if $opt_preserve_dup_deps ; then
+               case "$tmp_libs " in
+               *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+               esac
+             fi
+             func_append tmp_libs " $deplib"
+           done
          elif test "$linkmode" != prog && test "$linkmode" != lib; then
            func_fatal_error "\`$lib' is not a convenience library"
          fi
-         tmp_libs=
-         for deplib in $dependency_libs; do
-           deplibs="$deplib $deplibs"
-           if $opt_preserve_dup_deps ; then
-             case "$tmp_libs " in
-             *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-             esac
-           fi
-           func_append tmp_libs " $deplib"
-         done
          continue
        fi # $pass = conv
 
@@ -6831,7 +6848,7 @@ func_mode_link ()
                 test "$hardcode_direct_absolute" = no; then
                add="$dir/$linklib"
              elif test "$hardcode_minus_L" = yes; then
-               add_dir="-L$dir"
+               add_dir="-L$absdir"
                # Try looking first in the location we're being installed to.
                if test -n "$inst_prefix_dir"; then
                  case $libdir in
@@ -7316,6 +7333,7 @@ func_mode_link ()
          # which has an extra 1 added just for fun
          #
          case $version_type in
+         # correct linux to gnu/linux during the next big refactor
          darwin|linux|osf|windows|none)
            func_arith $number_major + $number_minor
            current=$func_arith_result
@@ -7334,6 +7352,9 @@ func_mode_link ()
            revision="$number_minor"
            lt_irix_increment=no
            ;;
+         *)
+           func_fatal_configuration "$modename: unknown library version type \`$version_type'"
+           ;;
          esac
          ;;
        no)
@@ -7432,7 +7453,7 @@ func_mode_link ()
          versuffix="$major.$revision"
          ;;
 
-       linux)
+       linux) # correct to gnu/linux during the next big refactor
          func_arith $current - $age
          major=.$func_arith_result
          versuffix="$major.$age.$revision"
@@ -8020,6 +8041,11 @@ EOF
 
       # Test again, we may have decided not to build it any more
       if test "$build_libtool_libs" = yes; then
+       # Remove ${wl} instances when linking with ld.
+       # FIXME: should test the right _cmds variable.
+       case $archive_cmds in
+         *\$LD\ *) wl= ;;
+        esac
        if test "$hardcode_into_libs" = yes; then
          # Hardcode the library paths
          hardcode_libdirs=
@@ -8050,7 +8076,7 @@ EOF
            elif test -n "$runpath_var"; then
              case "$perm_rpath " in
              *" $libdir "*) ;;
-             *) func_apped perm_rpath " $libdir" ;;
+             *) func_append perm_rpath " $libdir" ;;
              esac
            fi
          done
@@ -8058,11 +8084,7 @@ EOF
          if test -n "$hardcode_libdir_separator" &&
             test -n "$hardcode_libdirs"; then
            libdir="$hardcode_libdirs"
-           if test -n "$hardcode_libdir_flag_spec_ld"; then
-             eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
-           else
-             eval dep_rpath=\"$hardcode_libdir_flag_spec\"
-           fi
+           eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
          fi
          if test -n "$runpath_var" && test -n "$perm_rpath"; then
            # We should set the runpath_var.
@@ -9152,6 +9174,8 @@ EOF
            esac
          done
        fi
+       func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+       tool_oldlib=$func_to_tool_file_result
        eval cmds=\"$old_archive_cmds\"
 
        func_len " $cmds"
@@ -9261,7 +9285,8 @@ EOF
              *.la)
                func_basename "$deplib"
                name="$func_basename_result"
-               eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+               func_resolve_sysroot "$deplib"
+               eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
                test -z "$libdir" && \
                  func_fatal_error "\`$deplib' is not a valid libtool archive"
                func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
diff --git a/missing b/missing
index 28055d2..86a8fc3 100755 (executable)
--- a/missing
+++ b/missing
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-01-06.13; # UTC
 
 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -84,7 +84,6 @@ Supported PROGRAM values:
   help2man     touch the output file
   lex          create \`lex.yy.c', if possible, from existing .c
   makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
   yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
 
 Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
@@ -122,15 +121,6 @@ case $1 in
     # Not GNU programs, they don't have --version.
     ;;
 
-  tar*)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
   *)
     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
        # We have it, but it failed.
@@ -226,7 +216,7 @@ WARNING: \`$1' $msg.  You should only need it if
          \`Bison' from any GNU archive site."
     rm -f y.tab.c y.tab.h
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
        case $LASTARG in
        *.y)
            SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
@@ -256,7 +246,7 @@ WARNING: \`$1' is $msg.  You should only need it if
          \`Flex' from any GNU archive site."
     rm -f lex.yy.c
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
        case $LASTARG in
        *.l)
            SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
@@ -318,41 +308,6 @@ WARNING: \`$1' is $msg.  You should only need it if
     touch $file
     ;;
 
-  tar*)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-       case $firstarg in
-       *o*)
-           firstarg=`echo "$firstarg" | sed s/o//`
-           tar "$firstarg" "$@" && exit 0
-           ;;
-       esac
-       case $firstarg in
-       *h*)
-           firstarg=`echo "$firstarg" | sed s/h//`
-           tar "$firstarg" "$@" && exit 0
-           ;;
-       esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
   *)
     echo 1>&2 "\
 WARNING: \`$1' is needed, and is $msg.
index eec8708..dd42e57 100644 (file)
@@ -1,3 +1,6 @@
+* Mon May 27 2013 Chengyi Zhao <chengyix.zhao@intel.com>
+- Upgrade ofono to 1.12
+
 * Thu Jan 10 2013 Chengyi Zhao <chengyix.zhao@intel.com>
 - Fix bug: TIVI-460 ofono-test:missing dependence to python-xml and dbus-python
 
index cf8933c..6437f7c 100644 (file)
@@ -1,5 +1,5 @@
 Name:           ofono
-Version:        1.11
+Version:        1.12
 Release:        1
 License:        GPL-2.0
 Summary:        Open Source Telephony
index 8005170..fb1d1ae 100644 (file)
@@ -230,7 +230,8 @@ static void alcatel_pre_sim(struct ofono_modem *modem)
        DBG("%p", modem);
 
        ofono_devinfo_create(modem, 0, "atmodem", data->aux);
-       sim = ofono_sim_create(modem, 0, "atmodem", data->aux);
+       sim = ofono_sim_create(modem, OFONO_VENDOR_ALCATEL,
+                               "atmodem", data->aux);
 
        if (sim && data->have_sim == TRUE)
                ofono_sim_inserted_notify(sim, TRUE);
index 5924b16..4daa459 100644 (file)
@@ -270,6 +270,9 @@ static void discover_cb(uint8_t count, const struct qmi_version *list,
                case QMI_SERVICE_PBM:
                        data->features |= GOBI_PBM;
                        break;
+               case QMI_SERVICE_UIM:
+                       data->features |= GOBI_UIM;
+                       break;
                case QMI_SERVICE_CAT:
                        data->features |= GOBI_CAT;
                        break;
index 5b70f42..df36ba7 100644 (file)
@@ -95,7 +95,6 @@ struct ifx_data {
        int mux_ldisc;
        int saved_ldisc;
        struct ofono_sim *sim;
-       gboolean have_sim;
 };
 
 static void ifx_debug(const char *str, void *user_data)
@@ -140,24 +139,29 @@ static void ifx_set_sim_state(struct ifx_data *data, int state)
 
        switch (state) {
        case 0: /* SIM not present */
+       case 6: /* SIM Error */
+       case 8: /* SIM Technical Problem */
        case 9: /* SIM Removed */
-               if (data->have_sim == TRUE) {
-                       ofono_sim_inserted_notify(data->sim, FALSE);
-                       data->have_sim = FALSE;
-               }
+               ofono_sim_inserted_notify(data->sim, FALSE);
                break;
        case 1: /* PIN verification needed */
-       case 2: /* PIN verification not needed – Ready */
-       case 3: /* PIN verified – Ready */
        case 4: /* PUK verification needed */
        case 5: /* SIM permanently blocked */
-       case 6: /* SIM Error */
        case 7: /* ready for attach (+COPS) */
-       case 8: /* SIM Technical Problem */
-               if (data->have_sim == FALSE) {
-                       ofono_sim_inserted_notify(data->sim, TRUE);
-                       data->have_sim = TRUE;
-               }
+               ofono_sim_inserted_notify(data->sim, TRUE);
+               break;
+       case 2: /* PIN verification not needed – Ready */
+       case 3: /* PIN verified – Ready */
+               /*
+                * State 3 is handled in the SIM atom driver
+                * while for state 2 we should be waiting for state 7
+                */
+               break;
+       case 10: /* SIM Reactivating */
+       case 11: /* SIM Reactivated */
+       case 12: /* SIM SMS Caching Completed */
+       case 99: /* SIM State Unknown */
+               ofono_warn("Unhandled SIM state %d received", state);
                break;
        default:
                ofono_warn("Unknown SIM state %d received", state);
@@ -317,8 +321,6 @@ static void xgendata_query(gboolean ok, GAtResult *result, gpointer user_data)
        g_at_chat_send(data->dlcs[AUX_DLC], "AT+XPOW=0,0,0", none_prefix,
                                                        NULL, NULL, NULL);
 
-       data->have_sim = FALSE;
-
        /* notify that the modem is ready so that pre_sim gets called */
        ofono_modem_set_powered(modem, TRUE);
 
@@ -452,7 +454,7 @@ static void setup_internal_mux(struct ofono_modem *modem)
        }
 
        /* wait for DLC creation to settle */
-       data->dlc_init_source = g_timeout_add(10, dlc_setup, modem);
+       data->dlc_init_source = g_timeout_add(500, dlc_setup, modem);
 
        return;
 
@@ -670,6 +672,8 @@ static void ifx_pre_sim(struct ofono_modem *modem)
 static void ifx_post_sim(struct ofono_modem *modem)
 {
        struct ifx_data *data = ofono_modem_get_data(modem);
+       struct ofono_gprs *gprs;
+       struct ofono_gprs_context *gc;
 
        DBG("%p", modem);
 
@@ -681,14 +685,34 @@ static void ifx_post_sim(struct ofono_modem *modem)
 
        ofono_sms_create(modem, OFONO_VENDOR_IFX,
                                        "atmodem", data->dlcs[AUX_DLC]);
+
+       gprs = ofono_gprs_create(modem, OFONO_VENDOR_IFX,
+                                       "atmodem", data->dlcs[NETREG_DLC]);
+       if (gprs == NULL)
+               return;
+
+       if (data->mux_ldisc < 0) {
+               gc = ofono_gprs_context_create(modem, 0,
+                                       "ifxmodem", data->dlcs[GPRS1_DLC]);
+               if (gc)
+                       ofono_gprs_add_context(gprs, gc);
+
+               gc = ofono_gprs_context_create(modem, 0,
+                                       "ifxmodem", data->dlcs[GPRS2_DLC]);
+               if (gc)
+                       ofono_gprs_add_context(gprs, gc);
+
+               gc = ofono_gprs_context_create(modem, 0,
+                                       "ifxmodem", data->dlcs[GPRS3_DLC]);
+               if (gc)
+                       ofono_gprs_add_context(gprs, gc);
+       }
 }
 
 static void ifx_post_online(struct ofono_modem *modem)
 {
        struct ifx_data *data = ofono_modem_get_data(modem);
        struct ofono_message_waiting *mw;
-       struct ofono_gprs *gprs;
-       struct ofono_gprs_context *gc;
 
        DBG("%p", modem);
 
@@ -708,28 +732,6 @@ static void ifx_post_online(struct ofono_modem *modem)
        mw = ofono_message_waiting_create(modem);
        if (mw)
                ofono_message_waiting_register(mw);
-
-       gprs = ofono_gprs_create(modem, OFONO_VENDOR_IFX,
-                                       "atmodem", data->dlcs[NETREG_DLC]);
-       if (gprs == NULL)
-               return;
-
-       if (data->mux_ldisc < 0) {
-               gc = ofono_gprs_context_create(modem, 0,
-                                       "ifxmodem", data->dlcs[GPRS1_DLC]);
-               if (gc)
-                       ofono_gprs_add_context(gprs, gc);
-
-               gc = ofono_gprs_context_create(modem, 0,
-                                       "ifxmodem", data->dlcs[GPRS2_DLC]);
-               if (gc)
-                       ofono_gprs_add_context(gprs, gc);
-
-               gc = ofono_gprs_context_create(modem, 0,
-                                       "ifxmodem", data->dlcs[GPRS3_DLC]);
-               if (gc)
-                       ofono_gprs_add_context(gprs, gc);
-       }
 }
 
 static struct ofono_modem_driver ifx_driver = {
index 3299bc2..0d46643 100644 (file)
@@ -137,7 +137,9 @@ static void sim_state_cb(gboolean present, gpointer user_data)
        at_util_sim_state_query_free(data->sim_state_query);
        data->sim_state_query = NULL;
 
-       data->flags |= MBM_FLAG_HAVE_SIM;
+       if (present)
+               data->flags |= MBM_FLAG_HAVE_SIM;
+
        ofono_modem_set_powered(modem, TRUE);
 }
 
diff --git a/plugins/stktest.c b/plugins/stktest.c
new file mode 100644 (file)
index 0000000..6f7413d
--- /dev/null
@@ -0,0 +1,254 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2008-2011  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <stdio.h>
+
+#include <glib.h>
+#include <gatmux.h>
+#include <gatchat.h>
+
+#define OFONO_API_SUBJECT_TO_CHANGE
+#include <ofono/plugin.h>
+#include <ofono/log.h>
+#include <ofono/modem.h>
+#include <ofono/stk.h>
+
+#include <drivers/atmodem/atutil.h>
+#include <drivers/atmodem/vendor.h>
+
+#include "ofono.h"
+
+static struct ofono_modem *stktest;
+
+static const char *none_prefix[] = { NULL };
+
+struct stktest_data {
+       GAtChat *chat;
+};
+
+static int stktest_probe(struct ofono_modem *modem)
+{
+       struct stktest_data *data;
+
+       DBG("%p", modem);
+
+       data = g_try_new0(struct stktest_data, 1);
+       if (data == NULL)
+               return -ENOMEM;
+
+       ofono_modem_set_data(modem, data);
+
+       return 0;
+}
+
+static void stktest_remove(struct ofono_modem *modem)
+{
+       struct stktest_data *data = ofono_modem_get_data(modem);
+
+       DBG("%p", modem);
+
+       g_free(data);
+       ofono_modem_set_data(modem, NULL);
+}
+
+static void stktest_debug(const char *str, void *prefix)
+{
+       ofono_info("%s%s", (const char *) prefix, str);
+}
+
+static void stktest_disconnected(gpointer user_data)
+{
+       struct ofono_modem *modem = user_data;
+       struct stktest_data *data = ofono_modem_get_data(modem);
+
+       DBG("");
+
+       ofono_modem_set_powered(modem, FALSE);
+
+       g_at_chat_unref(data->chat);
+       data->chat = NULL;
+}
+
+static int connect_socket(const char *address, int port)
+{
+       struct sockaddr_in addr;
+       int sk;
+       int err;
+
+       sk = socket(PF_INET, SOCK_STREAM, 0);
+       if (sk < 0)
+               return -EINVAL;
+
+       memset(&addr, 0, sizeof(addr));
+       addr.sin_family = AF_INET;
+       addr.sin_addr.s_addr = inet_addr(address);
+       addr.sin_port = htons(port);
+
+       err = connect(sk, (struct sockaddr *) &addr, sizeof(addr));
+       if (err < 0) {
+               close(sk);
+               return -errno;
+       }
+
+       return sk;
+}
+
+static int stktest_enable(struct ofono_modem *modem)
+{
+       struct stktest_data *data = ofono_modem_get_data(modem);
+       GIOChannel *io;
+       GAtSyntax *syntax;
+       int sk;
+
+       DBG("%p", modem);
+
+       sk = connect_socket("127.0.0.1", 12765);
+       if (sk < 0)
+               return sk;
+
+       io = g_io_channel_unix_new(sk);
+       if (io == NULL) {
+               close(sk);
+               return -ENOMEM;
+       }
+
+       syntax = g_at_syntax_new_gsmv1();
+       data->chat = g_at_chat_new(io, syntax);
+       g_at_syntax_unref(syntax);
+       g_io_channel_unref(io);
+
+       if (data->chat == NULL)
+               return -ENOMEM;
+
+       if (getenv("OFONO_AT_DEBUG"))
+               g_at_chat_set_debug(data->chat, stktest_debug, "");
+
+       g_at_chat_set_disconnect_function(data->chat,
+                                               stktest_disconnected, modem);
+
+       return 0;
+}
+
+static void set_online_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+       struct cb_data *cbd = user_data;
+       ofono_modem_online_cb_t callback = cbd->cb;
+       struct ofono_error error;
+
+       decode_at_error(&error, g_at_result_final_response(result));
+
+       callback(&error, cbd->data);
+}
+
+static void stktest_set_online(struct ofono_modem *modem, ofono_bool_t online,
+                               ofono_modem_online_cb_t cb, void *user_data)
+{
+       struct stktest_data *data = ofono_modem_get_data(modem);
+       struct cb_data *cbd = cb_data_new(cb, user_data);
+       char buf[64];
+
+       DBG("%p", modem);
+
+       snprintf(buf, sizeof(buf), "AT+CFUN=%d", online ? 1 : 4);
+
+       if (g_at_chat_send(data->chat, buf, none_prefix,
+                               set_online_cb, cbd, g_free) > 0)
+               return;
+
+       CALLBACK_WITH_FAILURE(cb, user_data);
+}
+
+static int stktest_disable(struct ofono_modem *modem)
+{
+       struct stktest_data *data = ofono_modem_get_data(modem);
+
+       DBG("%p", modem);
+
+       g_at_chat_unref(data->chat);
+       data->chat = NULL;
+
+       return 0;
+}
+
+static void stktest_pre_sim(struct ofono_modem *modem)
+{
+       DBG("%p", modem);
+}
+
+static void stktest_post_sim(struct ofono_modem *modem)
+{
+       struct stktest_data *data = ofono_modem_get_data(modem);
+
+       DBG("%p", modem);
+
+       ofono_stk_create(modem, OFONO_VENDOR_PHONESIM, "atmodem", data->chat);
+}
+
+static void stktest_post_online(struct ofono_modem *modem)
+{
+}
+
+static struct ofono_modem_driver stktest_driver = {
+       .modem_type     = OFONO_MODEM_TYPE_TEST,
+       .name           = "stktest",
+       .probe          = stktest_probe,
+       .remove         = stktest_remove,
+       .enable         = stktest_enable,
+       .disable        = stktest_disable,
+       .set_online     = stktest_set_online,
+       .pre_sim        = stktest_pre_sim,
+       .post_sim       = stktest_post_sim,
+       .post_online    = stktest_post_online,
+};
+
+static int stktest_init(void)
+{
+       int err;
+
+       err = ofono_modem_driver_register(&stktest_driver);
+       if (err < 0)
+               return err;
+
+       stktest = ofono_modem_create("stktest", "stktest");
+       ofono_modem_register(stktest);
+
+       return 0;
+}
+
+static void stktest_exit(void)
+{
+       ofono_modem_remove(stktest);
+       ofono_modem_driver_unregister(&stktest_driver);
+}
+
+OFONO_PLUGIN_DEFINE(stktest, "STK End-to-End tester driver", VERSION,
+               OFONO_PLUGIN_PRIORITY_DEFAULT, stktest_init, stktest_exit)
index fe2ccd6..79bc421 100644 (file)
@@ -186,6 +186,7 @@ static GAtChat *open_device(struct ofono_modem *modem,
        GAtSyntax *syntax;
        GIOChannel *channel;
        GAtChat *chat;
+       GHashTable *options;
 
        device = ofono_modem_get_string(modem, key);
        if (device == NULL)
@@ -193,7 +194,16 @@ static GAtChat *open_device(struct ofono_modem *modem,
 
        DBG("%s %s", key, device);
 
-       channel = g_at_tty_open(device, NULL);
+       options = g_hash_table_new(g_str_hash, g_str_equal);
+       if (options == NULL)
+               return NULL;
+
+       g_hash_table_insert(options, "Baud", "115200");
+
+       channel = g_at_tty_open(device, options);
+
+       g_hash_table_destroy(options);
+
        if (channel == NULL)
                return NULL;
 
index bd5e5e0..afb02ca 100644 (file)
@@ -305,18 +305,25 @@ static gboolean setup_huawei(struct modem_info *modem)
 
                if (g_strcmp0(info->label, "modem") == 0 ||
                                g_strcmp0(info->interface, "255/1/1") == 0 ||
-                               g_strcmp0(info->interface, "255/2/1") == 0) {
+                               g_strcmp0(info->interface, "255/2/1") == 0 ||
+                               g_strcmp0(info->interface, "255/1/49") == 0) {
                        mdm = info->devnode;
                } else if (g_strcmp0(info->label, "pcui") == 0 ||
                                g_strcmp0(info->interface, "255/1/2") == 0 ||
-                               g_strcmp0(info->interface, "255/2/2") == 0) {
+                               g_strcmp0(info->interface, "255/2/2") == 0 ||
+                               g_strcmp0(info->interface, "255/1/50") == 0) {
                        pcui = info->devnode;
                } else if (g_strcmp0(info->label, "diag") == 0 ||
                                g_strcmp0(info->interface, "255/1/3") == 0 ||
-                               g_strcmp0(info->interface, "255/2/3") == 0) {
+                               g_strcmp0(info->interface, "255/2/3") == 0 ||
+                               g_strcmp0(info->interface, "255/1/51") == 0) {
                        diag = info->devnode;
-               } else if (g_strcmp0(info->interface, "255/1/8") == 0) {
+               } else if (g_strcmp0(info->interface, "255/1/8") == 0 ||
+                               g_strcmp0(info->interface, "255/1/56") == 0) {
                        net = info->devnode;
+               } else if (g_strcmp0(info->interface, "255/1/9") == 0 ||
+                               g_strcmp0(info->interface, "255/1/57") == 0) {
+                       qmi = info->devnode;
                } else if (g_strcmp0(info->interface, "255/255/255") == 0) {
                        if (g_strcmp0(info->number, "00") == 0)
                                mdm = info->devnode;
@@ -331,9 +338,15 @@ static gboolean setup_huawei(struct modem_info *modem)
                }
        }
 
+       if (qmi != NULL && net != NULL) {
+               ofono_modem_set_driver(modem->modem, "gobi");
+               goto done;
+       }
+
        if (mdm == NULL || pcui == NULL)
                return FALSE;
 
+done:
        DBG("mdm=%s pcui=%s diag=%s qmi=%s net=%s", mdm, pcui, diag, qmi, net);
 
        ofono_modem_set_string(modem->modem, "Device", qmi);
@@ -946,7 +959,7 @@ static struct {
        { "icera",      "cdc_acm",      "0421", "0633"  },
        { "icera",      "cdc_ether",    "0421", "0633"  },
        { "mbm",        "cdc_acm",      "0bdb"          },
-       { "mbm"         "cdc_ether",    "0bdb"          },
+       { "mbm",        "cdc_ether",    "0bdb"          },
        { "mbm",        "cdc_acm",      "0fce"          },
        { "mbm",        "cdc_ether",    "0fce"          },
        { "mbm",        "cdc_acm",      "413c"          },
@@ -962,6 +975,7 @@ static struct {
        { "sierra",     "sierra_net"                    },
        { "option",     "option",       "0af0"          },
        { "huawei",     "option",       "201e"          },
+       { "huawei",     "cdc_wdm",      "12d1"          },
        { "huawei",     "cdc_ether",    "12d1"          },
        { "huawei",     "qmi_wwan",     "12d1"          },
        { "huawei",     "option",       "12d1"          },
index f3f022c..7f24eae 100644 (file)
@@ -111,6 +111,8 @@ static int wavecom_enable(struct ofono_modem *modem)
        if (chat == NULL)
                return -ENOMEM;
 
+       g_at_chat_add_terminator(chat, "+CPIN:", 6, TRUE);
+
        if (getenv("OFONO_AT_DEBUG"))
                g_at_chat_set_debug(chat, wavecom_debug, "");
 
index 3f5c12d..1558a51 100644 (file)
@@ -409,6 +409,14 @@ DBusMessage *__ofono_error_not_recognized(DBusMessage *msg)
                                        "String not recognized as USSD/SS");
 }
 
+DBusMessage *__ofono_error_network_terminated(DBusMessage *msg)
+{
+       return g_dbus_create_error(msg, OFONO_ERROR_INTERFACE
+                                       ".Terminated",
+                                       "Operation was terminated by the"
+                                       " network");
+}
+
 DBusMessage *__ofono_error_from_error(const struct ofono_error *error,
                                                DBusMessage *msg)
 {
index 40caf93..18be93a 100644 (file)
@@ -48,6 +48,7 @@ struct ofono_handsfree {
        ofono_bool_t voice_recognition;
        ofono_bool_t voice_recognition_pending;
        unsigned int ag_features;
+       unsigned char battchg;
 
        const struct ofono_handsfree_driver *driver;
        void *driver_data;
@@ -119,6 +120,29 @@ void ofono_handsfree_set_ag_features(struct ofono_handsfree *hf,
        hf->ag_features = ag_features;
 }
 
+void ofono_handsfree_battchg_notify(struct ofono_handsfree *hf,
+                                       unsigned char level)
+{
+       DBusConnection *conn = ofono_dbus_get_connection();
+       const char *path = __ofono_atom_get_path(hf->atom);
+
+       if (hf == NULL)
+               return;
+
+       if (hf->battchg == level)
+               return;
+
+       hf->battchg = level;
+
+       if (__ofono_atom_get_registered(hf->atom) == FALSE)
+               return;
+
+       ofono_dbus_signal_property_changed(conn, path,
+                                       OFONO_HANDSFREE_INTERFACE,
+                                       "BatteryChargeLevel", DBUS_TYPE_BYTE,
+                                       &level);
+}
+
 static DBusMessage *handsfree_get_properties(DBusConnection *conn,
                                                DBusMessage *msg, void *data)
 {
@@ -152,6 +176,9 @@ static DBusMessage *handsfree_get_properties(DBusConnection *conn,
        ofono_dbus_dict_append_array(&dict, "Features", DBUS_TYPE_STRING,
                                        &features);
 
+       ofono_dbus_dict_append(&dict, "BatteryChargeLevel", DBUS_TYPE_BYTE,
+                               &hf->battchg);
+
        dbus_message_iter_close_container(&iter, &dict);
 
        return reply;
index db62e2d..3c7c80a 100644 (file)
@@ -128,6 +128,8 @@ static const char *modem_type_to_string(enum ofono_modem_type type)
                return "hfp";
        case OFONO_MODEM_TYPE_SAP:
                return "sap";
+       case OFONO_MODEM_TYPE_TEST:
+               return "test";
        }
 
        return "unknown";
@@ -692,6 +694,7 @@ static void sim_state_watch(enum ofono_sim_state new_state, void *user)
        case OFONO_SIM_STATE_NOT_PRESENT:
                modem_change_state(modem, MODEM_STATE_PRE_SIM);
        case OFONO_SIM_STATE_INSERTED:
+       case OFONO_SIM_STATE_RESETTING:
                break;
        case OFONO_SIM_STATE_LOCKED_OUT:
                modem_change_state(modem, MODEM_STATE_PRE_SIM);
index aca81b4..15c1dc5 100644 (file)
@@ -66,6 +66,7 @@ DBusMessage *__ofono_error_emergency_active(DBusMessage *msg);
 DBusMessage *__ofono_error_incorrect_password(DBusMessage *msg);
 DBusMessage *__ofono_error_not_allowed(DBusMessage *msg);
 DBusMessage *__ofono_error_not_recognized(DBusMessage *msg);
+DBusMessage *__ofono_error_network_terminated(DBusMessage *msg);
 
 DBusMessage *__ofono_error_from_error(const struct ofono_error *error,
                                                DBusMessage *msg);
index f4531a8..c24ac28 100644 (file)
@@ -6,6 +6,7 @@ After=syslog.target
 Type=dbus
 BusName=org.ofono
 ExecStart=@prefix@/sbin/ofonod -n
+StandardError=null
 
 [Install]
 WantedBy=multi-user.target
index 8059d2b..edae5eb 100644 (file)
--- a/src/sim.c
+++ b/src/sim.c
@@ -923,6 +923,8 @@ static void sim_iidf_read_cb(int ok, int length, int record,
        unsigned short iidf_id;
        unsigned short offset;
        unsigned short clut_len;
+       unsigned char path[6];
+       unsigned int path_len;
 
        DBG("ok: %d", ok);
 
@@ -952,8 +954,12 @@ static void sim_iidf_read_cb(int ok, int length, int record,
        iidf_id = efimg[3] << 8 | efimg[4];
        sim->iidf_image = g_memdup(data, length);
 
+       /* The path it the same between 2G and 3G */
+       path_len = sim_ef_db_get_path_3g(SIM_EFIMG_FILEID, path);
+
        /* read the clut data */
        ofono_sim_read_bytes(sim->context, iidf_id, offset, clut_len,
+                                       path, path_len,
                                        sim_iidf_read_clut_cb, sim);
 }
 
@@ -987,9 +993,16 @@ static void sim_get_image(struct ofono_sim *sim, unsigned char id,
        iidf_len = efimg[7] << 8 | efimg[8];
 
        /* read the image data */
-       if (image == NULL)
+       if (image == NULL) {
+               unsigned char path[6];
+               unsigned int path_len;
+
+               /* The path it the same between 2G and 3G */
+               path_len = sim_ef_db_get_path_3g(SIM_EFIMG_FILEID, path);
                ofono_sim_read_bytes(sim->context, iidf_id, iidf_offset,
-                                       iidf_len, sim_iidf_read_cb, sim);
+                                       iidf_len, path, path_len,
+                                       sim_iidf_read_cb, sim);
+       }
 
        if (sim->iidf_watch_ids[id] > 0)
                return;
@@ -1514,7 +1527,7 @@ static void sim_retrieve_imsi(struct ofono_sim *sim)
        }
 
        sim->driver->read_file_transparent(sim, SIM_EFIMSI_FILEID, 0, 9,
-                                               sim_efimsi_cb, sim);
+                                               NULL, 0, sim_efimsi_cb, sim);
 }
 
 static void sim_fdn_enabled(struct ofono_sim *sim)
@@ -1812,6 +1825,7 @@ static void sim_efphase_read_cb(int ok, int length, int record,
 static void sim_initialize_after_pin(struct ofono_sim *sim)
 {
        sim->context = ofono_sim_context_create(sim);
+       sim->spn_watches = __ofono_watchlist_new(g_free);
 
        ofono_sim_read(sim->context, SIM_EFPHASE_FILEID,
                        OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
@@ -2156,20 +2170,21 @@ void ofono_sim_context_free(struct ofono_sim_context *context)
 
 int ofono_sim_read_bytes(struct ofono_sim_context *context, int id,
                        unsigned short offset, unsigned short num_bytes,
+                       const unsigned char *path, unsigned int len,
                        ofono_sim_file_read_cb_t cb, void *data)
 {
        if (num_bytes == 0)
                return -1;
 
        return sim_fs_read(context, id, OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
-                               offset, num_bytes, cb, data);
+                               offset, num_bytes, path, len, cb, data);
 }
 
 int ofono_sim_read(struct ofono_sim_context *context, int id,
                        enum ofono_sim_file_structure expected_type,
                        ofono_sim_file_read_cb_t cb, void *data)
 {
-       return sim_fs_read(context, id, expected_type, 0, 0, cb, data);
+       return sim_fs_read(context, id, expected_type, 0, 0, NULL, 0, cb, data);
 }
 
 int ofono_sim_write(struct ofono_sim_context *context, int id,
@@ -2316,6 +2331,42 @@ static void sim_free_early_state(struct ofono_sim *sim)
        }
 }
 
+static void sim_spn_close(struct ofono_sim *sim)
+{
+       if (sim->spn_watches) {
+               __ofono_watchlist_free(sim->spn_watches);
+               sim->spn_watches = NULL;
+       }
+
+       /*
+        * We have not initialized SPN logic at all yet, either because
+        * no netreg / gprs atom has been needed or we have not reached the
+        * post_sim state
+        */
+       if (sim->ef_spn_watch == 0)
+               return;
+
+       ofono_sim_remove_file_watch(sim->context, sim->ef_spn_watch);
+       sim->ef_spn_watch = 0;
+
+       ofono_sim_remove_file_watch(sim->context, sim->cphs_spn_watch);
+       sim->cphs_spn_watch = 0;
+
+       if (sim->cphs_spn_short_watch) {
+               ofono_sim_remove_file_watch(sim->context,
+                                               sim->cphs_spn_short_watch);
+               sim->cphs_spn_short_watch = 0;
+       }
+
+       sim->flags &= ~SIM_FLAG_READING_SPN;
+
+       g_free(sim->spn);
+       sim->spn = NULL;
+
+       g_free(sim->spn_dc);
+       sim->spn_dc = NULL;
+}
+
 static void sim_free_main_state(struct ofono_sim *sim)
 {
        int i;
@@ -2384,6 +2435,8 @@ static void sim_free_main_state(struct ofono_sim *sim)
        sim->fixed_dialing = FALSE;
        sim->barred_dialing = FALSE;
 
+       sim_spn_close(sim);
+
        if (sim->context) {
                ofono_sim_context_free(sim->context);
                sim->context = NULL;
@@ -2398,6 +2451,16 @@ static void sim_free_state(struct ofono_sim *sim)
 
 void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted)
 {
+       if (sim->state == OFONO_SIM_STATE_RESETTING && inserted) {
+               /*
+                * Start initialization procedure from after EFiccid,
+                * EFli and EFpl are retrieved.
+                */
+               sim->state = OFONO_SIM_STATE_INSERTED;
+               __ofono_sim_recheck_pin(sim);
+               return;
+       }
+
        if (inserted == TRUE && sim->state == OFONO_SIM_STATE_NOT_PRESENT)
                sim->state = OFONO_SIM_STATE_INSERTED;
        else if (inserted == FALSE && sim->state != OFONO_SIM_STATE_NOT_PRESENT)
@@ -2601,40 +2664,6 @@ static void sim_spn_init(struct ofono_sim *sim)
                                sim_spn_changed, sim, NULL);
 }
 
-static void sim_spn_close(struct ofono_sim *sim)
-{
-       __ofono_watchlist_free(sim->spn_watches);
-       sim->spn_watches = NULL;
-
-       /*
-        * We have not initialized SPN logic at all yet, either because
-        * no netreg / gprs atom has been needed or we have not reached the
-        * post_sim state
-        */
-       if (sim->ef_spn_watch == 0)
-               return;
-
-       ofono_sim_remove_file_watch(sim->context, sim->ef_spn_watch);
-       sim->ef_spn_watch = 0;
-
-       ofono_sim_remove_file_watch(sim->context, sim->cphs_spn_watch);
-       sim->cphs_spn_watch = 0;
-
-       if (sim->cphs_spn_short_watch) {
-               ofono_sim_remove_file_watch(sim->context,
-                                               sim->cphs_spn_short_watch);
-               sim->cphs_spn_short_watch = 0;
-       }
-
-       sim->flags &= ~SIM_FLAG_READING_SPN;
-
-       g_free(sim->spn);
-       sim->spn = NULL;
-
-       g_free(sim->spn_dc);
-       sim->spn_dc = NULL;
-}
-
 ofono_bool_t ofono_sim_add_spn_watch(struct ofono_sim *sim, unsigned int *id,
                                        ofono_sim_spn_cb_t cb, void *data,
                                        ofono_destroy_func destroy)
@@ -2806,8 +2835,6 @@ static void sim_unregister(struct ofono_atom *atom)
        __ofono_watchlist_free(sim->state_watches);
        sim->state_watches = NULL;
 
-       sim_spn_close(sim);
-
        g_dbus_unregister_interface(conn, path, OFONO_SIM_MANAGER_INTERFACE);
        ofono_modem_remove_interface(modem, OFONO_SIM_MANAGER_INTERFACE);
 }
@@ -2937,7 +2964,6 @@ void ofono_sim_register(struct ofono_sim *sim)
 
        ofono_modem_add_interface(modem, OFONO_SIM_MANAGER_INTERFACE);
        sim->state_watches = __ofono_watchlist_new(g_free);
-       sim->spn_watches = __ofono_watchlist_new(g_free);
        sim->simfs = sim_fs_new(sim, sim->driver);
 
        __ofono_atom_register(sim->atom, sim_unregister);
@@ -3114,11 +3140,12 @@ void __ofono_sim_refresh(struct ofono_sim *sim, GSList *file_list,
        }
 
        if (reinit_naa) {
+               sim->state = OFONO_SIM_STATE_RESETTING;
+               __ofono_modem_sim_reset(__ofono_atom_get_modem(sim->atom));
+
                /* Force the sim state out of READY */
                sim_free_main_state(sim);
-
-               sim->state = OFONO_SIM_STATE_INSERTED;
-               __ofono_modem_sim_reset(__ofono_atom_get_modem(sim->atom));
+               call_state_watches(sim);
        }
 
        /*
@@ -3136,17 +3163,4 @@ void __ofono_sim_refresh(struct ofono_sim *sim, GSList *file_list,
                        sim_fs_notify_file_watches(sim->simfs, id);
                }
        }
-
-       if (reinit_naa) {
-               /*
-                * REVISIT: There's some concern that on re-insertion the
-                * atoms will start to talk to the SIM before it becomes
-                * ready, on certain SIMs.
-                */
-               /*
-                * Start initialization procedure from after EFiccid,
-                * EFli and EFpl are retrieved.
-                */
-               __ofono_sim_recheck_pin(sim);
-       }
 }
index 58dc41d..03c8c9e 100644 (file)
@@ -66,6 +66,8 @@ struct sim_fs_op {
        int length;
        int record_length;
        int current;
+       unsigned char path[6];
+       unsigned char path_len;
        gconstpointer cb;
        gboolean is_read;
        void *userdata;
@@ -472,6 +474,8 @@ static gboolean sim_fs_op_read_block(gpointer user_data)
        fs->driver->read_file_transparent(fs->sim, op->id,
                                                op->current * 256,
                                                read_bytes,
+                                               op->path_len ? op->path : NULL,
+                                               op->path_len,
                                                sim_fs_op_read_block_cb, fs);
 
        return FALSE;
@@ -561,6 +565,7 @@ static gboolean sim_fs_op_read_record(gpointer user)
 
                driver->read_file_linear(fs->sim, op->id, op->current,
                                                op->record_length,
+                                               NULL, 0,
                                                sim_fs_op_retrieve_cb, fs);
                break;
        case OFONO_SIM_FILE_STRUCTURE_CYCLIC:
@@ -571,6 +576,7 @@ static gboolean sim_fs_op_read_record(gpointer user)
 
                driver->read_file_cyclic(fs->sim, op->id, op->current,
                                                op->record_length,
+                                               NULL, 0,
                                                sim_fs_op_retrieve_cb, fs);
                break;
        default:
@@ -818,23 +824,26 @@ static gboolean sim_fs_op_next(gpointer user_data)
                if (sim_fs_op_check_cached(fs))
                        return FALSE;
 
-               driver->read_file_info(fs->sim, op->id, sim_fs_op_info_cb, fs);
+               driver->read_file_info(fs->sim, op->id,
+                                       op->path_len ? op->path : NULL,
+                                       op->path_len,
+                                       sim_fs_op_info_cb, fs);
        } else {
                switch (op->structure) {
                case OFONO_SIM_FILE_STRUCTURE_TRANSPARENT:
                        driver->write_file_transparent(fs->sim, op->id, 0,
                                        op->length, op->buffer,
-                                       sim_fs_op_write_cb, fs);
+                                       NULL, 0, sim_fs_op_write_cb, fs);
                        break;
                case OFONO_SIM_FILE_STRUCTURE_FIXED:
                        driver->write_file_linear(fs->sim, op->id, op->current,
                                        op->length, op->buffer,
-                                       sim_fs_op_write_cb, fs);
+                                       NULL, 0, sim_fs_op_write_cb, fs);
                        break;
                case OFONO_SIM_FILE_STRUCTURE_CYCLIC:
                        driver->write_file_cyclic(fs->sim, op->id,
                                        op->length, op->buffer,
-                                       sim_fs_op_write_cb, fs);
+                                       NULL, 0, sim_fs_op_write_cb, fs);
                        break;
                default:
                        ofono_error("Unrecognized file structure, "
@@ -890,6 +899,7 @@ int sim_fs_read_info(struct ofono_sim_context *context, int id,
 int sim_fs_read(struct ofono_sim_context *context, int id,
                enum ofono_sim_file_structure expected_type,
                unsigned short offset, unsigned short num_bytes,
+               const unsigned char *path, unsigned int path_len,
                ofono_sim_file_read_cb_t cb, void *data)
 {
        struct sim_fs *fs = context->fs;
@@ -922,6 +932,8 @@ int sim_fs_read(struct ofono_sim_context *context, int id,
        op->num_bytes = num_bytes;
        op->info_only = FALSE;
        op->context = context;
+       memcpy(op->path, path, path_len);
+       op->path_len = path_len;
 
        g_queue_push_tail(fs->op_q, op);
 
index 92e8fdb..bb3ab0f 100644 (file)
@@ -42,6 +42,7 @@ void sim_fs_notify_file_watches(struct sim_fs *fs, int id);
 int sim_fs_read(struct ofono_sim_context *context, int id,
                enum ofono_sim_file_structure expected_type,
                unsigned short offset, unsigned short num_bytes,
+               const unsigned char *path, unsigned int len,
                ofono_sim_file_read_cb_t cb, void *data);
 
 int sim_fs_read_info(struct ofono_sim_context *context, int id,
index 23865a6..90d7f8d 100644 (file)
@@ -53,6 +53,10 @@ struct opl_operator {
        guint8 id;
 };
 
+#define MF     1
+#define DF     2
+#define EF     4
+
 #define BINARY 0
 #define RECORD 1
 #define CYCLIC 3
@@ -66,60 +70,45 @@ struct opl_operator {
 #define ROOTMF 0x3F00
 
 static struct sim_ef_info ef_db[] = {
-{      0x2F05, ROOTMF, BINARY, 0,      ALW,    PIN     },
-{      0x2F06, ROOTMF, RECORD, 0,      ALW,    PIN     },
-{      0x2FE2, ROOTMF, BINARY, 10,     ALW,    NEV     },
-{      0x4F20, 0x5F50, BINARY, 0,      PIN,    ADM     },
-{      0x6F05, 0x7F20, BINARY, 0,      ALW,    PIN     },
-{      0x6F06, 0x0000, RECORD, 0,      ALW,    ADM     },
-{      0x6F07, 0x0000, BINARY, 9,      PIN,    ADM     },
-{      0x6F14, 0x7F20, BINARY, 0,      PIN,    ADM     },
-{      0x6F15, 0x7F20, BINARY, 0,      PIN,    PIN     },
-{      0x6F18, 0x7F20, BINARY, 10,     PIN,    ADM     },
-{      0x6F2C, 0x7F20, BINARY, 16,     PIN,    PIN     },
-{      0x6F30, 0x7F20, BINARY, 0,      PIN,    PIN     },
-{      0x6F32, 0x7F20, BINARY, 0,      PIN,    ADM     },
-{      0x6F37, 0x7F20, BINARY, 3,      PIN,    PIN2    },
-{      0x6F38, 0x7F20, BINARY, 0,      PIN,    ADM     },
-{      0x6F39, 0x7F20, CYCLIC, 3,      PIN,    PIN2    },
-{      0x6F3B, 0x7F10, RECORD, 0,      PIN,    PIN2    },
-{      0x6F3E, 0x7F20, BINARY, 0,      PIN,    ADM     },
-{      0x6F3F, 0x7F20, BINARY, 0,      PIN,    ADM     },
-{      0x6F40, 0x7F10, RECORD, 0,      PIN,    PIN     },
-{      0x6F41, 0x7F20, BINARY, 5,      PIN,    PIN2    },
-{      0x6F42, 0x7F10, RECORD, 0,      PIN,    PIN     },
-{      0x6F44, 0x7F10, CYCLIC, 0,      PIN,    PIN     },
-{      0x6F45, 0x7F20, BINARY, 0,      PIN,    PIN     },
-{      0x6F46, 0x7F20, BINARY, 17,     ALW,    ADM     },
-{      0x6F48, 0x7F20, BINARY, 0,      PIN,    ADM     },
-{      0x6F49, 0x7F10, RECORD, 0,      PIN,    ADM     },
-{      0x6F4D, 0x7F20, RECORD, 0,      PIN,    PIN2    },
-{      0x6F50, 0x7F20, BINARY, 0,      PIN,    PIN     },
-{      0x6F51, 0x7F20, RECORD, 0,      PIN,    ADM     },
-{      0x6F53, 0x7F20, BINARY, 14,     PIN,    PIN     },
-{      0x6F56, 0x0000, BINARY, 0,      PIN,    PIN2    },
-{      0x6F60, 0x7F20, BINARY, 0,      PIN,    PIN     },
-{      0x6F61, 0x7F20, BINARY, 0,      PIN,    ADM     },
-{      0x6F62, 0x7F20, BINARY, 0,      PIN,    ADM     },
-{      0x6F73, 0x0000, BINARY, 14,     PIN,    PIN     },
-{      0x6F7B, 0x7F20, BINARY, 0,      PIN,    PIN     },
-{      0x6F7E, 0x7F20, BINARY, 11,     PIN,    PIN     },
-{      0x6FAD, 0x7F20, BINARY, 0,      ALW,    ADM     },
-{      0x6FAE, 0x7F20, BINARY, 1,      ALW,    ADM     },
-{      0x6FB7, 0x7F20, BINARY, 0,      ALW,    ADM     },
-{      0x6FC5, 0x7F20, RECORD, 0,      ALW,    ADM     },
-{      0x6FC6, 0x7F20, RECORD, 0,      ALW,    ADM     },
-{      0x6FC7, 0x7F20, RECORD, 0,      PIN,    PIN     },
-{      0x6FC9, 0x7F20, RECORD, 0,      PIN,    PIN     },
-{      0x6FCA, 0x7F20, RECORD, 0,      PIN,    PIN     },
-{      0x6FCB, 0x7F20, RECORD, 16,     PIN,    PIN     },
-{      0x6FCD, 0x7F20, BINARY, 0,      PIN,    ADM     },
-{      0x6FD9, 0x0000, BINARY, 0,      PIN,    ADM     },
-{      0x6FDB, 0x0000, BINARY, 1,      PIN,    ADM     },
-{      0x6FDC, 0x0000, BINARY, 1,      PIN,    ADM     },
-{      0x6FDE, 0x0000, BINARY, 0,      ALW,    ADM     },
-{      0x6FDF, 0x0000, RECORD, 0,      ALW,    ADM     },
-{      0x6FE3, 0x0000, BINARY, 18,     PIN,    PIN     },
+{      0x2F05, ROOTMF, ROOTMF, EF, BINARY, 0,          ALW,    PIN     },
+{      0x2FE2, ROOTMF, ROOTMF, EF, BINARY, 10,         ALW,    NEV     },
+{      0x4F20, 0x5F50, 0x5F50, EF, BINARY, 0,          PIN,    ADM     },
+{      0x5F50, 0x7F10, 0x7F10, DF, 0, 0,               PIN,    ADM     },
+{      0x6F05, 0x7F20, 0x7FFF, EF, BINARY, 0,          ALW,    PIN     },
+{      0x6F07, 0x7F20, 0x7FFF, EF, BINARY, 9,          PIN,    ADM     },
+{      0x6F11, 0x7F20, 0x7FFF, EF, BINARY, 0,          PIN,    PIN     },
+{      0x6F13, 0x7F20, 0x7FFF, EF, BINARY, 0,          PIN,    PIN     },
+{      0x6F14, 0x7F20, 0x7FFF, EF, BINARY, 0,          PIN,    ADM     },
+{      0x6F15, 0x7F20, 0x7FFF, EF, BINARY, 0,          PIN,    PIN     },
+{      0x6F16, 0x7F20, 0x7FFF, EF, BINARY, 0,          PIN,    ADM     },
+{      0x6F17, 0x7F20, 0x7FFF, EF, RECORD, 0,          PIN,    PIN     },
+{      0x6F18, 0x7F20, 0x7FFF, EF, BINARY, 10,         PIN,    ADM     },
+{      0x6F19, 0x7F20, 0x7FFF, EF, RECORD, 0,          PIN,    PIN     },
+{      0x6F38, 0x7F20, 0x7FFF, EF, BINARY, 0,          PIN,    ADM     },
+{      0x6F3A, 0x7F10, 0x7F10, EF, RECORD, 0,          PIN,    PIN     },
+{      0x6F3B, 0x7F10, 0x7FFF, EF, RECORD, 0,          PIN,    PIN2    },
+{      0x6F40, 0x7F10, 0x7FFF, EF, RECORD, 0,          PIN,    PIN     },
+{      0x6F45, 0x7F20, 0x7FFF, EF, BINARY, 0,          PIN,    PIN     },
+{      0x6F46, 0x7F20, 0x7FFF, EF, BINARY, 17,         ALW,    ADM     },
+{      0x6F48, 0x7F20, 0x7FFF, EF, BINARY, 0,          PIN,    ADM     },
+{      0x6F49, 0x7F10, 0x7FFF, EF, RECORD, 0,          PIN,    ADM     },
+{      0x6F4D, 0x7F20, 0x7FFF, EF, RECORD, 0,          PIN,    PIN2    },
+{      0x6F50, 0x7F20, 0x7FFF, EF, BINARY, 0,          PIN,    PIN     },
+{      0x6F56, 0x0000, 0x7FFF, EF, BINARY, 0,          PIN,    PIN2    },
+{      0x6FAD, 0x7F20, 0x7FFF, EF, BINARY, 0,          ALW,    ADM     },
+{      0x6FAE, 0x7F20, 0x0000, EF, BINARY, 1,          ALW,    ADM     },
+{      0x6FB7, 0x7F20, 0x7FFF, EF, BINARY, 0,          ALW,    ADM     },
+{      0x6FC5, 0x7F20, 0x7FFF, EF, RECORD, 0,          ALW,    ADM     },
+{      0x6FC6, 0x7F20, 0x7FFF, EF, RECORD, 0,          ALW,    ADM     },
+{      0x6FC7, 0x7F20, 0x7FFF, EF, RECORD, 0,          PIN,    PIN     },
+{      0x6FC9, 0x7F20, 0x7FFF, EF, RECORD, 0,          PIN,    PIN     },
+{      0x6FCA, 0x7F20, 0x7FFF, EF, RECORD, 0,          PIN,    PIN     },
+{      0x6FCB, 0x7F20, 0x7FFF, EF, RECORD, 16,         PIN,    PIN     },
+{      0x6FCD, 0x7F20, 0x7FFF, EF, BINARY, 0,          PIN,    ADM     },
+{      0x6FDE, 0x7F20, 0x7FFF, EF, BINARY, 0,          ALW,    ADM     },
+{      0x7F10, ROOTMF, ROOTMF, DF, 0, 0,               0,      0       },
+{      0x7F20, ROOTMF, ROOTMF, DF, 0, 0,               0,      0       },
+{      0x7FFF, 0x0000, ROOTMF, DF, 0, 0,               0,      0       }
 };
 
 void simple_tlv_iter_init(struct simple_tlv_iter *iter,
@@ -1300,6 +1289,72 @@ struct sim_ef_info *sim_ef_db_lookup(unsigned short id)
        return result;
 }
 
+unsigned int sim_ef_db_get_path_2g(unsigned short id, unsigned char out_path[])
+{
+       struct sim_ef_info *info;
+       unsigned int nelem = sizeof(ef_db) / sizeof(struct sim_ef_info);
+       unsigned char path[6];
+       int i = 0;
+       int j;
+
+       info = bsearch(GUINT_TO_POINTER((unsigned int) id), ef_db, nelem,
+                               sizeof(struct sim_ef_info), find_ef_by_id);
+       if (info == NULL)
+               return 0;
+
+       path[i++] = info->parent2g & 0xff;
+       path[i++] = info->parent2g >> 8;
+
+       while (info->parent2g != ROOTMF) {
+               info = bsearch(GUINT_TO_POINTER((unsigned int) info->parent2g),
+                               ef_db, nelem, sizeof(struct sim_ef_info),
+                               find_ef_by_id);
+               if (info == NULL)
+                       return 0;
+
+               path[i++] = info->parent2g & 0xff;
+               path[i++] = info->parent2g >> 8;
+       }
+
+       for (j = 0; j < i; j++)
+               out_path[j] = path[i - j - 1];
+
+       return i;
+}
+
+unsigned int sim_ef_db_get_path_3g(unsigned short id, unsigned char out_path[])
+{
+       struct sim_ef_info *info;
+       unsigned int nelem = sizeof(ef_db) / sizeof(struct sim_ef_info);
+       unsigned char path[6];
+       int i = 0;
+       int j;
+
+       info = bsearch(GUINT_TO_POINTER((unsigned int) id), ef_db, nelem,
+                               sizeof(struct sim_ef_info), find_ef_by_id);
+       if (info == NULL)
+               return 0;
+
+       path[i++] = info->parent3g & 0xff;
+       path[i++] = info->parent3g >> 8;
+
+       while (info->parent3g != ROOTMF) {
+               info = bsearch(GUINT_TO_POINTER((unsigned int) info->parent3g),
+                               ef_db, nelem, sizeof(struct sim_ef_info),
+                               find_ef_by_id);
+               if (info == NULL)
+                       return 0;
+
+               path[i++] = info->parent3g & 0xff;
+               path[i++] = info->parent3g >> 8;
+       }
+
+       for (j = 0; j < i; j++)
+               out_path[j] = path[i - j - 1];
+
+       return i;
+}
+
 gboolean sim_parse_3g_get_response(const unsigned char *data, int len,
                                        int *file_len, int *record_len,
                                        int *structure, unsigned char *access,
index 2906ca0..1faf948 100644 (file)
@@ -27,12 +27,7 @@ enum sim_fileid {
        SIM_EF_ICCID_FILEID =                   0x2FE2,
        SIM_MF_FILEID =                         0x3F00,
        SIM_EFIMG_FILEID =                      0x4F20,
-       SIM_EFPSC_FILEID =                      0x4F22,
-       SIM_EFCC_FILEID =                       0x4F23,
-       SIM_EFPUID_FILEID =                     0x4F24,
-       SIM_EFPBR_FILEID =                      0x4F30,
        SIM_DFPHONEBOOK_FILEID =                0x5F3A,
-       SIM_DFMULTIMEDIA_FILEID =               0x5F3B,
        SIM_EFLI_FILEID =                       0x6F05,
        SIM_EFARR_FILEID =                      0x6F06,
        SIM_EFIMSI_FILEID =                     0x6F07,
@@ -288,8 +283,10 @@ struct sim_eons_operator_info {
 
 struct sim_ef_info {
        unsigned short id;
-       unsigned short parent;
+       unsigned short parent2g;
+       unsigned short parent3g;
        unsigned char file_type;
+       unsigned char file_structure;
        unsigned char size;
        enum sim_file_access perm_read;
        enum sim_file_access perm_update;
@@ -473,6 +470,8 @@ void sim_adn_build(unsigned char *data, int length,
                        const char *identifier);
 
 struct sim_ef_info *sim_ef_db_lookup(unsigned short efid);
+unsigned int sim_ef_db_get_path_2g(unsigned short id, unsigned char path[]);
+unsigned int sim_ef_db_get_path_3g(unsigned short id, unsigned char path[]);
 
 gboolean sim_parse_3g_get_response(const unsigned char *data, int len,
                                        int *file_len, int *record_len,
index acfc39b..0270029 100644 (file)
--- a/src/sms.c
+++ b/src/sms.c
@@ -795,6 +795,9 @@ static void netreg_status_watch(int status, int lac, int ci, int tech,
        if (sms->tx_source > 0)
                return;
 
+       if (sms->flags & MESSAGE_MANAGER_FLAG_TXQ_ACTIVE)
+               return;
+
        if (g_queue_get_length(sms->txq))
                sms->tx_source = g_timeout_add(0, tx_next, sms);
 }
@@ -2114,16 +2117,17 @@ int __ofono_sms_txq_set_submit_notify(struct ofono_sms *sms,
                                        void *data,
                                        ofono_destroy_func destroy)
 {
-       struct message *m;
-       struct tx_queue_entry *entry;
+       GList *l;
+       struct tx_queue_entry *entry = g_queue_peek_tail(sms->txq);
 
-       m = g_hash_table_lookup(sms->messages, uuid);
-       if (m == NULL)
-               return -ENOENT;
+       if (memcmp(&entry->uuid, uuid, sizeof(entry->uuid))) {
+               l = g_queue_find_custom(sms->txq, uuid, entry_compare_by_uuid);
 
-       entry = message_get_data(m);
-       if (entry == NULL)
-               return -ENOTSUP;
+               if (l == NULL)
+                       return -ENOENT;
+
+               entry = l->data;
+       }
 
        tx_queue_entry_set_submit_notify(entry, cb, data, destroy);
 
index a541964..22d0ea9 100644 (file)
@@ -81,11 +81,11 @@ void extract_bcd_number(const unsigned char *buf, int len, char *out)
        for (i = 0; i < len; i++) {
                oct = buf[i];
 
-               out[i*2] = digit_lut[oct & 0x0f];
-               out[i*2+1] = digit_lut[(oct & 0xf0) >> 4];
+               out[i * 2] = digit_lut[oct & 0x0f];
+               out[i * 2 + 1] = digit_lut[(oct & 0xf0) >> 4];
        }
 
-       out[i*2] = '\0';
+       out[i * 2] = '\0';
 }
 
 static inline int to_semi_oct(char in)
@@ -600,7 +600,7 @@ gboolean sms_encode_address_field(const struct sms_address *in, gboolean sc,
 out:
        pdu[0] = addr_len;
        pdu[1] = (in->number_type << 4) | in->numbering_plan | 0x80;
-       memcpy(pdu+2, p, (sc ? addr_len - 1 : (addr_len + 1) / 2));
+       memcpy(pdu + 2, p, (sc ? addr_len - 1 : (addr_len + 1) / 2));
 
        *offset = *offset + 2 + (sc ? addr_len - 1 : (addr_len + 1) / 2);
 
@@ -768,7 +768,7 @@ static gboolean decode_deliver(const unsigned char *pdu, int len,
        if ((len - offset) < expected)
                return FALSE;
 
-       memcpy(out->deliver.ud, pdu+offset, expected);
+       memcpy(out->deliver.ud, pdu + offset, expected);
 
        return TRUE;
 }
@@ -929,11 +929,11 @@ static gboolean decode_submit_report(const unsigned char *pdu, int len,
                if (out->type == SMS_TYPE_SUBMIT_REPORT_ERROR) {
                        out->submit_err_report.udl = udl;
                        memcpy(out->submit_err_report.ud,
-                                       pdu+offset, expected);
+                                       pdu + offset, expected);
                } else {
                        out->submit_ack_report.udl = udl;
                        memcpy(out->submit_ack_report.ud,
-                                       pdu+offset, expected);
+                                       pdu + offset, expected);
                }
        }
 
@@ -1063,7 +1063,7 @@ static gboolean decode_status_report(const unsigned char *pdu, int len,
                if ((len - offset) < expected)
                        return FALSE;
 
-               memcpy(out->status_report.ud, pdu+offset, expected);
+               memcpy(out->status_report.ud, pdu + offset, expected);
        }
 
        return TRUE;
@@ -1214,11 +1214,11 @@ static gboolean decode_deliver_report(const unsigned char *pdu, int len,
                if (out->type == SMS_TYPE_DELIVER_REPORT_ERROR) {
                        out->deliver_err_report.udl = udl;
                        memcpy(out->deliver_err_report.ud,
-                                       pdu+offset, expected);
+                                       pdu + offset, expected);
                } else {
                        out->deliver_ack_report.udl = udl;
                        memcpy(out->deliver_ack_report.ud,
-                                       pdu+offset, expected);
+                                       pdu + offset, expected);
                }
        }
 
@@ -1371,7 +1371,7 @@ static gboolean decode_submit(const unsigned char *pdu, int len,
        if (expected > (int) sizeof(out->submit.ud))
                return FALSE;
 
-       memcpy(out->submit.ud, pdu+offset, expected);
+       memcpy(out->submit.ud, pdu + offset, expected);
 
        return TRUE;
 }
@@ -1450,7 +1450,7 @@ static gboolean decode_command(const unsigned char *pdu, int len,
        if ((len - offset) < out->command.cdl)
                return FALSE;
 
-       memcpy(out->command.cd, pdu+offset, out->command.cdl);
+       memcpy(out->command.cd, pdu + offset, out->command.cdl);
 
        return TRUE;
 }
@@ -1866,7 +1866,7 @@ void sms_address_from_string(struct sms_address *addr, const char *str)
        addr->numbering_plan = SMS_NUMBERING_PLAN_ISDN;
        if (str[0] == '+') {
                addr->number_type = SMS_NUMBER_TYPE_INTERNATIONAL;
-               strcpy(addr->address, str+1);
+               strcpy(addr->address, str + 1);
        } else {
                addr->number_type = SMS_NUMBER_TYPE_UNKNOWN;
                strcpy(addr->address, str);
@@ -4103,11 +4103,19 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
 
                        /*
                         * CR is a padding character, which means we can
-                        * safely discard everything afterwards
+                        * safely discard everything afterwards if there are
+                        * only trailing CR characters.
                         */
                        for (; i < written; i++, bufsize++) {
-                               if (unpacked[i] == '\r')
-                                       break;
+                               if (unpacked[i] == '\r') {
+                                       int t;
+
+                                       t = strspn((const char *) unpacked + i,
+                                                       "\r");
+
+                                       if (t + i == written)
+                                               break;
+                               }
 
                                buf[bufsize] = unpacked[i];
                        }
@@ -4135,11 +4143,20 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
                        }
 
                        while (i < max_offset) {
-                               if (ud[i] == 0x00 && ud[i+1] == '\r')
-                                       break;
+                               if (ud[i] == 0x00 && ud[i + 1] == '\r') {
+                                       int j = i + 2;
+
+                                       for (; j < max_offset; j = j + 2)
+                                               if (ud[j + 1] != '\r' ||
+                                                               ud[j] != 0x00)
+                                                       break;
+
+                                       if (j == max_offset)
+                                               break;
+                               }
 
                                buf[bufsize] = ud[i];
-                               buf[bufsize + 1] = ud[i+1];
+                               buf[bufsize + 1] = ud[i + 1];
 
                                bufsize += 2;
                                i += 2;
index 19cb0eb..5ca0250 100644 (file)
--- a/src/stk.c
+++ b/src/stk.c
@@ -104,6 +104,27 @@ static void timers_update(struct ofono_stk *stk);
                result.additional_len = sizeof(addn_info);      \
                result.additional = addn_info;                  \
 
+static gboolean convert_to_phone_number_format(const char *input_str,
+                                                       char *output_str)
+{
+       char *digit;
+       char *digit_from = "01234567890abcABC";
+       char *digit_to = "01234567890*#p*#p";
+       int pos;
+
+       for (pos = 0; input_str[pos] != '\0'; pos++) {
+               digit = strchr(digit_from, input_str[pos]);
+               if (digit == NULL)
+                       return FALSE;
+
+               output_str[pos] = digit_to[digit - digit_from];
+       }
+
+       output_str[pos] = '\0';
+
+       return TRUE;
+}
+
 static int stk_respond(struct ofono_stk *stk, struct stk_response *rsp,
                        ofono_stk_generic_cb_t cb)
 {
@@ -381,6 +402,11 @@ static struct stk_menu *stk_menu_create(const char *title,
                if (item_icon_ids && item_icon_ids->len)
                        ret->items[i].icon_id = item_icon_ids->list[i];
 
+               if (ret->items[i].icon_id != 0 &&
+                               item_icon_ids->qualifier ==
+                               STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY)
+                       ret->items[i].text[0]='\0';
+
                if (item->id == default_id)
                        ret->default_item = i;
        }
@@ -518,6 +544,18 @@ static gboolean stk_alpha_id_set(struct ofono_stk *stk,
        if (stk->current_agent == NULL)
                return FALSE;
 
+       /*
+        * According to 3GPP TS 102.223 section 8.31:
+        * If icon is self-explanatory, it replaces the alpha identifier or
+        * text string.
+        * If icon is not self-explanatory, it shall be displayed together
+        * with the alpha identifier or text string.
+        */
+
+       if (icon->id != 0 && icon->qualifier ==
+                       STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY)
+               alpha[0]='\0';
+
        if (stk->respond_on_exit)
                stk_agent_display_action(stk->current_agent, alpha, icon,
                                                user_termination_cb, stk, NULL);
@@ -579,7 +617,7 @@ static DBusMessage *stk_get_properties(DBusConnection *conn,
                                        OFONO_PROPERTIES_ARRAY_SIGNATURE,
                                        &dict);
 
-       str = stk->idle_mode_text;
+       str = stk->idle_mode_text ? stk->idle_mode_text : "";
        ofono_dbus_dict_append(&dict, "IdleModeText", DBUS_TYPE_STRING, &str);
 
        icon = stk->idle_mode_icon.id;
@@ -937,11 +975,11 @@ static gboolean handle_command_set_idle_text(const struct stk_command *cmd,
 {
        DBusConnection *conn = ofono_dbus_get_connection();
        const char *path = __ofono_atom_get_path(stk->atom);
+       const struct stk_command_setup_idle_mode_text *sim =
+                                               &cmd->setup_idle_mode_text;
        char *idle_mode_text;
 
-       idle_mode_text = dbus_apply_text_attributes(
-                                       cmd->setup_idle_mode_text.text,
-                                       &cmd->setup_idle_mode_text.text_attr);
+       idle_mode_text = dbus_apply_text_attributes(sim->text, &sim->text_attr);
 
        if (idle_mode_text == NULL) {
                rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
@@ -951,6 +989,10 @@ static gboolean handle_command_set_idle_text(const struct stk_command *cmd,
        if (stk->idle_mode_text)
                g_free(stk->idle_mode_text);
 
+       if (sim->icon_id.id != 0 && sim->icon_id.qualifier ==
+                       STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY)
+               idle_mode_text[0]='\0';
+
        stk->idle_mode_text = idle_mode_text;
 
        ofono_dbus_signal_property_changed(conn, path, OFONO_STK_INTERFACE,
@@ -958,8 +1000,8 @@ static gboolean handle_command_set_idle_text(const struct stk_command *cmd,
                                                DBUS_TYPE_STRING,
                                                &idle_mode_text);
 
-       if (stk->idle_mode_icon.id != cmd->setup_idle_mode_text.icon_id.id) {
-               memcpy(&stk->idle_mode_icon, &cmd->setup_idle_mode_text.icon_id,
+       if (stk->idle_mode_icon.id != sim->icon_id.id) {
+               memcpy(&stk->idle_mode_icon, &sim->icon_id,
                                sizeof(stk->idle_mode_icon));
 
                ofono_dbus_signal_property_changed(conn, path,
@@ -1240,7 +1282,7 @@ static gboolean handle_command_select_item(const struct stk_command *cmd,
                                        stk->select_item_menu,
                                        request_selection_cb, stk,
                                        request_selection_destroy,
-                                       stk->timeout * 1000) < 0) {
+                                       stk->short_timeout * 1000) < 0) {
                unsigned char no_cause_result[] = { 0x00 };
 
                request_selection_destroy(stk);
@@ -1347,11 +1389,18 @@ static gboolean handle_command_display_text(const struct stk_command *cmd,
        }
 
        if (qualifier & (1 << 7))
-               timeout = stk->timeout * 1000;
+               timeout = stk->short_timeout * 1000;
 
        if (dt->duration.interval)
                timeout = duration_to_msecs(&dt->duration);
 
+       if (cmd->display_text.immediate_response)
+               timeout = stk->timeout * 1000;
+
+       if (dt->icon_id.id != 0 && dt->icon_id.qualifier ==
+                       STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY)
+               text[0]='\0';
+
        err = stk_agent_display_text(stk->current_agent, text, &dt->icon_id,
                                        priority, display_text_cb, stk,
                                        display_text_destroy, timeout);
@@ -1515,7 +1564,7 @@ static gboolean handle_command_get_inkey(const struct stk_command *cmd,
                                                struct stk_response *rsp,
                                                struct ofono_stk *stk)
 {
-       int timeout = stk->timeout * 1000;
+       int timeout = stk->short_timeout * 1000;
        const struct stk_command_get_inkey *gi = &cmd->get_inkey;
        char *text = dbus_apply_text_attributes(gi->text, &gi->text_attr);
        uint8_t qualifier = stk->pending_cmd->qualifier;
@@ -1536,6 +1585,10 @@ static gboolean handle_command_get_inkey(const struct stk_command *cmd,
 
        gettimeofday(&stk->get_inkey_start_ts, NULL);
 
+       if (gi->icon_id.id != 0 && gi->icon_id.qualifier ==
+                       STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY)
+               text[0]='\0';
+
        if (yesno)
                err = stk_agent_request_confirmation(stk->current_agent,
                                                        text, &gi->icon_id,
@@ -1631,6 +1684,10 @@ static gboolean handle_command_get_input(const struct stk_command *cmd,
                return TRUE;
        }
 
+       if (gi->icon_id.id != 0 && gi->icon_id.qualifier ==
+                       STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY)
+               text[0]='\0';
+
        if (alphabet)
                err = stk_agent_request_input(stk->current_agent, text,
                                                &gi->icon_id, gi->default_text,
@@ -1715,6 +1772,8 @@ static void confirm_call_cb(enum stk_agent_result result, gboolean confirm,
        char *alpha_id = NULL;
        struct ofono_voicecall *vc;
        struct stk_response rsp;
+       char number[256];
+       char *pause_chr;
        int err;
 
        switch (result) {
@@ -1752,7 +1811,20 @@ static void confirm_call_cb(enum stk_agent_result result, gboolean confirm,
                }
        }
 
-       err = __ofono_voicecall_dial(vc, sc->addr.number, sc->addr.ton_npi,
+       /* Convert the setup call number to phone number format */
+       if (convert_to_phone_number_format(sc->addr.number, number) == FALSE) {
+               send_simple_response(stk, STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD);
+               return;
+       }
+
+       /* Remove the DTMF string from the phone number */
+       pause_chr = strchr(number, 'p');
+
+       if (pause_chr)
+               number[pause_chr - number] = '\0';
+
+       /* TODO: send the DTMF after call is connected */
+       err = __ofono_voicecall_dial(vc, number, sc->addr.ton_npi,
                                        alpha_id, sc->icon_id_call_setup.id,
                                        qualifier >> 1, call_setup_connected,
                                        stk);
@@ -1798,6 +1870,8 @@ static void confirm_handled_call_cb(enum stk_agent_result result,
        const struct stk_command_setup_call *sc =
                                        &stk->pending_cmd->setup_call;
        struct ofono_voicecall *vc;
+       char number[256];
+       char *pause_chr;
 
        if (stk->driver->user_confirmation == NULL)
                goto out;
@@ -1807,6 +1881,17 @@ static void confirm_handled_call_cb(enum stk_agent_result result,
                goto out;
        }
 
+       if (convert_to_phone_number_format(sc->addr.number, number) == FALSE) {
+               stk->driver->user_confirmation(stk, FALSE);
+               goto out;
+       }
+
+       /* Remove the DTMF string from the phone number */
+       pause_chr = strchr(number, 'p');
+
+       if (pause_chr)
+               number[pause_chr - number] = '\0';
+
        stk->driver->user_confirmation(stk, confirm);
 
        vc = __ofono_atom_find(OFONO_ATOM_TYPE_VOICECALL,
@@ -1814,7 +1899,7 @@ static void confirm_handled_call_cb(enum stk_agent_result result,
        if (vc == NULL)
                goto out;
 
-       __ofono_voicecall_set_alpha_and_icon_id(vc, sc->addr.number,
+       __ofono_voicecall_set_alpha_and_icon_id(vc, number,
                                                sc->addr.ton_npi,
                                                sc->alpha_id_call_setup,
                                                sc->icon_id_call_setup.id);
@@ -2233,7 +2318,7 @@ static gboolean handle_command_refresh(const struct stk_command *cmd,
                g_slist_foreach(file_list, (GFunc) g_free, NULL);
                g_slist_free(file_list);
 
-               return FALSE;
+               return TRUE;
        }
 
        rsp->result.type = STK_RESULT_TYPE_NOT_CAPABLE;
@@ -2293,22 +2378,64 @@ static gboolean handle_command_provide_local_info(const struct stk_command *cmd,
                                struct stk_response *rsp, struct ofono_stk *stk)
 {
        switch (cmd->qualifier) {
+       case 0:
+               DBG("Unhandled - Local information according to current NAA");
+               break;
+       case 1:
+               DBG("Unhandled - IMEI");
+               break;
+       case 2:
+               DBG("Unhandled - Network measurement results");
+               break;
        case 3:
                DBG("Date, time and time zone");
                get_time(rsp);
                return TRUE;
-
        case 4:
                DBG("Language setting");
                get_lang(rsp, stk);
                return FALSE;
+       case 6:
+               DBG("Unhandled - Access Technology");
+               break;
+       case 7:
+               DBG("Unhandled - ESN of the terminal");
+               break;
+       case 8:
+               DBG("Unhandled - IMEISV of the terminal");
+               break;
+       case 9:
+               DBG("Unhandled - Search mode");
+               break;
+       case 10:
+               DBG("Unhandled - Charge state of Battery");
+               break;
+       case 11:
+               DBG("Unhandled - MEID");
+               break;
+       case 13:
+               DBG("Unhandled - Broadcast Network information");
+               break;
+       case 14:
+               DBG("Unhandled - Multiple Access Technologies");
+               break;
+       case 15:
+               DBG("Unhandled - Location information for multiple access"
+                       " technologies");
+               break;
+       case 16:
+               DBG("Unhandled - Measurement results for multiple access"
+                       " technologies");
+               break;
 
        default:
                ofono_info("Unsupported Provide Local Info qualifier: %d",
                                cmd->qualifier);
-               rsp->result.type = STK_RESULT_TYPE_NOT_CAPABLE;
-               return TRUE;
+               break;
        }
+
+       rsp->result.type = STK_RESULT_TYPE_NOT_CAPABLE;
+       return TRUE;
 }
 
 static void send_dtmf_cancel(struct ofono_stk *stk)
@@ -2353,10 +2480,8 @@ static gboolean handle_command_send_dtmf(const struct stk_command *cmd,
 {
        static unsigned char not_in_speech_call_result[] = { 0x07 };
        struct ofono_voicecall *vc = NULL;
-       char dtmf[256], *digit;
-       char *dtmf_from = "01234567890abcABC";
-       char *dtmf_to = "01234567890*#p*#p";
-       int err, pos;
+       char dtmf[256];
+       int err;
 
        vc = __ofono_atom_find(OFONO_ATOM_TYPE_VOICECALL,
                                __ofono_atom_get_modem(stk->atom));
@@ -2366,18 +2491,12 @@ static gboolean handle_command_send_dtmf(const struct stk_command *cmd,
        }
 
        /* Convert the DTMF string to phone number format */
-       for (pos = 0; cmd->send_dtmf.dtmf[pos] != '\0'; pos++) {
-               digit = strchr(dtmf_from, cmd->send_dtmf.dtmf[pos]);
-               if (digit == NULL) {
-                       rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
-                       return TRUE;
-               }
-
-               dtmf[pos] = dtmf_to[digit - dtmf_from];
+       if (convert_to_phone_number_format(cmd->send_dtmf.dtmf, dtmf) ==
+                                               FALSE) {
+               rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
+               return TRUE;
        }
 
-       dtmf[pos] = '\0';
-
        err = __ofono_voicecall_tone_send(vc, dtmf, dtmf_sent_cb, stk);
 
        if (err == -ENOSYS) {
@@ -2448,7 +2567,7 @@ static gboolean handle_command_play_tone(const struct stk_command *cmd,
        static const struct {
                const char *name;
                /* Continuous true/false according to 02.40 */
-               gboolean continuous;
+               gboolean repeatable;
        } tone_infos[] = {
                /* Default */
                [0x00] = { "general-beep", FALSE },
@@ -2458,9 +2577,9 @@ static gboolean handle_command_play_tone(const struct stk_command *cmd,
                [0x02] = { "busy", TRUE },
                [0x03] = { "congestion", TRUE },
                [0x04] = { "radio-path-acknowledge", FALSE },
-               [0x05] = { "radio-path-not-available", FALSE },
+               [0x05] = { "radio-path-not-available", TRUE },
                [0x06] = { "error", TRUE },
-               [0x07] = { "call-waiting", FALSE },
+               [0x07] = { "call-waiting", TRUE },
                [0x08] = { "ringing-tone", TRUE },
 
                /* Proprietary */
@@ -2517,7 +2636,19 @@ static gboolean handle_command_play_tone(const struct stk_command *cmd,
        else
                timeout = manufacturer_timeout;
 
-       if (!tone_infos[pt->tone].continuous)
+       if (pt->icon_id.id != 0 && pt->icon_id.qualifier ==
+                       STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY)
+               text[0]='\0';
+
+       /*
+        * According to TS 102.223 section 6.6.6:
+        * "the length of time for which the Terminal shall generate the tone,
+        * if the tone is contunious or repeatable.  For single tones, the
+        * value of this data object shall be ignored by the Terminal.  If no
+        * duration is specified, the Terminal shall default to a duration
+        * determined by the Terminal manufacturer
+        */
+       if (!tone_infos[pt->tone].repeatable)
                /* Duration ignored */
                err = stk_agent_play_tone(stk->current_agent, text,
                                                &pt->icon_id, vibrate,
@@ -2964,7 +3095,7 @@ void ofono_stk_proactive_command_handled_notify(struct ofono_stk *stk,
                break;
 
        case STK_COMMAND_TYPE_REFRESH:
-               handle_command_refresh(stk->pending_cmd, NULL, stk);
+               ok = handle_command_refresh(stk->pending_cmd, NULL, stk);
                break;
        }
 
@@ -3103,7 +3234,7 @@ void ofono_stk_register(struct ofono_stk *stk)
        __ofono_atom_register(stk->atom, stk_unregister);
 
        stk->timeout = 180; /* 3 minutes */
-       stk->short_timeout = 20; /* 20 seconds */
+       stk->short_timeout = 25; /* 25 seconds */
        stk->envelope_q = g_queue_new();
 }
 
index af5d762..4bd39b8 100644 (file)
@@ -59,6 +59,9 @@ struct stk_agent {
        DBusPendingCall *call;
        void *user_cb;
        void *user_data;
+       int min_length;
+       int max_length;
+       ofono_bool_t hidden_entry;
        ofono_destroy_func user_destroy;
 
        const struct stk_menu *request_selection_menu;
@@ -539,14 +542,24 @@ static void get_digit_cb(DBusPendingCall *call, void *data)
 
        if (dbus_message_get_args(reply, NULL,
                                        DBUS_TYPE_STRING, &digit,
-                                       DBUS_TYPE_INVALID) == FALSE ||
-                       strlen(digit) != 1 ||
-                       !valid_phone_number_format(digit)) {
+                                       DBUS_TYPE_INVALID) == FALSE) {
                ofono_error("Can't parse the reply to GetDigit()");
                remove_agent = TRUE;
                goto error;
        }
 
+       if (strlen(digit) != 1 || !strspn(digit, "0123456789*#+")) {
+               ofono_error("Invalid character");
+               remove_agent = TRUE;
+               goto error;
+       }
+
+       if (agent->hidden_entry && digit[0] == '+') {
+               ofono_error("The character + is not allowed in this mode");
+               remove_agent = TRUE;
+               goto error;
+       }
+
        cb(result, digit, agent->user_data);
 
        CALLBACK_END();
@@ -578,6 +591,7 @@ int stk_agent_request_digit(struct stk_agent *agent, const char *text,
        agent->user_cb = cb;
        agent->user_data = user_data;
        agent->user_destroy = destroy;
+       agent->hidden_entry = FALSE;
 
        dbus_pending_call_set_notify(agent->call, get_digit_cb, agent, NULL);
 
@@ -610,6 +624,7 @@ int stk_agent_request_quick_digit(struct stk_agent *agent, const char *text,
        agent->user_cb = cb;
        agent->user_data = user_data;
        agent->user_destroy = destroy;
+       agent->hidden_entry = TRUE;
 
        dbus_pending_call_set_notify(agent->call, get_digit_cb, agent, NULL);
 
@@ -692,6 +707,7 @@ static void get_digits_cb(DBusPendingCall *call, void *data)
        enum stk_agent_result result;
        gboolean remove_agent;
        char *string;
+       int len, span;
 
        if (check_error(agent, reply,
                        ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE,
@@ -713,6 +729,25 @@ static void get_digits_cb(DBusPendingCall *call, void *data)
                goto error;
        }
 
+       len = strlen(string);
+
+       if (len < agent->min_length || len > agent->max_length) {
+               ofono_error("Length not acceptable");
+               remove_agent = TRUE;
+               goto error;
+       }
+
+       if (agent->hidden_entry)
+               span = strspn(string, "0123456789*#");
+       else
+               span = strspn(string, "0123456789*#+");
+
+       if (span != len) {
+               ofono_error("Invalid character found");
+               remove_agent = TRUE;
+               goto error;
+       }
+
        cb(result, string, agent->user_data);
 
        CALLBACK_END();
@@ -756,6 +791,9 @@ int stk_agent_request_digits(struct stk_agent *agent, const char *text,
        agent->user_cb = cb;
        agent->user_data = user_data;
        agent->user_destroy = destroy;
+       agent->min_length = min_val;
+       agent->max_length = max_val;
+       agent->hidden_entry = hidden_val;
 
        dbus_pending_call_set_notify(agent->call, get_digits_cb, agent, NULL);
 
@@ -770,6 +808,7 @@ static void get_input_cb(DBusPendingCall *call, void *data)
        enum stk_agent_result result;
        gboolean remove_agent;
        char *string;
+       int len;
 
        if (check_error(agent, reply,
                        ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE,
@@ -791,6 +830,14 @@ static void get_input_cb(DBusPendingCall *call, void *data)
                goto error;
        }
 
+       len = g_utf8_strlen(string, -1);
+
+       if (len < agent->min_length || len > agent->max_length) {
+               ofono_error("Length not acceptable");
+               remove_agent = TRUE;
+               goto error;
+       }
+
        cb(result, string, agent->user_data);
 
        CALLBACK_END();
@@ -835,6 +882,9 @@ int stk_agent_request_input(struct stk_agent *agent, const char *text,
        agent->user_cb = cb;
        agent->user_data = user_data;
        agent->user_destroy = destroy;
+       agent->min_length = min_val;
+       agent->max_length = max_val;
+       agent->hidden_entry = hidden_val;
 
        dbus_pending_call_set_notify(agent->call, get_input_cb, agent, NULL);
 
index 74888b2..bc8e0f6 100644 (file)
@@ -414,6 +414,16 @@ void ofono_ussd_notify(struct ofono_ussd *ussd, int status, int dcs,
                return;
        }
 
+       if (status == OFONO_USSD_STATUS_TERMINATED) {
+               ussd_change_state(ussd, USSD_STATE_IDLE);
+
+               if (ussd->pending == NULL)
+                       return;
+
+               reply = __ofono_error_network_terminated(ussd->pending);
+               goto out;
+       }
+
        if (status == OFONO_USSD_STATUS_NOT_SUPPORTED) {
                ussd_change_state(ussd, USSD_STATE_IDLE);
 
index 45dfac2..ae76b91 100644 (file)
@@ -2834,6 +2834,7 @@ static void sim_state_watch(enum ofono_sim_state new_state, void *user)
                                                read_sim_ecc_numbers, vc, NULL);
                break;
        case OFONO_SIM_STATE_NOT_PRESENT:
+       case OFONO_SIM_STATE_RESETTING:
                /* TODO: Must release all non-emergency calls */
 
                if (vc->sim_context) {
@@ -3868,15 +3869,21 @@ void __ofono_voicecall_set_alpha_and_icon_id(struct ofono_voicecall *vc,
        vc->dial_req = req;
 
        vc->flags |= VOICECALL_FLAG_STK_MODEM_CALLSETUP;
+
+       DBG("%p, %p", vc, vc->dial_req);
 }
 
 void __ofono_voicecall_clear_alpha_and_icon_id(struct ofono_voicecall *vc)
 {
-       g_free(vc->dial_req->message);
-       vc->dial_req->message = NULL;
+       DBG("%p, %p", vc, vc->dial_req);
 
-       g_free(vc->dial_req);
-       vc->dial_req = NULL;
+       if (vc->dial_req) {
+               g_free(vc->dial_req->message);
+               vc->dial_req->message = NULL;
+
+               g_free(vc->dial_req);
+               vc->dial_req = NULL;
+       }
 
        vc->flags &= ~VOICECALL_FLAG_STK_MODEM_CALLSETUP;
 }
diff --git a/test/dundee-connect b/test/dundee-connect
deleted file mode 100755 (executable)
index 0e1ae40..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/python
-
-import dbus
-import sys
-
-bus = dbus.SystemBus()
-
-if len(sys.argv) == 2:
-       path = sys.argv[1]
-else:
-       manager = dbus.Interface(bus.get_object('org.ofono.dundee', '/'),
-                       'org.ofono.dundee.Manager')
-       devices = manager.GetDevices()
-       path = devices[0][0]
-
-print "Connect device %s..." % path
-device = dbus.Interface(bus.get_object('org.ofono.dundee', path),
-                                               'org.ofono.dundee.Device')
-
-device.SetProperty("Active", True)
diff --git a/test/dundee-disconnect b/test/dundee-disconnect
deleted file mode 100755 (executable)
index 5b3113e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/python
-
-import dbus
-import sys
-
-bus = dbus.SystemBus()
-
-if len(sys.argv) == 2:
-       path = sys.argv[1]
-else:
-       manager = dbus.Interface(bus.get_object('org.ofono.dundee', '/'),
-                       'org.ofono.dundee.Manager')
-       devices = manager.GetDevices()
-       path = devices[0][0]
-
-print "Disonnect device %s..." % path
-device = dbus.Interface(bus.get_object('org.ofono.dundee', path),
-                                               'org.ofono.dundee.Device')
-
-device.SetProperty("Active", False)
index 326d562..ea46cd6 100755 (executable)
@@ -17,8 +17,8 @@ manager = dbus.Interface(bus.get_object("org.ofono", "/"),
 modems = manager.GetModems()
 
 for path, properties in modems:
-       if "org.ofono.SimManager" not in properties["Interfaces"]:
-               continue
+       if "org.ofono.SimManager" in properties["Interfaces"]:
+               break
 
 sim = dbus.Interface(bus.get_object('org.ofono', path),
                                'org.ofono.SimManager')
index 53124dc..2332b50 100755 (executable)
@@ -24,7 +24,8 @@ for path, properties in modems:
                print "    [ %s ]" % (path)
 
                for key in properties.keys():
-                       val = str(properties[key])
-                       print "        %s = %s" % (key, val)
-
-               print
+                       if key == 'Icon':
+                               print "        %s = %d" % (key, properties[key])
+                       else:
+                               val = str(properties[key])
+                               print "        %s = %s" % (key, val)
index 5726bc8..d859dbf 100755 (executable)
@@ -54,7 +54,8 @@ for path, properties in modems:
                                                "MicrophoneVolume",
                                                "SpeakerVolume",
                                                "Strength",
-                                               "DataStrength"]:
+                                               "DataStrength",
+                                               "BatteryChargeLevel"]:
                                val = int(properties[key])
                        elif key in ["MainMenu"]:
                                val = ", ".join([ text + " (" + str(int(icon)) +
diff --git a/test/monitor-dundee b/test/monitor-dundee
deleted file mode 100755 (executable)
index cf96ceb..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/usr/bin/python
-
-import gobject
-
-import dbus
-import dbus.mainloop.glib
-
-_dbus2py = {
-       dbus.String : unicode,
-       dbus.UInt32 : int,
-       dbus.Int32 : int,
-       dbus.Int16 : int,
-       dbus.UInt16 : int,
-       dbus.UInt64 : int,
-       dbus.Int64 : int,
-       dbus.Byte : int,
-       dbus.Boolean : bool,
-       dbus.ByteArray : str,
-       dbus.ObjectPath : str
-    }
-
-def dbus2py(d):
-       t = type(d)
-       if t in _dbus2py:
-               return _dbus2py[t](d)
-       if t is dbus.Dictionary:
-               return dict([(dbus2py(k), dbus2py(v)) for k, v in d.items()])
-       if t is dbus.Array and d.signature == "y":
-               return "".join([chr(b) for b in d])
-       if t is dbus.Array or t is list:
-               return [dbus2py(v) for v in d]
-       if t is dbus.Struct or t is tuple:
-               return tuple([dbus2py(v) for v in d])
-       return d
-
-def pretty(d):
-       d = dbus2py(d)
-       t = type(d)
-
-       if t in (dict, tuple, list) and len(d) > 0:
-               if t is dict:
-                       d = ", ".join(["%s = %s" % (k, pretty(v))
-                                       for k, v in d.items()])
-                       return "{ %s }" % d
-
-               d = " ".join([pretty(e) for e in d])
-
-               if t is tuple:
-                       return "( %s )" % d
-
-       return str(d)
-
-def property_changed(name, value, path, interface):
-       iface = interface[interface.rfind(".") + 1:]
-       print "{%s} [%s] %s = %s" % (iface, path, name, pretty(value))
-
-def added(name, value, member, path, interface):
-       iface = interface[interface.rfind(".") + 1:]
-       print "{%s} [%s] %s %s" % (iface, member, name, pretty(value))
-
-def removed(name, member, path, interface):
-       iface = interface[interface.rfind(".") + 1:]
-       print "{%s} [%s] %s" % (iface, member, name)
-
-def event(member, path, interface):
-       iface = interface[interface.rfind(".") + 1:]
-       print "{%s} [%s] %s" % (iface, path, member)
-
-def message(msg, args, member, path, interface):
-       iface = interface[interface.rfind(".") + 1:]
-       print "{%s} [%s] %s %s (%s)" % (iface, path, member,
-                                       str(msg), pretty(args))
-
-def ussd(msg, member, path, interface):
-       iface = interface[interface.rfind(".") + 1:]
-       print "{%s} [%s] %s %s" % (iface, path, member, str(msg))
-
-def value(value, member, path, interface):
-       iface = interface[interface.rfind(".") + 1:]
-       print "{%s} [%s] %s %s" % (iface, path, member, str(value))
-
-if __name__ == '__main__':
-       dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-
-       bus = dbus.SystemBus()
-
-       bus.add_signal_receiver(property_changed,
-                                       bus_name="org.ofono.dundee",
-                                       signal_name = "PropertyChanged",
-                                               path_keyword="path",
-                                               interface_keyword="interface")
-
-       bus.add_signal_receiver(added,
-                                       bus_name="org.ofono.dundee",
-                                       signal_name = "DeviceAdded",
-                                               member_keyword="member",
-                                               path_keyword="path",
-                                               interface_keyword="interface")
-
-       bus.add_signal_receiver(removed,
-                                       bus_name="org.ofono.dundee",
-                                       signal_name = "DeviceRemoved",
-                                               member_keyword="member",
-                                               path_keyword="path",
-                                               interface_keyword="interface")
-
-
-       mainloop = gobject.MainLoop()
-       mainloop.run()
index 84590ca..85c0d4a 100755 (executable)
@@ -48,6 +48,9 @@ def pretty(d):
                if t is tuple:
                        return "( %s )" % d
 
+       if t is str:
+               return "%s" % d
+
        return str(d)
 
 def property_changed(name, value, path, interface):
index a9f92e8..ae6dbcb 100755 (executable)
@@ -6,6 +6,10 @@ import sys
 import dbus
 import dbus.service
 import dbus.mainloop.glib
+import signal
+
+def handler(signum, frame):
+       raise Exception("\nSingle tone is finished!")
 
 class GoBack(dbus.DBusException):
        _dbus_error_name = "org.ofono.Error.GoBack"
@@ -18,10 +22,23 @@ class Busy(dbus.DBusException):
 
 class StkAgent(dbus.service.Object):
        exit_on_release = True
+       timeout_id = 0
+       timeout_reply_handler = None
 
        def set_exit_on_release(self, exit_on_release):
                self.exit_on_release = exit_on_release
 
+       def timeout_callback(self):
+               self.timeout_id = 0
+               self.timeout_reply_handler()
+               return False
+
+       def call_added(self, path, properties):
+               print "call added %s" % (path)
+               if (self.timeout_id > 0):
+                       gobject.source_remove(self.timeout_id)
+                       self.timeout_callback()
+
        @dbus.service.method("org.ofono.SimToolkitAgent",
                                        in_signature="", out_signature="")
        def Release(self):
@@ -34,7 +51,7 @@ class StkAgent(dbus.service.Object):
        def RequestSelection(self, title, icon, items, default):
                print "Title: (%s)" % (title)
                print "Icon: (%d)" % (icon)
-               index = 0;
+               index = 0
                for item in items:
                        print "%d. %s (icon: %d)" % (index, item[0], item[1])
                        index += 1
@@ -47,16 +64,24 @@ class StkAgent(dbus.service.Object):
                elif select == 't':
                        raise EndSession("User wishes to terminate session")
                else:
-                       return int(select);
+                       return int(select)
 
        @dbus.service.method("org.ofono.SimToolkitAgent",
-                                       in_signature="syb", out_signature="")
-       def DisplayText(self, title, icon, urgent):
+                                       in_signature="syb", out_signature="",
+                                       async_callbacks=("reply_func",
+                                                               "error_func"))
+       def DisplayText(self, title, icon, urgent, reply_func, error_func):
                print "DisplayText (%s)" % (title)
                print "Icon: (%d)" % (icon)
                print "Urgent: (%d)" % (urgent)
                key = raw_input("Press return to clear ('t' terminates, "
-                               "'b' goes back, 'n' busy):")
+                                               "'b' goes back, 'n' busy, "
+                                               "'w' return and wait):")
+
+               if key == 'w':
+                       seconds = 60
+               else:
+                       seconds = 0
 
                if key == 'b':
                        raise GoBack("User wishes to go back")
@@ -65,6 +90,13 @@ class StkAgent(dbus.service.Object):
                elif key == 'n':
                        raise Busy("User wishes to simulate busy screen")
 
+               if (seconds > 0):
+                       print "Waiting for %d seconds" % (seconds)
+
+               self.timeout_reply_handler = reply_func
+               self.timeout_id = gobject.timeout_add_seconds(seconds,
+                                                       self.timeout_callback)
+
        @dbus.service.method("org.ofono.SimToolkitAgent",
                                in_signature="sysyyb", out_signature="s")
        def RequestInput(self, title, icon, default, min_chars, max_chars,
@@ -75,7 +107,7 @@ class StkAgent(dbus.service.Object):
                print "Hide typing: (%s)" % (hide_typing)
                print "Enter characters, min: %d, max: %d:" % (min_chars,
                                                                max_chars)
-               userin = raw_input("");
+               userin = raw_input("")
 
                return userin
 
@@ -89,7 +121,7 @@ class StkAgent(dbus.service.Object):
                print "Hide typing: (%s)" % (hide_typing)
                print "Enter digits, min: %d, max: %d:" % (min_chars,
                                                                max_chars)
-               userin = raw_input("'t' terminates, 'b' goes back:");
+               userin = raw_input("'t' terminates, 'b' goes back:")
 
                if userin == 'b':
                        raise GoBack("User wishes to go back")
@@ -106,9 +138,9 @@ class StkAgent(dbus.service.Object):
                key = raw_input("Enter Key (t, b):")
 
                if key == 'b':
-                       raise GoBack("User wishes to go back");
+                       raise GoBack("User wishes to go back")
                elif key == 't':
-                       raise EndSession("User wishes to terminate session");
+                       raise EndSession("User wishes to terminate session")
                else:
                        return key
 
@@ -120,9 +152,23 @@ class StkAgent(dbus.service.Object):
                key = raw_input("Enter Digit (t, b):")
 
                if key == 'b':
-                       raise GoBack("User wishes to go back");
+                       raise GoBack("User wishes to go back")
+               elif key == 't':
+                       raise EndSession("User wishes to terminate session")
+               else:
+                       return key
+
+       @dbus.service.method("org.ofono.SimToolkitAgent",
+                               in_signature="sy", out_signature="s")
+       def RequestQuickDigit(self, title, icon):
+               print "Title: (%s)" % (title)
+               print "Icon: (%d)" % (icon)
+               key = raw_input("Quick digit (0-9, *, #, t, b):")
+
+               if key == 'b':
+                       raise GoBack("User wishes to go back")
                elif key == 't':
-                       raise EndSession("User wishes to terminate session");
+                       raise EndSession("User wishes to terminate session")
                else:
                        return key
 
@@ -134,9 +180,9 @@ class StkAgent(dbus.service.Object):
                key = raw_input("Enter Confirmation (t, b, y, n):")
 
                if key == 'b':
-                       raise GoBack("User wishes to go back");
+                       raise GoBack("User wishes to go back")
                elif key == 't':
-                       raise EndSession("User wishes to terminate session");
+                       raise EndSession("User wishes to terminate session")
                elif key == 'y':
                        return True
                else:
@@ -150,7 +196,7 @@ class StkAgent(dbus.service.Object):
                key = raw_input("Enter Confirmation (t, y, n):")
 
                if key == 't':
-                       raise EndSession("User wishes to terminate session");
+                       raise EndSession("User wishes to terminate session")
                elif key == 'y':
                        return True
                else:
@@ -181,16 +227,45 @@ class StkAgent(dbus.service.Object):
                print "Text: %s" % (text)
                print "Icon: %d" % (icon)
 
+               signal.signal(signal.SIGALRM, handler)
+               signal.alarm(5)
+
+               try:
+                       key = raw_input("Press return to end before end of"
+                                                        " single tone (t):")
+                       signal.alarm(0)
+
+                       if key == 't':
+                               raise EndSession("User wishes to terminate"
+                                                                " session")
+               except Exception, exc:
+                       print exc
+
        @dbus.service.method("org.ofono.SimToolkitAgent",
-                                       in_signature="ssy", out_signature="")
-       def LoopTone(self, tone, text, icon):
+                                       in_signature="ssy", out_signature="",
+                                       async_callbacks=("reply_func",
+                                                               "error_func"))
+       def LoopTone(self, tone, text, icon, reply_func, error_func):
                print "LoopTone: %s" % (tone)
                print "Text: %s" % (text)
                print "Icon: %d" % (icon)
-               key = raw_input("Press return to end before timeout (t):")
+               key = raw_input("Press return to end before timeout "
+                               "('t' terminates, 'w' return and wait):")
+
+               if key == 'w':
+                       seconds = 60
+               else:
+                       seconds = 0
 
                if key == 't':
-                       raise EndSession("User wishes to terminate session");
+                       raise EndSession("User wishes to terminate session")
+
+               if (seconds > 0):
+                       print "Waiting for %d seconds" % (seconds)
+
+               self.timeout_reply_handler = reply_func
+               self.timeout_id = gobject.timeout_add_seconds(seconds,
+                                                       self.timeout_callback)
 
        @dbus.service.method("org.ofono.SimToolkitAgent",
                                        in_signature="sy", out_signature="")
@@ -216,14 +291,62 @@ class StkAgent(dbus.service.Object):
                key = raw_input("Enter Confirmation (t, y, n):")
 
                if key == 't':
-                       raise EndSession("User wishes to terminate session");
+                       raise EndSession("User wishes to terminate session")
                elif key == 'y':
                        return True
                else:
                        return False
 
+_dbus2py = {
+       dbus.String : unicode,
+       dbus.UInt32 : int,
+       dbus.Int32 : int,
+       dbus.Int16 : int,
+       dbus.UInt16 : int,
+       dbus.UInt64 : int,
+       dbus.Int64 : int,
+       dbus.Byte : int,
+       dbus.Boolean : bool,
+       dbus.ByteArray : str,
+       dbus.ObjectPath : str
+    }
+
+def dbus2py(d):
+       t = type(d)
+       if t in _dbus2py:
+               return _dbus2py[t](d)
+       if t is dbus.Dictionary:
+               return dict([(dbus2py(k), dbus2py(v)) for k, v in d.items()])
+       if t is dbus.Array and d.signature == "y":
+               return "".join([chr(b) for b in d])
+       if t is dbus.Array or t is list:
+               return [dbus2py(v) for v in d]
+       if t is dbus.Struct or t is tuple:
+               return tuple([dbus2py(v) for v in d])
+       return d
+
+def pretty(d):
+       d = dbus2py(d)
+       t = type(d)
+
+       if t in (dict, tuple, list) and len(d) > 0:
+               if t is dict:
+                       d = ", ".join(["%s = %s" % (k, pretty(v))
+                                       for k, v in d.items()])
+                       return "{ %s }" % d
+
+               d = " ".join([pretty(e) for e in d])
+
+               if t is tuple:
+                       return "( %s )" % d
+
+       if t is str:
+               return "%s" % d
+
+       return str(d)
+
 def property_changed(name, value):
-       print "SimToolKit property: %s changed to '%s'" % (name, value)
+       print "SimToolKit property: %s changed to '%s'" % (name, pretty(value))
 
 if __name__ == '__main__':
        if len(sys.argv) == 2:
@@ -240,11 +363,12 @@ if __name__ == '__main__':
        modems = manager.GetModems()
 
        for path, properties in modems:
-               if "org.ofono.SimToolkit" not in properties["Interfaces"]:
-                       continue
-
-               stk = dbus.Interface(bus.get_object('org.ofono', path),
-                                       'org.ofono.SimToolkit')
+               if "org.ofono.SimToolkit" in properties["Interfaces"]:
+                       stk = dbus.Interface(bus.get_object('org.ofono', path),
+                                                       'org.ofono.SimToolkit')
+               if "org.ofono.VoiceCallManager" in properties["Interfaces"]:
+                       vcm = dbus.Interface(bus.get_object('org.ofono', path),
+                                               'org.ofono.VoiceCallManager')
 
        stk.connect_to_signal("PropertyChanged", property_changed)
 
@@ -266,12 +390,22 @@ if __name__ == '__main__':
                path = "/test/agent"
                agent = StkAgent(bus, path)
 
+               try:
+                       vcm.connect_to_signal("CallAdded", agent.call_added)
+               except:
+                       pass
+
                select = int(raw_input("Enter Selection: "))
                stk.SelectItem(select, path)
        elif mode == 'agent':
                path = "/test/agent"
                agent = StkAgent(bus, path)
 
+               try:
+                       vcm.connect_to_signal("CallAdded", agent.call_added)
+               except:
+                       pass
+
                stk.RegisterAgent(path)
 
                print "Default Agent registered - Waiting for STK command..."
diff --git a/test/test-ussd b/test/test-ussd
deleted file mode 100755 (executable)
index c21f5e3..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import gobject
-import os
-
-import dbus
-import dbus.mainloop.glib
-
-state = None
-
-def ussd_notification_received(content):
-       print("Network sent a Notification: " + content)
-
-def ussd_request_received(content):
-       print("Network sent a Request: " + content)
-       ss.Cancel()
-
-def ussd_property_changed(name, value):
-       global state
-       if name != "State":
-               return
-       print("USSD session state is " + value)
-       state = str(value)
-
-def stdin_handler(fd, condition):
-       s = os.read(fd.fileno(), 160).rstrip()
-       if not s:
-               ss.Cancel()
-       elif state == "user-response":
-               print ss.Respond(s, timeout = 100)
-       elif state == "idle":
-               print ss.Initiate(s, timeout = 100)
-       else:
-               print "Invalid state", state
-       return True
-
-if __name__ == "__main__":
-       if (len(sys.argv) < 2):
-               print "Usage: %s [modem] <ussd-string>" % (sys.argv[0])
-               sys.exit(1)
-
-       dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-
-       bus = dbus.SystemBus()
-
-       manager = dbus.Interface(bus.get_object('org.ofono', '/'),
-                                                       'org.ofono.Manager')
-
-       modems = manager.GetModems()
-       modem = modems[0][0]
-
-       if (len(sys.argv) == 2):
-               ussd = sys.argv[1]
-       else:
-               modem = sys.argv[1]
-               ussd = sys.argv[2]
-
-       ss = dbus.Interface(bus.get_object('org.ofono', modem),
-                                       'org.ofono.SupplementaryServices')
-
-       props = ss.GetProperties()
-       for p in props:
-               ussd_property_changed(p, props[p])
-
-       ss.connect_to_signal("NotificationReceived", ussd_notification_received)
-       ss.connect_to_signal("RequestReceived", ussd_request_received)
-       ss.connect_to_signal("PropertyChanged", ussd_property_changed)
-
-       print ss.Initiate(ussd, timeout=100)
-
-       gobject.io_add_watch(sys.stdin, gobject.IO_IN, stdin_handler)
-
-       mainloop = gobject.MainLoop()
-       mainloop.run()
diff --git a/test/test-voicecall b/test/test-voicecall
deleted file mode 100755 (executable)
index 3b0d432..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/python
-
-import gobject
-
-import dbus
-import dbus.mainloop.glib
-import sys
-
-def hangup_all():
-       print "Hanging up"
-       vcmanager.HangupAll()
-
-def print_calls():
-       calls = vcmanager.GetCalls()
-       if (len(calls) != 0):
-               print "No calls available"
-       else:
-               for path, properties in calls:
-                       print "    [ %s ]" % (path)
-
-                       for key in properties.keys():
-                               val = str(properties[key])
-                               print "        %s = %s" % (key, val)
-                       print
-
-def voicecalls_call_added(path, properties):
-       print "    Voice Call [ %s ] Added" % (path)
-
-       for key in properties.keys():
-               val = str(properties[key])
-               print "        %s = %s" % (key, val)
-       print
-
-def voicecalls_call_removed(path):
-       print "    Voice Call [ %s ] Removed" % (path)
-
-def voicecall_property_changed(name, value):
-       print "Voicecall property: '%s' changed to '%s'" % (name, value)
-
-def voicecall_disconnect_reason(reason):
-       print "Voicecall disconnect reason: '%s'" % (reason)
-
-if __name__ == "__main__":
-       global vcmanager
-
-       if (len(sys.argv) < 2):
-               print "Usage: %s [modem] <number>" % (sys.argv[0])
-               sys.exit(1)
-
-       dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-
-       bus = dbus.SystemBus()
-
-       manager = dbus.Interface(bus.get_object('org.ofono', '/'),
-                                                       'org.ofono.Manager')
-
-       modems = manager.GetModems()
-       modem = modems[0][0]
-
-       if (len(sys.argv) == 3):
-               modem = sys.argv[1]
-               number = sys.argv[2]
-       else:
-               number = sys.argv[1]
-       print "Using modem %s" % modem
-
-       vcmanager = dbus.Interface(bus.get_object('org.ofono', modem),
-                                               'org.ofono.VoiceCallManager')
-
-       vcmanager.connect_to_signal("CallAdded", voicecalls_call_added)
-
-       vcmanager.connect_to_signal("CallRemoved", voicecalls_call_removed)
-
-       print_calls()
-
-       print "Dialing %s..." % number
-       obj = vcmanager.Dial(number, "")
-       print "Dialing in progress, got obj: %s" % (obj)
-
-       call = dbus.Interface(bus.get_object('org.ofono', obj),
-                                               'org.ofono.VoiceCall')
-
-       properties = call.GetProperties()
-
-       print "State: %s, Number: %s" %\
-               (properties['State'], properties['LineIdentification'])
-
-       call.connect_to_signal("PropertyChanged", voicecall_property_changed)
-       call.connect_to_signal("DisconnectReason", voicecall_disconnect_reason)
-
-       gobject.timeout_add(1000000, hangup_all)
-
-       mainloop = gobject.MainLoop()
-       mainloop.run()
diff --git a/tools/stktest.c b/tools/stktest.c
new file mode 100644 (file)
index 0000000..688d720
--- /dev/null
@@ -0,0 +1,4548 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2008-2011  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <gdbus.h>
+#include <gatchat/gatserver.h>
+
+#include "unit/stk-test-data.h"
+
+#define OFONO_SERVICE  "org.ofono"
+#define STKTEST_PATH   "/stktest"
+#define STKTEST_ERROR  "org.ofono.stktest.Error"
+#define OFONO_ERROR    "org.ofono.Error"
+#define OFONO_MANAGER_INTERFACE                OFONO_SERVICE ".Manager"
+#define OFONO_MODEM_INTERFACE          OFONO_SERVICE ".Modem"
+#define OFONO_STK_INTERFACE            OFONO_SERVICE ".SimToolkit"
+#define OFONO_STKAGENT_INTERFACE       OFONO_SERVICE ".SimToolkitAgent"
+
+#define LISTEN_PORT    12765
+
+#define CYRILLIC "ЗДРАВСТВУЙТЕ"
+
+enum test_state {
+       TEST_STATE_POWERING_UP = 1,
+       TEST_STATE_REGISTERING_AGENT,
+       TEST_STATE_RUNNING,
+       TEST_STATE_POWERING_DOWN,
+};
+
+enum test_result {
+       TEST_RESULT_NOT_RUN = 0,
+       TEST_RESULT_PASSED,
+       TEST_RESULT_FAILED
+};
+
+typedef DBusMessage *(*display_text_cb_t)(DBusMessage *msg, const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent);
+typedef DBusMessage *(*get_inkey_cb_t)(DBusMessage *msg, const char *alpha,
+                                               unsigned char icon_id);
+typedef DBusMessage *(*get_input_cb_t)(DBusMessage *msg, const char *alpha,
+                                               unsigned char icon_id,
+                                               const char *def_input,
+                                               unsigned char min_chars,
+                                               unsigned char max_chars,
+                                               gboolean hide_typing);
+typedef DBusMessage *(*play_tone_cb_t)(DBusMessage *msg, const char *tone,
+                                               const char *text,
+                                               unsigned char icon_id);
+typedef void (*terminal_response_func)(const unsigned char *pdu,
+                                       unsigned int len);
+
+struct test {
+       char *name;
+       char *method;
+       unsigned char *req_pdu;
+       unsigned int req_len;
+       unsigned char *rsp_pdu;
+       unsigned int rsp_len;
+       void *agent_func;
+       terminal_response_func tr_func;
+       enum test_result result;
+       gdouble min_time;
+       gdouble max_time;
+};
+
+static GMainLoop *main_loop = NULL;
+static volatile sig_atomic_t __terminated = 0;
+static GList *tests = NULL;
+static GList *cur_test = NULL;
+static GTimer *timer = NULL;
+
+/* DBus related */
+static DBusConnection *conn;
+static gboolean ofono_running = FALSE;
+static guint modem_changed_watch;
+static enum test_state state;
+static DBusMessage *pending = NULL;
+
+/* Emulator setup */
+static guint server_watch;
+static GAtServer *emulator;
+
+/* Emulated modem state variables */
+static int modem_mode = 0;
+
+static void __stktest_test_next();
+static void __stktest_test_finish(gboolean successful);
+static gboolean create_tcp(void);
+
+#define STKTEST_AGENT_ASSERT(expr)                                     \
+       do {                                                            \
+               if (!(expr)) {                                          \
+                       g_printerr("Assertion Failed %s:%d %s\n",       \
+                                       __FILE__, __LINE__, #expr);     \
+                       __stktest_test_finish(FALSE);                   \
+                       return stktest_error_failed(msg);               \
+               }                                                       \
+       } while (0)
+
+#define STKTEST_RESPONSE_ASSERT(expect_pdu, expect_pdu_len,            \
+                               got_pdu, got_pdu_len)                   \
+       do {                                                            \
+               if ((expect_pdu_len) != (got_pdu_len)) {                \
+                       g_printerr("Assertion Failed %s:%d"             \
+                                       " Wrong response len"           \
+                                       " want: %d, got: %d\n",         \
+                                       __FILE__, __LINE__,             \
+                                       expect_pdu_len, got_pdu_len);   \
+                       __stktest_test_finish(FALSE);                   \
+                       return;                                         \
+               }                                                       \
+                                                                       \
+               if (memcmp(expect_pdu, got_pdu, expect_pdu_len) != 0) { \
+                       g_printerr("Assertion Failed %s:%d"             \
+                                       "Wrong response\n",             \
+                                       __FILE__, __LINE__);            \
+                       __stktest_test_finish(FALSE);                   \
+                       return;                                         \
+               }                                                       \
+       } while (0)
+
+static const char *to_hex(const unsigned char *data, unsigned int len)
+{
+       static char buf[512+1];
+       unsigned int i;
+
+       for (i = 0; i < len; i++)
+               sprintf(buf + i * 2, "%02hhX", data[i]);
+
+       buf[i*2] = '\0';
+
+       return buf;
+}
+
+static void send_proactive_command(const unsigned char *pdu, unsigned int len)
+{
+       char buf[1024];
+
+       sprintf(buf, "+CUSATP: %s", to_hex(pdu, len));
+       g_at_server_send_unsolicited(emulator, buf);
+}
+
+static DBusMessage *stktest_error_invalid_args(DBusMessage *msg)
+{
+       return g_dbus_create_error(msg, STKTEST_ERROR ".InvalidArguments",
+                                       "Invalid arguments provided");
+}
+
+static DBusMessage *stktest_error_failed(DBusMessage *msg)
+{
+       return g_dbus_create_error(msg, STKTEST_ERROR ".Failed",
+                                       "Operation failed");
+}
+
+static DBusMessage *stktest_error_end_session(DBusMessage *msg)
+{
+       return g_dbus_create_error(msg, OFONO_ERROR ".EndSession",
+                                       "End Session Request");
+}
+
+static DBusMessage *stktest_error_go_back(DBusMessage *msg)
+{
+       return g_dbus_create_error(msg, OFONO_ERROR ".GoBack",
+                                       "Go Back Request");
+}
+
+static DBusMessage *stktest_error_busy(DBusMessage *msg)
+{
+       return g_dbus_create_error(msg, OFONO_ERROR ".Busy",
+                                       "UI Busy");
+}
+
+static DBusMessage *agent_release(DBusConnection *conn, DBusMessage *msg,
+                                       void *data)
+{
+       g_print("Got Release\n");
+
+       if (pending) {
+               dbus_message_unref(pending);
+               pending = NULL;
+       }
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *agent_cancel(DBusConnection *conn, DBusMessage *msg,
+                                       void *data)
+{
+       if (pending) {
+               dbus_message_unref(pending);
+               pending = NULL;
+       }
+
+       return NULL;
+}
+
+static DBusMessage *agent_display_text(DBusConnection *conn, DBusMessage *msg,
+                                       void *data)
+{
+       const char *text;
+       unsigned char icon_id;
+       dbus_bool_t urgent;
+       struct test *test;
+       display_text_cb_t func;
+       DBusMessage *reply;
+
+       if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &text,
+                                               DBUS_TYPE_BYTE, &icon_id,
+                                               DBUS_TYPE_BOOLEAN, &urgent,
+                                               DBUS_TYPE_INVALID) == FALSE)
+               return stktest_error_invalid_args(msg);
+
+       if (cur_test == NULL)
+               return stktest_error_failed(msg);
+
+       test = cur_test->data;
+       func = test->agent_func;
+
+       if (strcmp(test->method, "DisplayText")) {
+               g_printerr("Wrong method called!\n");
+               __stktest_test_finish(FALSE);
+               return stktest_error_failed(msg);
+       }
+
+       if (func == NULL) {
+               g_printerr("DisplayText not expected to be called");
+               __stktest_test_finish(FALSE);
+               return stktest_error_failed(msg);
+       }
+
+       reply = func(msg, text, icon_id, urgent);
+       if (reply == NULL)
+               pending = dbus_message_ref(msg);
+
+       return reply;
+}
+
+#define GET_INKEY_TEMPLATE(func, method_name)                          \
+static DBusMessage *func(DBusConnection *conn, DBusMessage *msg,       \
+                               void *data)                             \
+{                                                                      \
+       const char *alpha;                                              \
+       unsigned char icon_id;                                          \
+       struct test *test;                                              \
+       get_inkey_cb_t func;                                            \
+       DBusMessage *reply;                                             \
+                                                                       \
+       if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &alpha,  \
+                                       DBUS_TYPE_BYTE, &icon_id,       \
+                                       DBUS_TYPE_INVALID) == FALSE)    \
+               return stktest_error_invalid_args(msg);                 \
+                                                                       \
+       if (cur_test == NULL)                                           \
+               return stktest_error_failed(msg);                       \
+                                                                       \
+       test = cur_test->data;                                          \
+       func = test->agent_func;                                        \
+                                                                       \
+       if (strcmp(test->method, method_name)) {                        \
+               g_printerr("Wrong method called!"                       \
+                               "  Expected: %s, Got: %s\n",            \
+                               test->method, method_name);             \
+               __stktest_test_finish(FALSE);                           \
+               return stktest_error_failed(msg);                       \
+       }                                                               \
+                                                                       \
+       if (func == NULL) {                                             \
+               g_printerr(method_name " not expected to be called");   \
+               __stktest_test_finish(FALSE);                           \
+               return stktest_error_failed(msg);                       \
+       }                                                               \
+                                                                       \
+       reply = func(msg, alpha, icon_id);                              \
+       if (reply == NULL)                                              \
+               pending = dbus_message_ref(msg);                        \
+                                                                       \
+       return reply;                                                   \
+}                                                                      \
+
+GET_INKEY_TEMPLATE(agent_request_key, "RequestKey")
+GET_INKEY_TEMPLATE(agent_request_digit, "RequestDigit")
+GET_INKEY_TEMPLATE(agent_request_confirmation, "RequestConfirmation")
+
+#define GET_INPUT_TEMPLATE(func, method_name)                          \
+static DBusMessage *func(DBusConnection *conn, DBusMessage *msg,       \
+                               void *data)                             \
+{                                                                      \
+       const char *alpha;                                              \
+       const char *def_input;                                          \
+       unsigned char icon_id;                                          \
+       unsigned char min_chars;                                        \
+       unsigned char max_chars;                                        \
+       gboolean hide_typing;                                           \
+       struct test *test;                                              \
+       get_input_cb_t func;                                            \
+       DBusMessage *reply;                                             \
+                                                                       \
+       if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &alpha,  \
+                                       DBUS_TYPE_BYTE, &icon_id,       \
+                                       DBUS_TYPE_STRING, &def_input,   \
+                                       DBUS_TYPE_BYTE, &min_chars,     \
+                                       DBUS_TYPE_BYTE, &max_chars,     \
+                                       DBUS_TYPE_BOOLEAN,              \
+                                       &hide_typing,                   \
+                                       DBUS_TYPE_INVALID) == FALSE)    \
+               return stktest_error_invalid_args(msg);                 \
+                                                                       \
+       if (cur_test == NULL)                                           \
+               return stktest_error_failed(msg);                       \
+                                                                       \
+       test = cur_test->data;                                          \
+       func = test->agent_func;                                        \
+                                                                       \
+       if (strcmp(test->method, method_name)) {                        \
+               g_printerr("Wrong method called!"                       \
+                               "  Expected: %s, Got: %s\n",            \
+                               test->method, method_name);             \
+               __stktest_test_finish(FALSE);                           \
+               return stktest_error_failed(msg);                       \
+       }                                                               \
+                                                                       \
+       if (func == NULL) {                                             \
+               g_printerr(method_name " not expected to be called");   \
+               __stktest_test_finish(FALSE);                           \
+               return stktest_error_failed(msg);                       \
+       }                                                               \
+                                                                       \
+       reply = func(msg, alpha, icon_id, def_input,                    \
+                       min_chars, max_chars, hide_typing);             \
+       if (reply == NULL)                                              \
+               pending = dbus_message_ref(msg);                        \
+                                                                       \
+       return reply;                                                   \
+}                                                                      \
+
+GET_INPUT_TEMPLATE(agent_request_input, "RequestInput")
+GET_INPUT_TEMPLATE(agent_request_digits, "RequestDigits")
+
+#define PLAY_TONE_TEMPLATE(func, method_name)                          \
+static DBusMessage *func(DBusConnection *conn, DBusMessage *msg,       \
+                               void *data)                             \
+{                                                                      \
+       const char *tone;                                               \
+       const char *text;                                               \
+       unsigned char icon_id;                                          \
+       struct test *test;                                              \
+       play_tone_cb_t func;                                            \
+       DBusMessage *reply;                                             \
+                                                                       \
+       if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &tone,   \
+                                       DBUS_TYPE_STRING, &text,        \
+                                       DBUS_TYPE_BYTE, &icon_id,       \
+                                       DBUS_TYPE_INVALID) == FALSE)    \
+               return stktest_error_invalid_args(msg);                 \
+                                                                       \
+       if (cur_test == NULL)                                           \
+               return stktest_error_failed(msg);                       \
+                                                                       \
+       test = cur_test->data;                                          \
+       func = test->agent_func;                                        \
+                                                                       \
+       if (strcmp(test->method, method_name)) {                        \
+               g_printerr("Wrong method called!"                       \
+                               "  Expected: %s, Got: %s\n",            \
+                               test->method, method_name);             \
+               __stktest_test_finish(FALSE);                           \
+               return stktest_error_failed(msg);                       \
+       }                                                               \
+                                                                       \
+       if (func == NULL) {                                             \
+               g_printerr(method_name " not expected to be called");   \
+               __stktest_test_finish(FALSE);                           \
+               return stktest_error_failed(msg);                       \
+       }                                                               \
+                                                                       \
+       reply = func(msg, tone, text, icon_id);                         \
+       if (reply == NULL)                                              \
+               pending = dbus_message_ref(msg);                        \
+                                                                       \
+       return reply;                                                   \
+}                                                                      \
+
+PLAY_TONE_TEMPLATE(agent_play_tone, "PlayTone")
+PLAY_TONE_TEMPLATE(agent_loop_tone, "LoopTone")
+
+static void server_debug(const char *str, void *data)
+{
+       g_print("%s: %s\n", (char *) data, str);
+}
+
+static void cgmi_cb(GAtServer *server, GAtServerRequestType type,
+                       GAtResult *cmd, gpointer user)
+{
+       switch (type) {
+       case G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY:
+               g_at_server_send_info(server, "oFono", TRUE);
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+               break;
+       case G_AT_SERVER_REQUEST_TYPE_SUPPORT:
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+               break;
+       default:
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+       };
+}
+
+static void cgmm_cb(GAtServer *server, GAtServerRequestType type,
+                       GAtResult *cmd, gpointer user)
+{
+       switch (type) {
+       case G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY:
+               g_at_server_send_info(server, "oFono pre-1.0", TRUE);
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+               break;
+       case G_AT_SERVER_REQUEST_TYPE_SUPPORT:
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+               break;
+       default:
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+       };
+}
+
+static void cgmr_cb(GAtServer *server, GAtServerRequestType type,
+                       GAtResult *cmd, gpointer user)
+{
+       char buf[256];
+
+       switch (type) {
+       case G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY:
+               sprintf(buf, "oFono pre-1.0 version: %s", VERSION);
+               g_at_server_send_info(server, buf, TRUE);
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+               break;
+       case G_AT_SERVER_REQUEST_TYPE_SUPPORT:
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+               break;
+       default:
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+       };
+}
+
+static void cgsn_cb(GAtServer *server, GAtServerRequestType type,
+                       GAtResult *cmd, gpointer user)
+{
+       switch (type) {
+       case G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY:
+               g_at_server_send_info(server, "123456789", TRUE);
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+               break;
+       case G_AT_SERVER_REQUEST_TYPE_SUPPORT:
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+               break;
+       default:
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+       };
+}
+
+static gboolean send_ok(gpointer user)
+{
+       GAtServer *server = user;
+
+       g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+
+       return FALSE;
+}
+
+static void cfun_cb(GAtServer *server, GAtServerRequestType type,
+                       GAtResult *cmd, gpointer user)
+{
+       char buf[12];
+
+       switch (type) {
+       case G_AT_SERVER_REQUEST_TYPE_SUPPORT:
+               g_at_server_send_info(server, "+CFUN: (0-1,4)", TRUE);
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+               break;
+       case G_AT_SERVER_REQUEST_TYPE_QUERY:
+               snprintf(buf, sizeof(buf), "+CFUN: %d", modem_mode);
+               g_at_server_send_info(server, buf, TRUE);
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+               break;
+       case G_AT_SERVER_REQUEST_TYPE_SET:
+       {
+               GAtResultIter iter;
+               int mode;
+
+               g_at_result_iter_init(&iter, cmd);
+               g_at_result_iter_next(&iter, "");
+
+               if (g_at_result_iter_next_number(&iter, &mode) == FALSE)
+                       goto error;
+
+               if (mode != 0 && mode != 1)
+                       goto error;
+
+               if (modem_mode == mode) {
+                       g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+                       break;
+               }
+
+               modem_mode = mode;
+               g_timeout_add_seconds(1, send_ok, server);
+               break;
+       }
+       default:
+               goto error;
+       };
+
+       return;
+
+error:
+       g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+}
+
+static void cusatt_cb(GAtServer *server, GAtServerRequestType type,
+                       GAtResult *cmd, gpointer user)
+{
+       switch (type) {
+       case G_AT_SERVER_REQUEST_TYPE_SUPPORT:
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+               break;
+       case G_AT_SERVER_REQUEST_TYPE_QUERY:
+               g_at_server_send_ext_final(server, "+CME ERROR: 4");
+               break;
+       case G_AT_SERVER_REQUEST_TYPE_SET:
+       {
+               GAtResultIter iter;
+               const unsigned char *pdu;
+               int len;
+               struct test *test;
+               terminal_response_func func;
+
+               g_at_result_iter_init(&iter, cmd);
+               g_at_result_iter_next(&iter, "");
+
+               if (g_at_result_iter_next_hexstring(&iter, &pdu, &len) == FALSE)
+                       goto error;
+
+               if (cur_test == NULL)
+                       goto error;
+
+               g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+
+               test = cur_test->data;
+               func = test->tr_func;
+               func(pdu, len);
+               break;
+       }
+       default:
+               goto error;
+       };
+
+       return;
+
+error:
+       g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+}
+
+static void listen_again(gpointer user_data)
+{
+       g_at_server_unref(emulator);
+       emulator = NULL;
+
+       if (create_tcp() == TRUE)
+               return;
+
+       g_print("Error listening to socket\n");
+       g_main_loop_quit(main_loop);
+}
+
+static void setup_emulator(GAtServer *server)
+{
+       g_at_server_set_debug(server, server_debug, "Server");
+
+       g_at_server_register(server, "+CGMI", cgmi_cb, NULL, NULL);
+       g_at_server_register(server, "+CGMM", cgmm_cb, NULL, NULL);
+       g_at_server_register(server, "+CGMR", cgmr_cb, NULL, NULL);
+       g_at_server_register(server, "+CGSN", cgsn_cb, NULL, NULL);
+       g_at_server_register(server, "+CFUN", cfun_cb, NULL, NULL);
+       g_at_server_register(server, "+CUSATT", cusatt_cb, NULL, NULL);
+
+       g_at_server_set_disconnect_function(server, listen_again, NULL);
+}
+
+static gboolean on_socket_connected(GIOChannel *chan, GIOCondition cond,
+                                                       gpointer user)
+{
+       struct sockaddr saddr;
+       unsigned int len = sizeof(saddr);
+       int fd;
+       GIOChannel *client_io = NULL;
+
+       if (cond != G_IO_IN)
+               goto error;
+
+       fd = accept(g_io_channel_unix_get_fd(chan), &saddr, &len);
+       if (fd == -1)
+               goto error;
+
+       client_io = g_io_channel_unix_new(fd);
+
+       emulator = g_at_server_new(client_io);
+       g_at_server_set_echo(emulator, FALSE);
+       g_io_channel_unref(client_io);
+
+       if (emulator == NULL)
+               goto error;
+
+       setup_emulator(emulator);
+
+error:
+       server_watch = 0;
+       return FALSE;
+}
+
+static gboolean create_tcp(void)
+{
+       struct sockaddr_in addr;
+       int sk;
+       int reuseaddr = 1;
+       GIOChannel *server_io;
+
+       sk = socket(PF_INET, SOCK_STREAM, 0);
+       if (sk < 0) {
+               g_print("Can't create tcp/ip socket: %s (%d)\n",
+                                               strerror(errno), errno);
+               return FALSE;
+       }
+
+       memset(&addr, 0, sizeof(addr));
+
+       addr.sin_family = AF_INET;
+       addr.sin_addr.s_addr = INADDR_ANY;
+       addr.sin_port = htons(LISTEN_PORT);
+
+       setsockopt(sk, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr));
+       if (bind(sk, (struct sockaddr *) &addr, sizeof(struct sockaddr)) < 0) {
+               g_print("Can't bind socket: %s (%d)", strerror(errno), errno);
+               close(sk);
+               return FALSE;
+       }
+
+       if (listen(sk, 1) < 0) {
+               g_print("Can't listen on socket: %s (%d)",
+                                               strerror(errno), errno);
+               close(sk);
+               return FALSE;
+       }
+
+       g_print("new tcp is created at tcp port %d\n", LISTEN_PORT);
+
+       server_io = g_io_channel_unix_new(sk);
+       g_io_channel_set_close_on_unref(server_io, TRUE);
+
+       server_watch = g_io_add_watch_full(server_io,
+                               G_PRIORITY_DEFAULT,
+                               G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
+                               on_socket_connected, NULL, NULL);
+
+       g_io_channel_unref(server_io);
+
+       return TRUE;
+}
+
+static gboolean has_stk_interface(DBusMessageIter *iter)
+{
+       DBusMessageIter entry;
+
+       dbus_message_iter_recurse(iter, &entry);
+
+       while (dbus_message_iter_get_arg_type(&entry) == DBUS_TYPE_STRING) {
+               const char *interface;
+
+               dbus_message_iter_get_basic(&entry, &interface);
+
+               if (g_str_equal(interface, OFONO_STK_INTERFACE) == TRUE)
+                       return TRUE;
+
+               dbus_message_iter_next(&entry);
+       }
+
+       return FALSE;
+}
+
+static int send_with_reply(const char *path, const char *interface,
+                               const char *method, DBusPendingCall **call,
+                               DBusPendingCallNotifyFunction cb,
+                               void *user_data, DBusFreeFunction free_func,
+                               int timeout, int type, ...)
+{
+       DBusMessage *msg;
+       DBusPendingCall *c;
+       va_list args;
+       int err;
+
+       msg = dbus_message_new_method_call(OFONO_SERVICE, path,
+                                               interface, method);
+       if (msg == NULL) {
+               g_printerr("Unable to allocate new D-Bus %s message\n", method);
+               err = -ENOMEM;
+               goto fail;
+       }
+
+       va_start(args, type);
+
+       if (!dbus_message_append_args_valist(msg, type, args)) {
+               va_end(args);
+               err = -EIO;
+               goto fail;
+       }
+
+       va_end(args);
+
+       if (timeout > 0)
+               timeout *= 1000;
+
+       if (!dbus_connection_send_with_reply(conn, msg, &c, timeout)) {
+               g_printerr("Sending %s failed\n", method);
+               err = -EIO;
+               goto fail;
+       }
+
+       if (call != NULL)
+               *call = c;
+
+       dbus_pending_call_set_notify(c, cb, user_data, free_func);
+       dbus_pending_call_unref(c);
+
+       dbus_message_unref(msg);
+
+       return 0;
+
+fail:
+       if (free_func && user_data)
+               free_func(user_data);
+
+       if (msg)
+               dbus_message_unref(msg);
+
+       return err;
+}
+
+static void set_property_reply(DBusPendingCall *call, void *user_data)
+{
+       DBusMessage *reply = dbus_pending_call_steal_reply(call);
+       DBusError err;
+
+       dbus_error_init(&err);
+
+       if (dbus_set_error_from_message(&err, reply) == TRUE) {
+               g_printerr("%s: %s\n", err.name, err.message);
+               dbus_error_free(&err);
+       }
+
+       dbus_message_unref(reply);
+}
+
+static int set_property(const char *path, const char *interface,
+                       const char *key, int type, const void *val,
+                       DBusPendingCallNotifyFunction notify,
+                       gpointer user_data,
+                       DBusFreeFunction destroy)
+{
+       DBusMessage *msg;
+       DBusMessageIter iter, value;
+       DBusPendingCall *call;
+       const char *signature;
+
+       msg = dbus_message_new_method_call(OFONO_SERVICE, path, interface,
+                                               "SetProperty");
+       if (msg == NULL)
+               return -ENOMEM;
+
+       dbus_message_set_auto_start(msg, FALSE);
+
+       dbus_message_iter_init_append(msg, &iter);
+
+       dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &key);
+
+       switch (type) {
+       case DBUS_TYPE_BOOLEAN:
+               signature = DBUS_TYPE_BOOLEAN_AS_STRING;
+               break;
+       default:
+               dbus_message_unref(msg);
+               return -EINVAL;
+       }
+
+       dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT,
+                                                       signature, &value);
+       dbus_message_iter_append_basic(&value, type, val);
+       dbus_message_iter_close_container(&iter, &value);
+
+       if (dbus_connection_send_with_reply(conn, msg, &call, -1) == FALSE) {
+               dbus_message_unref(msg);
+               return -EIO;
+       }
+
+       dbus_message_unref(msg);
+
+       if (call == NULL)
+               return -EINVAL;
+
+       dbus_pending_call_set_notify(call, notify, user_data, destroy);
+
+       dbus_pending_call_unref(call);
+
+       return 0;
+}
+
+static void register_agent_reply(DBusPendingCall *call, void *user_data)
+{
+       DBusMessage *reply = dbus_pending_call_steal_reply(call);
+       DBusError err;
+       struct test *test;
+
+       dbus_error_init(&err);
+
+       if (dbus_set_error_from_message(&err, reply) == TRUE) {
+               g_printerr("%s: %s\n", err.name, err.message);
+               dbus_error_free(&err);
+       }
+
+       dbus_message_unref(reply);
+
+       state = TEST_STATE_RUNNING;
+       test = cur_test->data;
+       send_proactive_command(test->req_pdu, test->req_len);
+
+       if (test->min_time != 0.0 || test->max_time != 0.0)
+               g_timer_start(timer);
+}
+
+static void register_agent()
+{
+       const char *path = "/default";
+       int status;
+
+       g_print("Gained STK interface, registering agent...\n");
+
+       status = send_with_reply(STKTEST_PATH, OFONO_STK_INTERFACE,
+                                       "RegisterAgent", NULL,
+                                       register_agent_reply, NULL, NULL, 1,
+                                       DBUS_TYPE_OBJECT_PATH, &path,
+                                       DBUS_TYPE_INVALID);
+
+       if (status < 0) {
+               g_printerr("Unable to register agent with oFono\n");
+               g_main_loop_quit(main_loop);
+               return;
+       }
+
+       state = TEST_STATE_REGISTERING_AGENT;
+}
+
+static gboolean modem_changed(DBusConnection *conn,
+                               DBusMessage *msg, void *user_data)
+{
+       DBusMessageIter iter, value;
+       const char *path, *key;
+       gboolean has_stk;
+
+       if (dbus_message_iter_init(msg, &iter) == FALSE)
+               return TRUE;
+
+       path = dbus_message_get_path(msg);
+
+       if (g_str_equal(STKTEST_PATH, path) == FALSE)
+               return TRUE;
+
+       dbus_message_iter_get_basic(&iter, &key);
+
+       dbus_message_iter_next(&iter);
+       dbus_message_iter_recurse(&iter, &value);
+
+       if (g_str_equal(key, "Interfaces") == FALSE)
+               return TRUE;
+
+       has_stk = has_stk_interface(&value);
+
+       switch (state) {
+       case TEST_STATE_POWERING_UP:
+               if (has_stk)
+                       register_agent();
+               break;
+       case TEST_STATE_REGISTERING_AGENT:
+       case TEST_STATE_RUNNING:
+               if (has_stk == FALSE)
+                       g_printerr("Unexpectedly lost STK interface\n");
+               /* Fall through */
+       case TEST_STATE_POWERING_DOWN:
+               break;
+       };
+
+       return TRUE;
+}
+
+static void powerup(void)
+{
+       dbus_bool_t powered = TRUE;
+
+       state = TEST_STATE_POWERING_UP;
+       set_property(STKTEST_PATH, OFONO_MODEM_INTERFACE, "Powered",
+                       DBUS_TYPE_BOOLEAN, &powered,
+                       set_property_reply, NULL, NULL);
+}
+
+static void get_modems_reply(DBusPendingCall *call, void *user_data)
+{
+       DBusMessage *reply = dbus_pending_call_steal_reply(call);
+       DBusMessageIter iter, list;
+       DBusError err;
+       gboolean found = FALSE;
+
+       dbus_error_init(&err);
+
+       if (dbus_set_error_from_message(&err, reply) == TRUE) {
+               g_printerr("%s: %s\n", err.name, err.message);
+               dbus_error_free(&err);
+               goto done;
+       }
+
+       if (dbus_message_has_signature(reply, "a(oa{sv})") == FALSE)
+               goto done;
+
+       if (dbus_message_iter_init(reply, &iter) == FALSE)
+               goto done;
+
+       dbus_message_iter_recurse(&iter, &list);
+
+       while (dbus_message_iter_get_arg_type(&list) == DBUS_TYPE_STRUCT) {
+               DBusMessageIter entry;
+               const char *path;
+
+               dbus_message_iter_recurse(&list, &entry);
+               dbus_message_iter_get_basic(&entry, &path);
+
+               if (g_str_equal(path, STKTEST_PATH))
+                       found = TRUE;
+
+               dbus_message_iter_next(&list);
+       }
+
+done:
+       dbus_message_unref(reply);
+
+       if (found == FALSE) {
+               g_printerr("STK Test modem not found\n");
+               g_main_loop_quit(main_loop);
+               return;
+       }
+
+       g_print("Test modem found\n");
+
+       modem_changed_watch = g_dbus_add_signal_watch(conn, OFONO_SERVICE,
+                                                       STKTEST_PATH,
+                                                       OFONO_MODEM_INTERFACE,
+                                                       "PropertyChanged",
+                                                       modem_changed,
+                                                       NULL, NULL);
+
+       if (create_tcp() == FALSE) {
+               g_printerr("Unable to listen on modem emulator socket\n");
+               g_main_loop_quit(main_loop);
+       }
+
+       __stktest_test_next();
+}
+
+static int get_modems(DBusConnection *conn)
+{
+       DBusMessage *msg;
+       DBusPendingCall *call;
+
+       msg = dbus_message_new_method_call(OFONO_SERVICE, "/",
+                                       OFONO_MANAGER_INTERFACE, "GetModems");
+       if (msg == NULL)
+               return -ENOMEM;
+
+       dbus_message_set_auto_start(msg, FALSE);
+
+       g_print("getting modems\n");
+
+       if (dbus_connection_send_with_reply(conn, msg, &call, -1) == FALSE) {
+               dbus_message_unref(msg);
+               return -EIO;
+       }
+
+       dbus_message_unref(msg);
+
+       if (call == NULL)
+               return -EINVAL;
+
+       dbus_pending_call_set_notify(call, get_modems_reply, conn, NULL);
+
+       dbus_pending_call_unref(call);
+
+       return 0;
+}
+
+static const GDBusMethodTable agent_methods[] = {
+       { GDBUS_METHOD("Release", NULL, NULL, agent_release) },
+       { GDBUS_ASYNC_METHOD("DisplayText",
+               GDBUS_ARGS({ "text", "s" }, { "icon_id", "y" },
+                               { "urgent", "b" }), NULL,
+                               agent_display_text) },
+       { GDBUS_ASYNC_METHOD("RequestDigit",
+               GDBUS_ARGS({ "alpha", "s" }, { "icon_id", "y" }),
+               GDBUS_ARGS({ "digit", "s" }),
+                               agent_request_digit) },
+       { GDBUS_ASYNC_METHOD("RequestKey",
+               GDBUS_ARGS({ "alpha", "s" }, { "icon_id", "y" }),
+               GDBUS_ARGS({ "key", "s" }),
+                               agent_request_key) },
+       { GDBUS_ASYNC_METHOD("RequestConfirmation",
+               GDBUS_ARGS({ "alpha", "s" }, { "icon_id", "y" }),
+               GDBUS_ARGS({ "confirmation", "b" }),
+                               agent_request_confirmation) },
+       { GDBUS_ASYNC_METHOD("RequestInput",
+               GDBUS_ARGS({ "alpha", "s" }, { "icon_id", "y" },
+                               { "default", "s" }, { "min_chars", "y" },
+                               { "max_chars", "y" }, { "hide_typing", "b" }),
+               GDBUS_ARGS({ "input", "s" }), agent_request_input) },
+       { GDBUS_ASYNC_METHOD("RequestDigits",
+               GDBUS_ARGS({ "alpha", "s" }, { "icon_id", "y" },
+                               { "default", "s" }, { "min_chars", "y" },
+                               { "max_chars", "y" }, { "hide_typing", "b" }),
+               GDBUS_ARGS({ "digits", "s" }), agent_request_digits) },
+       { GDBUS_ASYNC_METHOD("PlayTone",
+               GDBUS_ARGS({ "tone", "s" }, { "text", "s" },
+                               { "icon_id", "y" }),
+               NULL, agent_play_tone) },
+       { GDBUS_ASYNC_METHOD("LoopTone",
+               GDBUS_ARGS({ "tone", "s" }, { "text", "s" },
+                               { "icon_id", "y" }),
+               NULL, agent_loop_tone) },
+       { GDBUS_NOREPLY_METHOD("Cancel", NULL, NULL, agent_cancel) },
+       { },
+};
+
+static void ofono_connect(DBusConnection *conn, void *user_data)
+{
+       g_print("starting telephony interface\n");
+
+       if (!g_dbus_register_interface(conn, "/default",
+                                       OFONO_STKAGENT_INTERFACE,
+                                       agent_methods, NULL, NULL,
+                                       NULL, NULL)) {
+               g_printerr("Unable to register local agent");
+               g_main_loop_quit(main_loop);
+       }
+
+       ofono_running = TRUE;
+       get_modems(conn);
+}
+
+static void ofono_disconnect(DBusConnection *conn, void *user_data)
+{
+       g_print("stopping telephony interface\n");
+
+       g_dbus_unregister_interface(conn, "/default", OFONO_STKAGENT_INTERFACE);
+
+       ofono_running = FALSE;
+
+       g_dbus_remove_watch(conn, modem_changed_watch);
+       modem_changed_watch = 0;
+
+       if (server_watch) {
+               g_source_remove(server_watch);
+               server_watch = 0;
+       }
+
+       g_at_server_unref(emulator);
+       emulator = NULL;
+}
+
+static void sig_term(int sig)
+{
+       if (__terminated > 0)
+               return;
+
+       __terminated = 1;
+
+       g_print("Terminating\n");
+
+       g_main_loop_quit(main_loop);
+}
+
+static void disconnect_callback(DBusConnection *conn, void *user_data)
+{
+       g_printerr("D-Bus disconnect\n");
+
+       g_main_loop_quit(main_loop);
+}
+
+static gboolean end_session_and_finish(gpointer user_data)
+{
+       g_at_server_send_unsolicited(emulator, "+CUSATEND");
+       __stktest_test_finish(TRUE);
+
+       return FALSE;
+}
+
+static void expect_response_and_finish(const unsigned char *pdu,
+                                       unsigned int len)
+{
+       struct test *test = cur_test->data;
+
+       STKTEST_RESPONSE_ASSERT(test->rsp_pdu, test->rsp_len, pdu, len);
+
+       if (test->min_time != 0.0 || test->max_time != 0.0) {
+               gdouble elapsed = g_timer_elapsed(timer, NULL);
+
+               if (elapsed < test->min_time) {
+                       g_printerr("Response received too soon, elapsed:%.2f,"
+                                       " expected: %.2f\n", elapsed,
+                                       test->min_time);
+                       __stktest_test_finish(FALSE);
+                       return;
+               }
+
+               if (elapsed > test->max_time) {
+                       g_printerr("Response received too late, elapsed: %.2f,"
+                                       " expected: %.2f\n", elapsed,
+                                       test->max_time);
+                       __stktest_test_finish(FALSE);
+                       return;
+               }
+       }
+
+       g_idle_add(end_session_and_finish, NULL);
+}
+
+static void expect_response(const unsigned char *pdu, unsigned int len)
+{
+       struct test *test = cur_test->data;
+
+       STKTEST_RESPONSE_ASSERT(test->rsp_pdu, test->rsp_len, pdu, len);
+}
+
+static gboolean poweroff_not_canceled_after_3(gpointer user_data)
+{
+       __stktest_test_finish(pending != NULL);
+       return FALSE;
+}
+
+static gboolean end_session_and_not_canceled_after_3(gpointer user_data)
+{
+       g_at_server_send_unsolicited(emulator, "+CUSATEND");
+       g_timeout_add_seconds(3, poweroff_not_canceled_after_3, NULL);
+
+       return FALSE;
+}
+
+static void expect_response_and_not_canceled_after_3(const unsigned char *pdu,
+                                                       unsigned int len)
+{
+       struct test *test = cur_test->data;
+
+       STKTEST_RESPONSE_ASSERT(test->rsp_pdu, test->rsp_len, pdu, len);
+
+       g_idle_add(end_session_and_not_canceled_after_3, NULL);
+}
+
+static gboolean poweroff_and_canceled_after_21(gpointer user_data)
+{
+       __stktest_test_finish(pending == NULL);
+       return FALSE;
+}
+
+static gboolean end_session_and_canceled_after_21(gpointer user_data)
+{
+       g_at_server_send_unsolicited(emulator, "+CUSATEND");
+       g_timeout_add_seconds(21, poweroff_and_canceled_after_21, NULL);
+
+       return FALSE;
+}
+
+static void expect_response_and_canceled_after_21(const unsigned char *pdu,
+                                                       unsigned int len)
+{
+       struct test *test = cur_test->data;
+
+       STKTEST_RESPONSE_ASSERT(test->rsp_pdu, test->rsp_len, pdu, len);
+
+       g_idle_add(end_session_and_canceled_after_21, NULL);
+}
+
+static DBusMessage *test_display_text_11(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Toolkit Test 1"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_12(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Toolkit Test 1"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return stktest_error_busy(msg);
+}
+
+static DBusMessage *test_display_text_13(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Toolkit Test 2"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == TRUE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_14(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Toolkit Test 3"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_15(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Toolkit Test 4"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return NULL;
+}
+
+static DBusMessage *test_display_text_16(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "This command instructs the ME"
+                                               " to display a text message. "
+                                               "It allows the SIM to define "
+                                               "the priority of that message, "
+                                               "and the text string format. "
+                                               "Two types of prio"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_17(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       /* oFono gives rich text formatting in HTML */
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "&lt;GO-BACKWARDS&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return stktest_error_go_back(msg);
+}
+
+static DBusMessage *test_display_text_18(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       /* oFono gives rich text formatting in HTML */
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "&lt;ABORT&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return stktest_error_end_session(msg);
+}
+
+static DBusMessage *test_display_text_21(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "&lt;TIME-OUT&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return NULL;
+}
+
+static DBusMessage *test_display_text_31(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       static const char *expected = "This command instructs the ME to display"
+                                       " a text message, and/or an icon "
+                                       "(see 6.5.4). It allows the "
+                                       "SIM to define the priority of that "
+                                       "message, and the text string format. "
+                                       "Two types of priority are defined:- "
+                                       "display normal priority text and/";
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expected));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_41(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Toolkit Test 1"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return NULL;
+}
+
+static DBusMessage *test_display_text_42(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Toolkit Test 2"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return NULL;
+}
+
+static gboolean user_response(gpointer user_data)
+{
+       if (pending == NULL) {
+               __stktest_test_finish(FALSE);
+               return FALSE;
+       }
+
+       g_dbus_send_reply(conn, pending, DBUS_TYPE_INVALID);
+       dbus_message_unref(pending);
+       pending = NULL;
+
+       __stktest_test_finish(TRUE);
+
+       return FALSE;
+}
+
+static DBusMessage *test_display_text_43(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Toolkit Test 3"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       g_timeout_add_seconds(3, user_response, NULL);
+       return NULL;
+}
+
+static DBusMessage *test_display_text_51(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Basic Icon"));
+       STKTEST_AGENT_ASSERT(icon_id == 1);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_52(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Colour Icon"));
+       STKTEST_AGENT_ASSERT(icon_id == 2);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_53(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Basic Icon"));
+       STKTEST_AGENT_ASSERT(icon_id == 1);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_61(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, CYRILLIC));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_71(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "10 Second"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return NULL;
+}
+
+static DBusMessage *test_display_text_81(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
+               "</div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_82(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       const char *expect =
+               "<div style=\"text-align: center;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
+               "</div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_83(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       const char *expect =
+               "<div style=\"text-align: right;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
+               "</div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_84(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\"font-size: "
+               "big;color: #347235;background-color: #FFFF00;\">"
+               "Text Attribute 1</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_85(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\"font-size: "
+               "small;color: #347235;background-color: #FFFF00;\">"
+               "Text Attribute 1</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_86(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\"font-weight: "
+               "bold;color: #347235;background-color: #FFFF00;\">"
+               "Text Attribute 1</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_87(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\"font-style: "
+               "italic;color: #347235;background-color: #FFFF00;\">"
+               "Text Attribute 1</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_88(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\""
+               "text-decoration: underline;color: #347235;"
+               "background-color: #FFFF00;\">Text Attribute 1</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_89(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\""
+               "text-decoration: line-through;color: #347235;"
+               "background-color: #FFFF00;\">Text Attribute 1</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_810(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
+               "</div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_91(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       const char *expect = "你好";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_display_text_101(DBusMessage *msg,
+                                               const char *text,
+                                               unsigned char icon_id,
+                                               gboolean urgent)
+{
+       const char *expect = "80ル";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(urgent == FALSE);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_get_inkey_11(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter \"+\""));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_12(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "0";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter \"0\""));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_13(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;GO-BACKWARDS&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return stktest_error_go_back(msg);
+}
+
+static DBusMessage *test_get_inkey_14(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;ABORT&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return stktest_error_end_session(msg);
+}
+
+static DBusMessage *test_get_inkey_15(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "q";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter \"q\""));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_16(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "x";
+       const char *expected =
+               "Enter \"x\". This command instructs the ME to display text, "
+               "and to expect the user to enter a single character. Any "
+               "response entered by the user shall be passed t";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expected));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_21(DBusMessage *msg,
+                                       const char *text, unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "&lt;TIME-OUT&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return NULL;
+}
+
+static DBusMessage *test_get_inkey_31(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, CYRILLIC));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_32(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect = "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
+                               "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
+                               "ЗДРАВСТВУЙТЕЗДРАВСТВУЙ";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_41(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "Д";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_51a(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       dbus_bool_t ret = 1;
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter YES"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_51b(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       dbus_bool_t ret = 0;
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter NO"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_61(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;NO-ICON&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 1);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_62(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;BASIC-ICON&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 1);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_63(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;NO-ICON&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 2);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_64(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;COLOUR-ICON&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 2);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_81(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter \"+\""));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return NULL;
+}
+
+static DBusMessage *test_get_inkey_91(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Enter \"+\"</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_92(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect =
+               "<div style=\"text-align: center;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Enter \"+\"</span>"
+               "</div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_93(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect =
+               "<div style=\"text-align: right;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Enter \"+\"</span>"
+               "</div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_94(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\"font-size: "
+               "big;color: #347235;background-color: #FFFF00;\">Enter \"+\""
+               "</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_95(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\"font-size: "
+               "small;color: #347235;background-color: #FFFF00;\">"
+               "Enter \"+\"</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_96(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\"font-weight: "
+               "bold;color: #347235;background-color: #FFFF00;\">Enter \"+\""
+               "</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_97(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\"font-style: "
+               "italic;color: #347235;background-color: #FFFF00;\">"
+               "Enter \"+\"</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_98(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\""
+               "text-decoration: underline;color: #347235;"
+               "background-color: #FFFF00;\">Enter \"+\"</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_99(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\""
+               "text-decoration: line-through;color: #347235;"
+               "background-color: #FFFF00;\">Enter \"+\"</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_910(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect =
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Enter \"+\"</span></div>";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_101(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect = "你好";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_102(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect =
+               "你好你好你好你好你好你好你好你好你好你好"
+               "你好你好你好你好你好你好你好你好你好你好"
+               "你好你好你好你好你好你好你好你好你好你好"
+               "你好你好你好你好你好";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_111(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "好";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_121(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect = "ル";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_122(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+       const char *expect =
+               "ルルルルルルルルルルルルルルルルルルルル"
+               "ルルルルルルルルルルルルルルルルルルルル"
+               "ルルルルルルルルルルルルルルルルルルルル"
+               "ルルルルルルルルルル";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_inkey_131(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id)
+{
+       DBusMessage *reply;
+       const char *ret = "ル";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_11(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "12345";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter 12345"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 5);
+       STKTEST_AGENT_ASSERT(max == 5);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_12(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "67*#+";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter 67*#+"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 5);
+       STKTEST_AGENT_ASSERT(max == 5);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_13(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "AbCdE";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter AbCdE"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 5);
+       STKTEST_AGENT_ASSERT(max == 5);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_14(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "2345678";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha,
+                                       "Password 1&lt;SEND&gt;2345678"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 4);
+       STKTEST_AGENT_ASSERT(max == 8);
+       STKTEST_AGENT_ASSERT(hide_typing == TRUE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_15(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "12345678901234567890";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha,
+                                       "Enter 1..9,0..9,0(1)"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 1);
+       STKTEST_AGENT_ASSERT(max == 20);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_16(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;GO-BACKWARDS&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 0);
+       STKTEST_AGENT_ASSERT(max == 8);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       return stktest_error_go_back(msg);
+}
+
+static DBusMessage *test_get_input_17(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;ABORT&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 0);
+       STKTEST_AGENT_ASSERT(max == 8);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       return stktest_error_end_session(msg);
+}
+
+static DBusMessage *test_get_input_18(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *expect =
+       "***1111111111###***2222222222###***3333333333###***4444444444###***"
+       "5555555555###***6666666666###***7777777777###***8888888888###***9999"
+       "999999###***0000000000###";
+       const char *ret = "***1111111111###***2222222222###***"
+                               "3333333333###***4444444444###"
+                               "***5555555555###***6666666666###"
+                               "***7777777777###***8888888888###"
+                               "***9999999999###***0000000000###";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 160);
+       STKTEST_AGENT_ASSERT(max == 160);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_19(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;SEND&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 0);
+       STKTEST_AGENT_ASSERT(max == 1);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_110(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "12345";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, ""));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 1);
+       STKTEST_AGENT_ASSERT(max == 5);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_21(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;TIME-OUT&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 0);
+       STKTEST_AGENT_ASSERT(max == 10);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       return NULL;
+}
+
+static DBusMessage *test_get_input_31(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *expect = CYRILLIC;
+       const char *ret = "HELLO";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 5);
+       STKTEST_AGENT_ASSERT(max == 5);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_32(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *expect = "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
+               "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
+               "ЗДРАВСТВУЙТЕЗДРАВСТВУЙ";
+       const char *ret = "HELLO";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 5);
+       STKTEST_AGENT_ASSERT(max == 5);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_41(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = CYRILLIC;
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter Hello"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 12);
+       STKTEST_AGENT_ASSERT(max == 12);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_42(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
+                               "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
+                               "ЗДРАВСТВУЙТЕЗДРАВСТВУЙ";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter Hello"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 5);
+       STKTEST_AGENT_ASSERT(max == 255);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_51(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter 12345"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, "12345"));
+       STKTEST_AGENT_ASSERT(min == 5);
+       STKTEST_AGENT_ASSERT(max == 5);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &def_input,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_52(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *def_expect =
+       "***1111111111###***2222222222###***3333333333###***4444444444###***"
+       "5555555555###***6666666666###***7777777777###***8888888888###***9999"
+       "999999###***0000000000###";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter:"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, def_expect));
+       STKTEST_AGENT_ASSERT(min == 160);
+       STKTEST_AGENT_ASSERT(max == 160);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &def_input,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_61(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;NO-ICON&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 1);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 0);
+       STKTEST_AGENT_ASSERT(max == 10);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_62(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;BASIC-ICON&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 1);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 0);
+       STKTEST_AGENT_ASSERT(max == 10);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_63(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;NO-ICON&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 2);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 0);
+       STKTEST_AGENT_ASSERT(max == 10);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_64(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "+";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "&lt;COLOUR-ICON&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 2);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 0);
+       STKTEST_AGENT_ASSERT(max == 10);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+#define GET_INPUT_8X_TEMPLATE(seq, expect)                             \
+static DBusMessage *test_get_input_8##seq(DBusMessage *msg,            \
+                                       const char *alpha,              \
+                                       unsigned char icon_id,          \
+                                       const char *def_input,          \
+                                       unsigned char min,              \
+                                       unsigned char max,              \
+                                       gboolean hide_typing)           \
+{                                                                      \
+       DBusMessage *reply;                                             \
+       const char *ret = "12345";                                      \
+                                                                       \
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));               \
+       STKTEST_AGENT_ASSERT(icon_id == 0);                             \
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));               \
+       STKTEST_AGENT_ASSERT(min == 5);                                 \
+       STKTEST_AGENT_ASSERT(max == 5);                                 \
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);                     \
+                                                                       \
+       reply = dbus_message_new_method_return(msg);                    \
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,         \
+                                       DBUS_TYPE_INVALID);             \
+                                                                       \
+       return reply;                                                   \
+}
+
+GET_INPUT_8X_TEMPLATE(1,
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Enter 12345</span></div>")
+
+GET_INPUT_8X_TEMPLATE(2,
+               "<div style=\"text-align: center;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Enter 12345</span>"
+               "</div>")
+
+GET_INPUT_8X_TEMPLATE(3,
+               "<div style=\"text-align: right;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Enter 12345</span>"
+               "</div>")
+
+GET_INPUT_8X_TEMPLATE(4,
+               "<div style=\"text-align: left;\"><span style=\"font-size: "
+               "big;color: #347235;background-color: #FFFF00;\">Enter 12345"
+               "</span></div>")
+
+GET_INPUT_8X_TEMPLATE(5,
+               "<div style=\"text-align: left;\"><span style=\"font-size: "
+               "small;color: #347235;background-color: #FFFF00;\">Enter "
+               "12345</span></div>")
+
+GET_INPUT_8X_TEMPLATE(6,
+               "<div style=\"text-align: left;\"><span style=\"font-weight: "
+               "bold;color: #347235;background-color: #FFFF00;\">Enter "
+               "12345</span></div>")
+
+GET_INPUT_8X_TEMPLATE(7,
+               "<div style=\"text-align: left;\"><span style=\"font-style: "
+               "italic;color: #347235;background-color: #FFFF00;\">Enter "
+               "12345</span></div>")
+
+GET_INPUT_8X_TEMPLATE(8,
+               "<div style=\"text-align: left;\"><span "
+               "style=\"text-decoration: underline;color: #347235;"
+               "background-color: #FFFF00;\">Enter 12345</span></div>")
+
+GET_INPUT_8X_TEMPLATE(9,
+               "<div style=\"text-align: left;\"><span "
+               "style=\"text-decoration: line-through;color: #347235;"
+               "background-color: #FFFF00;\">Enter 12345</span></div>")
+
+GET_INPUT_8X_TEMPLATE(10,
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Enter 12345</span></div>")
+
+#define GET_INPUT_9X_11X_TEMPLATE(seq, expect)                         \
+static DBusMessage *test_get_input_##seq(DBusMessage *msg,             \
+                                       const char *alpha,              \
+                                       unsigned char icon_id,          \
+                                       const char *def_input,          \
+                                       unsigned char min,              \
+                                       unsigned char max,              \
+                                       gboolean hide_typing)           \
+{                                                                      \
+       DBusMessage *reply;                                             \
+       const char *ret = "HELLO";                                      \
+                                                                       \
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, expect));               \
+       STKTEST_AGENT_ASSERT(icon_id == 0);                             \
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));               \
+       STKTEST_AGENT_ASSERT(min == 5);                                 \
+       STKTEST_AGENT_ASSERT(max == 5);                                 \
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);                     \
+                                                                       \
+       reply = dbus_message_new_method_return(msg);                    \
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,         \
+                                       DBUS_TYPE_INVALID);             \
+                                                                       \
+       return reply;                                                   \
+}
+
+GET_INPUT_9X_11X_TEMPLATE(91, "你好")
+GET_INPUT_9X_11X_TEMPLATE(92, "你好你好你好你好你好你好你好你好你好你好"
+                               "你好你好你好你好你好你好你好你好你好你好"
+                               "你好你好你好你好你好你好你好你好你好你好"
+                               "你好你好你好你好你好")
+
+static DBusMessage *test_get_input_101(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "你好";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter Hello"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 2);
+       STKTEST_AGENT_ASSERT(max == 2);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_102(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "你好你好你好你好你好你好"
+                               "你好你好你好你好你好你好"
+                               "你好你好你好你好你好你好"
+                               "你好你好你好你好你好你好"
+                               "你好你好你好你好你好你好"
+                               "你好你好你好你好你好";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter Hello"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 5);
+       STKTEST_AGENT_ASSERT(max == 255);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+GET_INPUT_9X_11X_TEMPLATE(111,"ル")
+GET_INPUT_9X_11X_TEMPLATE(112, "ルルルルルルルルルルルルルルルルルルルル"
+                               "ルルルルルルルルルルルルルルルルルルルル"
+                               "ルルルルルルルルルルルルルルルルルルルル"
+                               "ルルルルルルルルルル")
+
+static DBusMessage *test_get_input_121(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "ルル";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter Hello"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 2);
+       STKTEST_AGENT_ASSERT(max == 2);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_get_input_122(DBusMessage *msg,
+                                       const char *alpha,
+                                       unsigned char icon_id,
+                                       const char *def_input,
+                                       unsigned char min, unsigned char max,
+                                       gboolean hide_typing)
+{
+       DBusMessage *reply;
+       const char *ret = "ルルルルルルルルルルルルルルルルルルルル"
+                               "ルルルルルルルルルルルルルルルルルルルル"
+                               "ルルルルルルルルルルルルルルルルルルルル"
+                               "ルルルルルルルルルル";
+
+       STKTEST_AGENT_ASSERT(g_str_equal(alpha, "Enter Hello"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+       STKTEST_AGENT_ASSERT(g_str_equal(def_input, ""));
+       STKTEST_AGENT_ASSERT(min == 5);
+       STKTEST_AGENT_ASSERT(max == 255);
+       STKTEST_AGENT_ASSERT(hide_typing == FALSE);
+
+       reply = dbus_message_new_method_return(msg);
+       dbus_message_append_args(reply, DBUS_TYPE_STRING, &ret,
+                                       DBUS_TYPE_INVALID);
+
+       return reply;
+}
+
+static DBusMessage *test_play_tone_11a(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "dial-tone"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Dial Tone"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return NULL;
+}
+
+static DBusMessage *test_play_tone_11b(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "busy"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Sub. Busy"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return NULL;
+}
+
+static DBusMessage *test_play_tone_11c(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "congestion"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Congestion"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return NULL;
+}
+
+static DBusMessage *test_play_tone_11d(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "radio-path-acknowledge"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "RP Ack"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_play_tone_11e(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "radio-path-not-available"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "No RP"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return NULL;
+}
+
+static DBusMessage *test_play_tone_11f(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "error"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Spec Info"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return NULL;
+}
+
+static DBusMessage *test_play_tone_11g(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "call-waiting"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Call Wait"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return NULL;
+}
+
+static DBusMessage *test_play_tone_11h(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "ringing-tone"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Ring Tone"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return NULL;
+}
+
+static DBusMessage *test_play_tone_11i(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       const char *expect_text =
+                       "This command instructs the ME to play an audio tone. "
+                       "Upon receiving this command, the ME shall check "
+                       "if it is currently in, or in the process of setting "
+                       "up (SET-UP message sent to the network, see "
+                       "GSM\"04.08\"(8)), a speech call. - If the ME I";
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "general-beep"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect_text));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_play_tone_11j(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "general-beep"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Beep"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_play_tone_11k(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "positive-acknowledgement"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Positive"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_play_tone_11l(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "negative-acknowledgement"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Negative"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_play_tone_11m(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "general-beep"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "Quick"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_play_tone_11n(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "error"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "&lt;ABORT&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return stktest_error_end_session(msg);
+}
+
+static DBusMessage *test_play_tone_11o(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "general-beep"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, ""));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_play_tone_21(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "positive-acknowledgement"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, CYRILLIC));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_play_tone_31(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "positive-acknowledgement"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "&lt;BASIC-ICON&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 1);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_play_tone_32(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "positive-acknowledgement"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "&lt;BASIC-ICON&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 1);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_play_tone_33(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "positive-acknowledgement"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "&lt;COLOUR-ICON&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 2);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_play_tone_34(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "positive-acknowledgement"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "&lt;COLOUR-ICON&gt;"));
+       STKTEST_AGENT_ASSERT(icon_id == 2);
+
+       return dbus_message_new_method_return(msg);
+}
+
+#define PLAY_TONE_4X_TEMPLATE(seq, expect)                             \
+static DBusMessage *test_play_tone_4##seq(DBusMessage *msg,            \
+                                       const char *tone,               \
+                                       const char *text,               \
+                                       unsigned char icon_id)          \
+{                                                                      \
+       g_print("%s\n", text);                                          \
+       STKTEST_AGENT_ASSERT(g_str_equal(tone,                          \
+                                       "positive-acknowledgement"));   \
+       STKTEST_AGENT_ASSERT(g_str_equal(text, expect));                \
+       STKTEST_AGENT_ASSERT(icon_id == 0);                             \
+                                                                       \
+       return dbus_message_new_method_return(msg);                     \
+}                                                                      \
+
+PLAY_TONE_4X_TEMPLATE(1a,
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
+               "</div>")
+PLAY_TONE_4X_TEMPLATE(1b, "Text Attribute 2")
+
+PLAY_TONE_4X_TEMPLATE(2a,
+               "<div style=\"text-align: center;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
+               "</div>")
+PLAY_TONE_4X_TEMPLATE(2b, "Text Attribute 2")
+
+PLAY_TONE_4X_TEMPLATE(3a,
+               "<div style=\"text-align: right;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
+               "</div>")
+PLAY_TONE_4X_TEMPLATE(3b, "Text Attribute 2")
+
+PLAY_TONE_4X_TEMPLATE(4a,
+               "<div style=\"text-align: left;\"><span style=\"font-size: "
+               "big;color: #347235;background-color: #FFFF00;\">"
+               "Text Attribute 1</span></div>")
+PLAY_TONE_4X_TEMPLATE(4b,
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 2</span>"
+               "</div>")
+PLAY_TONE_4X_TEMPLATE(4c, "Text Attribute 3")
+
+PLAY_TONE_4X_TEMPLATE(5a,
+               "<div style=\"text-align: left;\"><span style=\"font-size: "
+               "small;color: #347235;background-color: #FFFF00;\">"
+               "Text Attribute 1</span></div>")
+PLAY_TONE_4X_TEMPLATE(5b,
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 2</span>"
+               "</div>")
+PLAY_TONE_4X_TEMPLATE(5c, "Text Attribute 3")
+
+PLAY_TONE_4X_TEMPLATE(6a,
+               "<div style=\"text-align: left;\"><span style=\"font-weight: "
+               "bold;color: #347235;background-color: #FFFF00;\">"
+               "Text Attribute</span></div> 1")
+PLAY_TONE_4X_TEMPLATE(6b,
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 2</span>"
+               "</div>")
+PLAY_TONE_4X_TEMPLATE(6c, "Text Attribute 3")
+
+PLAY_TONE_4X_TEMPLATE(7a,
+               "<div style=\"text-align: left;\"><span style=\"font-style: "
+               "italic;color: #347235;background-color: #FFFF00;\">"
+               "Text Attribute</span></div> 1")
+PLAY_TONE_4X_TEMPLATE(7b,
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 2</span>"
+               "</div>")
+PLAY_TONE_4X_TEMPLATE(7c, "Text Attribute 3")
+
+PLAY_TONE_4X_TEMPLATE(8a,
+               "<div style=\"text-align: left;\"><span "
+               "style=\"text-decoration: underline;color: #347235;"
+               "background-color: #FFFF00;\">Text Attribute 1</span></div>")
+PLAY_TONE_4X_TEMPLATE(8b,
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 2</span>"
+               "</div>")
+PLAY_TONE_4X_TEMPLATE(8c, "Text Attribute 3")
+
+PLAY_TONE_4X_TEMPLATE(9a,
+               "<div style=\"text-align: left;\"><span "
+               "style=\"text-decoration: line-through;color: #347235;"
+               "background-color: #FFFF00;\">Text Attribute 1</span></div>")
+PLAY_TONE_4X_TEMPLATE(9b,
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 2</span>"
+               "</div>")
+PLAY_TONE_4X_TEMPLATE(9c, "Text Attribute 3")
+
+PLAY_TONE_4X_TEMPLATE(10a,
+               "<div style=\"text-align: left;\"><span style=\"color: "
+               "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
+               "</div>")
+PLAY_TONE_4X_TEMPLATE(10b, "Text Attribute 2")
+
+static DBusMessage *test_play_tone_51(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "positive-acknowledgement"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "中一"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *test_play_tone_61a(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "dial-tone"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "80ル0"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return NULL;
+}
+
+static DBusMessage *test_play_tone_61b(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "dial-tone"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "81ル1"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return NULL;
+}
+static DBusMessage *test_play_tone_61c(DBusMessage *msg,
+                                       const char *tone,
+                                       const char *text,
+                                       unsigned char icon_id)
+{
+       STKTEST_AGENT_ASSERT(g_str_equal(tone, "dial-tone"));
+       STKTEST_AGENT_ASSERT(g_str_equal(text, "82ル2"));
+       STKTEST_AGENT_ASSERT(icon_id == 0);
+
+       return NULL;
+}
+
+static void power_down_reply(DBusPendingCall *call, void *user_data)
+{
+       __stktest_test_next();
+}
+
+static void __stktest_test_finish(gboolean successful)
+{
+       struct test *test = cur_test->data;
+       dbus_bool_t powered = FALSE;
+
+       test->result = successful ? TEST_RESULT_PASSED : TEST_RESULT_FAILED;
+
+       state = TEST_STATE_POWERING_DOWN;
+       set_property(STKTEST_PATH, OFONO_MODEM_INTERFACE, "Powered",
+                       DBUS_TYPE_BOOLEAN, &powered,
+                       power_down_reply, NULL, NULL);
+}
+
+static void __stktest_test_next()
+{
+       if (cur_test == NULL)
+               cur_test = tests;
+       else
+               cur_test = cur_test->next;
+
+       if (cur_test == NULL) {
+               g_main_loop_quit(main_loop);
+               return;
+       }
+
+       powerup();
+}
+
+static void stktest_add_test(const char *name, const char *method,
+                               const unsigned char *req, unsigned int req_len,
+                               const unsigned char *rsp, unsigned int rsp_len,
+                               void *agent_func,
+                               terminal_response_func tr_func)
+{
+       struct test *test = g_new0(struct test, 1);
+
+       test->name = g_strdup(name);
+       test->method = g_strdup(method);
+       test->req_pdu = g_memdup(req, req_len);
+       test->req_len = req_len;
+       test->rsp_pdu = g_memdup(rsp, rsp_len);
+       test->rsp_len = rsp_len;
+       test->agent_func = agent_func;
+       test->tr_func = tr_func;
+
+       tests = g_list_append(tests, test);
+}
+
+static void stktest_add_timed_test(const char *name, const char *method,
+                                       const unsigned char *req,
+                                       unsigned int req_len,
+                                       const unsigned char *rsp,
+                                       unsigned int rsp_len,
+                                       void *agent_func,
+                                       terminal_response_func tr_func,
+                                       gdouble expected_min_time,
+                                       gdouble expected_max_time)
+{
+       GList *last;
+       struct test *test;
+
+       stktest_add_test(name, method, req, req_len, rsp, rsp_len, agent_func,
+                               tr_func);
+
+       last = g_list_last(tests);
+       test = last->data;
+
+       test->min_time = expected_min_time;
+       test->max_time = expected_max_time;
+}
+
+static void __stktest_test_init(void)
+{
+       stktest_add_test("Display Text 1.1", "DisplayText",
+                               display_text_111, sizeof(display_text_111),
+                               display_text_response_111,
+                               sizeof(display_text_response_111),
+                               test_display_text_11,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 1.2", "DisplayText",
+                               display_text_111, sizeof(display_text_111),
+                               display_text_response_121,
+                               sizeof(display_text_response_121),
+                               test_display_text_12,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 1.3", "DisplayText",
+                               display_text_131, sizeof(display_text_131),
+                               display_text_response_131,
+                               sizeof(display_text_response_131),
+                               test_display_text_13,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 1.4", "DisplayText",
+                               display_text_141, sizeof(display_text_141),
+                               display_text_response_141,
+                               sizeof(display_text_response_141),
+                               test_display_text_14,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 1.5", "DisplayText",
+                               display_text_151, sizeof(display_text_151),
+                               display_text_response_151,
+                               sizeof(display_text_response_151),
+                               test_display_text_15,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 1.6", "DisplayText",
+                               display_text_161, sizeof(display_text_161),
+                               display_text_response_161,
+                               sizeof(display_text_response_161),
+                               test_display_text_16,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 1.7", "DisplayText",
+                               display_text_171, sizeof(display_text_171),
+                               display_text_response_171,
+                               sizeof(display_text_response_171),
+                               test_display_text_17,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 1.8", "DisplayText",
+                               display_text_181, sizeof(display_text_181),
+                               display_text_response_181,
+                               sizeof(display_text_response_181),
+                               test_display_text_18,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 1.9", "DisplayText",
+                               display_text_191, sizeof(display_text_191),
+                               display_text_response_191,
+                               sizeof(display_text_response_191),
+                               NULL, expect_response_and_finish);
+       stktest_add_test("Display Text 2.1", "DisplayText",
+                               display_text_211, sizeof(display_text_211),
+                               display_text_response_211,
+                               sizeof(display_text_response_211),
+                               test_display_text_21,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 3.1", "DisplayText",
+                               display_text_311, sizeof(display_text_311),
+                               display_text_response_311,
+                               sizeof(display_text_response_311),
+                               test_display_text_31,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 4.1", "DisplayText",
+                               display_text_411, sizeof(display_text_411),
+                               display_text_response_411,
+                               sizeof(display_text_response_411),
+                               test_display_text_41,
+                               expect_response_and_not_canceled_after_3);
+       stktest_add_test("Display Text 4.2", "DisplayText",
+                               display_text_421, sizeof(display_text_421),
+                               display_text_response_421,
+                               sizeof(display_text_response_421),
+                               test_display_text_42,
+                               expect_response_and_canceled_after_21);
+       stktest_add_test("Display Text 4.3", "DisplayText",
+                               display_text_431, sizeof(display_text_431),
+                               display_text_response_431,
+                               sizeof(display_text_response_431),
+                               test_display_text_43, expect_response);
+       stktest_add_test("Display Text 5.1A", "DisplayText",
+                               display_text_511, sizeof(display_text_511),
+                               display_text_response_511a,
+                               sizeof(display_text_response_511a),
+                               test_display_text_51,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 5.2A", "DisplayText",
+                               display_text_521, sizeof(display_text_521),
+                               display_text_response_521a,
+                               sizeof(display_text_response_521a),
+                               test_display_text_52,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 5.3A", "DisplayText",
+                               display_text_531, sizeof(display_text_531),
+                               display_text_response_531a,
+                               sizeof(display_text_response_531a),
+                               test_display_text_53,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 6.1", "DisplayText",
+                               display_text_611, sizeof(display_text_611),
+                               display_text_response_611,
+                               sizeof(display_text_response_611),
+                               test_display_text_61,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 7.1", "DisplayText",
+                               display_text_711, sizeof(display_text_711),
+                               display_text_response_711,
+                               sizeof(display_text_response_711),
+                               test_display_text_71,
+                               expect_response_and_finish);
+       /*
+        * We skip parts where the UI is asked to display simple text to ensure
+        * that the alignment, font is set up correctly and not 'remembered'
+        * from a previous state.  oFono does not keep any state of the
+        * previous commands
+        */
+       stktest_add_test("Display Text 8.1", "DisplayText",
+                               display_text_811, sizeof(display_text_811),
+                               display_text_response_811,
+                               sizeof(display_text_response_811),
+                               test_display_text_81,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 8.2", "DisplayText",
+                               display_text_821, sizeof(display_text_821),
+                               display_text_response_821,
+                               sizeof(display_text_response_821),
+                               test_display_text_82,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 8.3", "DisplayText",
+                               display_text_831, sizeof(display_text_831),
+                               display_text_response_831,
+                               sizeof(display_text_response_831),
+                               test_display_text_83,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 8.4", "DisplayText",
+                               display_text_841, sizeof(display_text_841),
+                               display_text_response_841,
+                               sizeof(display_text_response_841),
+                               test_display_text_84,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 8.5", "DisplayText",
+                               display_text_851, sizeof(display_text_851),
+                               display_text_response_851,
+                               sizeof(display_text_response_851),
+                               test_display_text_85,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 8.6", "DisplayText",
+                               display_text_861, sizeof(display_text_861),
+                               display_text_response_861,
+                               sizeof(display_text_response_861),
+                               test_display_text_86,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 8.7", "DisplayText",
+                               display_text_871, sizeof(display_text_871),
+                               display_text_response_871,
+                               sizeof(display_text_response_871),
+                               test_display_text_87,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 8.8", "DisplayText",
+                               display_text_881, sizeof(display_text_881),
+                               display_text_response_881,
+                               sizeof(display_text_response_881),
+                               test_display_text_88,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 8.9", "DisplayText",
+                               display_text_891, sizeof(display_text_891),
+                               display_text_response_891,
+                               sizeof(display_text_response_891),
+                               test_display_text_89,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 8.10", "DisplayText",
+                               display_text_8101, sizeof(display_text_8101),
+                               display_text_response_8101,
+                               sizeof(display_text_response_8101),
+                               test_display_text_810,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 9.1", "DisplayText",
+                               display_text_911, sizeof(display_text_911),
+                               display_text_response_911,
+                               sizeof(display_text_response_911),
+                               test_display_text_91,
+                               expect_response_and_finish);
+       stktest_add_test("Display Text 10.1", "DisplayText",
+                               display_text_1011, sizeof(display_text_1011),
+                               display_text_response_1011,
+                               sizeof(display_text_response_1011),
+                               test_display_text_101,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 1.1", "RequestDigit",
+                               get_inkey_111, sizeof(get_inkey_111),
+                               get_inkey_response_111,
+                               sizeof(get_inkey_response_111),
+                               test_get_inkey_11,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 1.2", "RequestDigit",
+                               get_inkey_121, sizeof(get_inkey_121),
+                               get_inkey_response_121,
+                               sizeof(get_inkey_response_121),
+                               test_get_inkey_12,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 1.3", "RequestDigit",
+                               get_inkey_131, sizeof(get_inkey_131),
+                               get_inkey_response_131,
+                               sizeof(get_inkey_response_131),
+                               test_get_inkey_13,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 1.4", "RequestDigit",
+                               get_inkey_141, sizeof(get_inkey_141),
+                               get_inkey_response_141,
+                               sizeof(get_inkey_response_141),
+                               test_get_inkey_14,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 1.5", "RequestKey",
+                               get_inkey_151, sizeof(get_inkey_151),
+                               get_inkey_response_151,
+                               sizeof(get_inkey_response_151),
+                               test_get_inkey_15,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 1.6", "RequestKey",
+                               get_inkey_161, sizeof(get_inkey_161),
+                               get_inkey_response_161,
+                               sizeof(get_inkey_response_161),
+                               test_get_inkey_16,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 2.1", "RequestDigit",
+                               get_inkey_211, sizeof(get_inkey_211),
+                               get_inkey_response_211,
+                               sizeof(get_inkey_response_211),
+                               test_get_inkey_21,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 3.1", "RequestDigit",
+                               get_inkey_311, sizeof(get_inkey_311),
+                               get_inkey_response_311,
+                               sizeof(get_inkey_response_311),
+                               test_get_inkey_31,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 3.2", "RequestDigit",
+                               get_inkey_321, sizeof(get_inkey_321),
+                               get_inkey_response_321,
+                               sizeof(get_inkey_response_321),
+                               test_get_inkey_32,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 4.1", "RequestKey",
+                               get_inkey_411, sizeof(get_inkey_411),
+                               get_inkey_response_411,
+                               sizeof(get_inkey_response_411),
+                               test_get_inkey_41,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 5.1a", "RequestConfirmation",
+                               get_inkey_511, sizeof(get_inkey_511),
+                               get_inkey_response_511,
+                               sizeof(get_inkey_response_511),
+                               test_get_inkey_51a,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 5.1b", "RequestConfirmation",
+                               get_inkey_512, sizeof(get_inkey_512),
+                               get_inkey_response_512,
+                               sizeof(get_inkey_response_512),
+                               test_get_inkey_51b,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 6.1", "RequestDigit",
+                               get_inkey_611, sizeof(get_inkey_611),
+                               get_inkey_response_611,
+                               sizeof(get_inkey_response_611),
+                               test_get_inkey_61,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 6.2", "RequestDigit",
+                               get_inkey_621, sizeof(get_inkey_621),
+                               get_inkey_response_621,
+                               sizeof(get_inkey_response_621),
+                               test_get_inkey_62,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 6.3", "RequestDigit",
+                               get_inkey_631, sizeof(get_inkey_631),
+                               get_inkey_response_631,
+                               sizeof(get_inkey_response_631),
+                               test_get_inkey_63,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 6.4", "RequestDigit",
+                               get_inkey_641, sizeof(get_inkey_641),
+                               get_inkey_response_641,
+                               sizeof(get_inkey_response_641),
+                               test_get_inkey_64,
+                               expect_response_and_finish);
+       /* Test Sequence for GetInkey 7.1 skipped, we do not support help */
+       stktest_add_test("Get Inkey 8.1", "RequestDigit",
+                               get_inkey_811, sizeof(get_inkey_811),
+                               get_inkey_response_811,
+                               sizeof(get_inkey_response_811),
+                               test_get_inkey_81,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 9.1", "RequestDigit",
+                               get_inkey_911, sizeof(get_inkey_911),
+                               get_inkey_response_911,
+                               sizeof(get_inkey_response_911),
+                               test_get_inkey_91,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 9.2", "RequestDigit",
+                               get_inkey_921, sizeof(get_inkey_921),
+                               get_inkey_response_921,
+                               sizeof(get_inkey_response_921),
+                               test_get_inkey_92,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 9.3", "RequestDigit",
+                               get_inkey_931, sizeof(get_inkey_931),
+                               get_inkey_response_931,
+                               sizeof(get_inkey_response_931),
+                               test_get_inkey_93,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 9.4", "RequestDigit",
+                               get_inkey_941, sizeof(get_inkey_941),
+                               get_inkey_response_941,
+                               sizeof(get_inkey_response_941),
+                               test_get_inkey_94,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 9.5", "RequestDigit",
+                               get_inkey_951, sizeof(get_inkey_951),
+                               get_inkey_response_951,
+                               sizeof(get_inkey_response_951),
+                               test_get_inkey_95,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 9.6", "RequestDigit",
+                               get_inkey_961, sizeof(get_inkey_961),
+                               get_inkey_response_961,
+                               sizeof(get_inkey_response_961),
+                               test_get_inkey_96,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 9.7", "RequestDigit",
+                               get_inkey_971, sizeof(get_inkey_971),
+                               get_inkey_response_971,
+                               sizeof(get_inkey_response_971),
+                               test_get_inkey_97,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 9.8", "RequestDigit",
+                               get_inkey_981, sizeof(get_inkey_981),
+                               get_inkey_response_981,
+                               sizeof(get_inkey_response_981),
+                               test_get_inkey_98,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 9.9", "RequestDigit",
+                               get_inkey_991, sizeof(get_inkey_991),
+                               get_inkey_response_991,
+                               sizeof(get_inkey_response_991),
+                               test_get_inkey_99,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 9.10", "RequestDigit",
+                               get_inkey_9101, sizeof(get_inkey_9101),
+                               get_inkey_response_9101,
+                               sizeof(get_inkey_response_9101),
+                               test_get_inkey_910,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 10.1", "RequestDigit",
+                               get_inkey_1011, sizeof(get_inkey_1011),
+                               get_inkey_response_1011,
+                               sizeof(get_inkey_response_1011),
+                               test_get_inkey_101,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 10.2", "RequestDigit",
+                               get_inkey_1021, sizeof(get_inkey_1021),
+                               get_inkey_response_1021,
+                               sizeof(get_inkey_response_1021),
+                               test_get_inkey_102,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 11.1", "RequestKey",
+                               get_inkey_1111, sizeof(get_inkey_1111),
+                               get_inkey_response_1111,
+                               sizeof(get_inkey_response_1111),
+                               test_get_inkey_111,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 12.1", "RequestDigit",
+                               get_inkey_1211, sizeof(get_inkey_1211),
+                               get_inkey_response_1211,
+                               sizeof(get_inkey_response_1211),
+                               test_get_inkey_121,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 12.2", "RequestDigit",
+                               get_inkey_1221, sizeof(get_inkey_1221),
+                               get_inkey_response_1221,
+                               sizeof(get_inkey_response_1221),
+                               test_get_inkey_122,
+                               expect_response_and_finish);
+       stktest_add_test("Get Inkey 13.1", "RequestKey",
+                               get_inkey_1311, sizeof(get_inkey_1311),
+                               get_inkey_response_1311,
+                               sizeof(get_inkey_response_1311),
+                               test_get_inkey_131,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 1.1", "RequestDigits",
+                               get_input_111, sizeof(get_input_111),
+                               get_input_response_111,
+                               sizeof(get_input_response_111),
+                               test_get_input_11,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 1.2", "RequestDigits",
+                               get_input_121, sizeof(get_input_121),
+                               get_input_response_121,
+                               sizeof(get_input_response_121),
+                               test_get_input_12,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 1.3", "RequestInput",
+                               get_input_131, sizeof(get_input_131),
+                               get_input_response_131,
+                               sizeof(get_input_response_131),
+                               test_get_input_13,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 1.4", "RequestDigits",
+                               get_input_141, sizeof(get_input_141),
+                               get_input_response_141,
+                               sizeof(get_input_response_141),
+                               test_get_input_14,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 1.5", "RequestDigits",
+                               get_input_151, sizeof(get_input_151),
+                               get_input_response_151,
+                               sizeof(get_input_response_151),
+                               test_get_input_15,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 1.6", "RequestDigits",
+                               get_input_161, sizeof(get_input_161),
+                               get_input_response_161,
+                               sizeof(get_input_response_161),
+                               test_get_input_16,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 1.7", "RequestDigits",
+                               get_input_171, sizeof(get_input_171),
+                               get_input_response_171,
+                               sizeof(get_input_response_171),
+                               test_get_input_17,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 1.8", "RequestDigits",
+                               get_input_181, sizeof(get_input_181),
+                               get_input_response_181,
+                               sizeof(get_input_response_181),
+                               test_get_input_18,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 1.9", "RequestDigits",
+                               get_input_191, sizeof(get_input_191),
+                               get_input_response_191a,
+                               sizeof(get_input_response_191a),
+                               test_get_input_19,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 1.10", "RequestDigits",
+                               get_input_1101, sizeof(get_input_1101),
+                               get_input_response_1101,
+                               sizeof(get_input_response_1101),
+                               test_get_input_110,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 2.1", "RequestDigits",
+                               get_input_211, sizeof(get_input_211),
+                               get_input_response_211,
+                               sizeof(get_input_response_211),
+                               test_get_input_21,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 3.1", "RequestInput",
+                               get_input_311, sizeof(get_input_311),
+                               get_input_response_311,
+                               sizeof(get_input_response_311),
+                               test_get_input_31,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 3.2", "RequestInput",
+                               get_input_321, sizeof(get_input_321),
+                               get_input_response_321,
+                               sizeof(get_input_response_321),
+                               test_get_input_32,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 4.1", "RequestInput",
+                               get_input_411, sizeof(get_input_411),
+                               get_input_response_411,
+                               sizeof(get_input_response_411),
+                               test_get_input_41,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 4.2", "RequestInput",
+                               get_input_421, sizeof(get_input_421),
+                               get_input_response_421,
+                               sizeof(get_input_response_421),
+                               test_get_input_42,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 5.1", "RequestDigits",
+                               get_input_511, sizeof(get_input_511),
+                               get_input_response_511,
+                               sizeof(get_input_response_511),
+                               test_get_input_51,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 5.2", "RequestDigits",
+                               get_input_521, sizeof(get_input_521),
+                               get_input_response_521,
+                               sizeof(get_input_response_521),
+                               test_get_input_52,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 6.1", "RequestDigits",
+                               get_input_611, sizeof(get_input_611),
+                               get_input_response_611a,
+                               sizeof(get_input_response_611a),
+                               test_get_input_61,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 6.2", "RequestDigits",
+                               get_input_621, sizeof(get_input_621),
+                               get_input_response_621a,
+                               sizeof(get_input_response_621a),
+                               test_get_input_62,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 6.3", "RequestDigits",
+                               get_input_631, sizeof(get_input_631),
+                               get_input_response_631a,
+                               sizeof(get_input_response_631a),
+                               test_get_input_63,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 6.4", "RequestDigits",
+                               get_input_641, sizeof(get_input_641),
+                               get_input_response_641a,
+                               sizeof(get_input_response_641a),
+                               test_get_input_64,
+                               expect_response_and_finish);
+       /* GetInput 7.1 skipped, Help not supported */
+       stktest_add_test("Get Input 8.1", "RequestDigits",
+                               get_input_811, sizeof(get_input_811),
+                               get_input_response_811,
+                               sizeof(get_input_response_811),
+                               test_get_input_81,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 8.2", "RequestDigits",
+                               get_input_821, sizeof(get_input_821),
+                               get_input_response_821,
+                               sizeof(get_input_response_821),
+                               test_get_input_82,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 8.3", "RequestDigits",
+                               get_input_831, sizeof(get_input_831),
+                               get_input_response_831,
+                               sizeof(get_input_response_831),
+                               test_get_input_83,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 8.4", "RequestDigits",
+                               get_input_841, sizeof(get_input_841),
+                               get_input_response_841,
+                               sizeof(get_input_response_841),
+                               test_get_input_84,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 8.5", "RequestDigits",
+                               get_input_851, sizeof(get_input_851),
+                               get_input_response_851,
+                               sizeof(get_input_response_851),
+                               test_get_input_85,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 8.6", "RequestDigits",
+                               get_input_861, sizeof(get_input_861),
+                               get_input_response_861,
+                               sizeof(get_input_response_861),
+                               test_get_input_86,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 8.7", "RequestDigits",
+                               get_input_871, sizeof(get_input_871),
+                               get_input_response_871,
+                               sizeof(get_input_response_871),
+                               test_get_input_87,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 8.8", "RequestDigits",
+                               get_input_881, sizeof(get_input_881),
+                               get_input_response_881,
+                               sizeof(get_input_response_881),
+                               test_get_input_88,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 8.9", "RequestDigits",
+                               get_input_891, sizeof(get_input_891),
+                               get_input_response_891,
+                               sizeof(get_input_response_891),
+                               test_get_input_89,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 8.10", "RequestDigits",
+                               get_input_8101, sizeof(get_input_8101),
+                               get_input_response_8101,
+                               sizeof(get_input_response_8101),
+                               test_get_input_810,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 9.1", "RequestInput",
+                               get_input_911, sizeof(get_input_911),
+                               get_input_response_911,
+                               sizeof(get_input_response_911),
+                               test_get_input_91,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 9.2", "RequestInput",
+                               get_input_921, sizeof(get_input_921),
+                               get_input_response_921,
+                               sizeof(get_input_response_921),
+                               test_get_input_92,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 10.1", "RequestInput",
+                               get_input_1011, sizeof(get_input_1011),
+                               get_input_response_1011,
+                               sizeof(get_input_response_1011),
+                               test_get_input_101,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 10.2", "RequestInput",
+                               get_input_1021, sizeof(get_input_1021),
+                               get_input_response_1021,
+                               sizeof(get_input_response_1021),
+                               test_get_input_102,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 11.1", "RequestInput",
+                               get_input_1111, sizeof(get_input_1111),
+                               get_input_response_1111,
+                               sizeof(get_input_response_1111),
+                               test_get_input_111,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 11.2", "RequestInput",
+                               get_input_1121, sizeof(get_input_1121),
+                               get_input_response_1121,
+                               sizeof(get_input_response_1121),
+                               test_get_input_112,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 12.1", "RequestInput",
+                               get_input_1211, sizeof(get_input_1211),
+                               get_input_response_1211,
+                               sizeof(get_input_response_1211),
+                               test_get_input_121,
+                               expect_response_and_finish);
+       stktest_add_test("Get Input 12.2", "RequestInput",
+                               get_input_1221, sizeof(get_input_1221),
+                               get_input_response_1221,
+                               sizeof(get_input_response_1221),
+                               test_get_input_122,
+                               expect_response_and_finish);
+       stktest_add_test("More Time 1.1", NULL,
+                               more_time_111, sizeof(more_time_111),
+                               more_time_response_111,
+                               sizeof(more_time_response_111),
+                               NULL, expect_response_and_finish);
+       stktest_add_timed_test("Play Tone 1.1a", "LoopTone",
+                               play_tone_111, sizeof(play_tone_111),
+                               play_tone_response_111,
+                               sizeof(play_tone_response_111),
+                               test_play_tone_11a,
+                               expect_response_and_finish,
+                               5.0, 6.0);
+       stktest_add_timed_test("Play Tone 1.1b", "LoopTone",
+                               play_tone_112, sizeof(play_tone_112),
+                               play_tone_response_112,
+                               sizeof(play_tone_response_112),
+                               test_play_tone_11b,
+                               expect_response_and_finish,
+                               5.0, 6.0);
+       stktest_add_timed_test("Play Tone 1.1c", "LoopTone",
+                               play_tone_113, sizeof(play_tone_113),
+                               play_tone_response_113,
+                               sizeof(play_tone_response_113),
+                               test_play_tone_11c,
+                               expect_response_and_finish,
+                               5.0, 6.0);
+       stktest_add_test("Play Tone 1.1d", "PlayTone",
+                               play_tone_114, sizeof(play_tone_114),
+                               play_tone_response_114,
+                               sizeof(play_tone_response_114),
+                               test_play_tone_11d,
+                               expect_response_and_finish);
+       stktest_add_timed_test("Play Tone 1.1e", "LoopTone",
+                               play_tone_115, sizeof(play_tone_115),
+                               play_tone_response_115,
+                               sizeof(play_tone_response_115),
+                               test_play_tone_11e,
+                               expect_response_and_finish,
+                               5.0, 6.0);
+       stktest_add_timed_test("Play Tone 1.1f", "LoopTone",
+                               play_tone_116, sizeof(play_tone_116),
+                               play_tone_response_116,
+                               sizeof(play_tone_response_116),
+                               test_play_tone_11f,
+                               expect_response_and_finish,
+                               5.0, 6.0);
+       stktest_add_timed_test("Play Tone 1.1g", "LoopTone",
+                               play_tone_117, sizeof(play_tone_117),
+                               play_tone_response_117,
+                               sizeof(play_tone_response_117),
+                               test_play_tone_11g,
+                               expect_response_and_finish,
+                               5.0, 6.0);
+       stktest_add_timed_test("Play Tone 1.1h", "LoopTone",
+                               play_tone_118, sizeof(play_tone_118),
+                               play_tone_response_118,
+                               sizeof(play_tone_response_118),
+                               test_play_tone_11h,
+                               expect_response_and_finish,
+                               5.0, 6.0);
+       stktest_add_test("Play Tone 1.1i", "PlayTone",
+                               play_tone_119, sizeof(play_tone_119),
+                               play_tone_response_119,
+                               sizeof(play_tone_response_119),
+                               test_play_tone_11i,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 1.1j", "PlayTone",
+                               play_tone_1110, sizeof(play_tone_1110),
+                               play_tone_response_1110,
+                               sizeof(play_tone_response_1110),
+                               test_play_tone_11j,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 1.1k", "PlayTone",
+                               play_tone_1111, sizeof(play_tone_1111),
+                               play_tone_response_1111,
+                               sizeof(play_tone_response_1111),
+                               test_play_tone_11k,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 1.1l", "PlayTone",
+                               play_tone_1112, sizeof(play_tone_1112),
+                               play_tone_response_1112,
+                               sizeof(play_tone_response_1112),
+                               test_play_tone_11l,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 1.1m", "PlayTone",
+                               play_tone_1113, sizeof(play_tone_1113),
+                               play_tone_response_1113,
+                               sizeof(play_tone_response_1113),
+                               test_play_tone_11m,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 1.1n", "LoopTone",
+                               play_tone_1114, sizeof(play_tone_1114),
+                               play_tone_response_1114,
+                               sizeof(play_tone_response_1114),
+                               test_play_tone_11n,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 1.1o", "PlayTone",
+                               play_tone_1115, sizeof(play_tone_1115),
+                               play_tone_response_1115,
+                               sizeof(play_tone_response_1115),
+                               test_play_tone_11o,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 2.1a", "PlayTone",
+                               play_tone_211, sizeof(play_tone_211),
+                               play_tone_response_211,
+                               sizeof(play_tone_response_211),
+                               test_play_tone_21,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 2.1b", "PlayTone",
+                               play_tone_212, sizeof(play_tone_212),
+                               play_tone_response_212,
+                               sizeof(play_tone_response_212),
+                               test_play_tone_21,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 2.1c", "PlayTone",
+                               play_tone_213, sizeof(play_tone_213),
+                               play_tone_response_213,
+                               sizeof(play_tone_response_213),
+                               test_play_tone_21,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 3.1", "PlayTone",
+                               play_tone_311, sizeof(play_tone_311),
+                               play_tone_response_311,
+                               sizeof(play_tone_response_311),
+                               test_play_tone_31,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 3.2", "PlayTone",
+                               play_tone_321, sizeof(play_tone_321),
+                               play_tone_response_321,
+                               sizeof(play_tone_response_321),
+                               test_play_tone_32,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 3.3", "PlayTone",
+                               play_tone_331, sizeof(play_tone_331),
+                               play_tone_response_331,
+                               sizeof(play_tone_response_331),
+                               test_play_tone_33,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 3.4", "PlayTone",
+                               play_tone_341, sizeof(play_tone_341),
+                               play_tone_response_341,
+                               sizeof(play_tone_response_341),
+                               test_play_tone_34,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.1a", "PlayTone",
+                               play_tone_411, sizeof(play_tone_411),
+                               play_tone_response_411,
+                               sizeof(play_tone_response_411),
+                               test_play_tone_41a,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.1b", "PlayTone",
+                               play_tone_412, sizeof(play_tone_412),
+                               play_tone_response_412,
+                               sizeof(play_tone_response_412),
+                               test_play_tone_41b,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.2a", "PlayTone",
+                               play_tone_421, sizeof(play_tone_421),
+                               play_tone_response_421,
+                               sizeof(play_tone_response_421),
+                               test_play_tone_42a,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.2b", "PlayTone",
+                               play_tone_422, sizeof(play_tone_422),
+                               play_tone_response_422,
+                               sizeof(play_tone_response_422),
+                               test_play_tone_42b,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.3a", "PlayTone",
+                               play_tone_431, sizeof(play_tone_431),
+                               play_tone_response_431,
+                               sizeof(play_tone_response_431),
+                               test_play_tone_43a,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.3b", "PlayTone",
+                               play_tone_432, sizeof(play_tone_432),
+                               play_tone_response_432,
+                               sizeof(play_tone_response_432),
+                               test_play_tone_43b,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.4a", "PlayTone",
+                               play_tone_441, sizeof(play_tone_441),
+                               play_tone_response_441,
+                               sizeof(play_tone_response_441),
+                               test_play_tone_44a,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.4b", "PlayTone",
+                               play_tone_442, sizeof(play_tone_442),
+                               play_tone_response_442,
+                               sizeof(play_tone_response_442),
+                               test_play_tone_44b,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.4c", "PlayTone",
+                               play_tone_443, sizeof(play_tone_443),
+                               play_tone_response_443,
+                               sizeof(play_tone_response_443),
+                               test_play_tone_44c,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.5a", "PlayTone",
+                               play_tone_451, sizeof(play_tone_451),
+                               play_tone_response_451,
+                               sizeof(play_tone_response_451),
+                               test_play_tone_45a,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.5b", "PlayTone",
+                               play_tone_452, sizeof(play_tone_452),
+                               play_tone_response_452,
+                               sizeof(play_tone_response_452),
+                               test_play_tone_45b,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.5c", "PlayTone",
+                               play_tone_453, sizeof(play_tone_453),
+                               play_tone_response_453,
+                               sizeof(play_tone_response_453),
+                               test_play_tone_45c,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.6a", "PlayTone",
+                               play_tone_461, sizeof(play_tone_461),
+                               play_tone_response_461,
+                               sizeof(play_tone_response_461),
+                               test_play_tone_46a,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.6b", "PlayTone",
+                               play_tone_462, sizeof(play_tone_462),
+                               play_tone_response_462,
+                               sizeof(play_tone_response_462),
+                               test_play_tone_46b,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.6c", "PlayTone",
+                               play_tone_463, sizeof(play_tone_463),
+                               play_tone_response_463,
+                               sizeof(play_tone_response_463),
+                               test_play_tone_46c,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.7a", "PlayTone",
+                               play_tone_471, sizeof(play_tone_471),
+                               play_tone_response_471,
+                               sizeof(play_tone_response_471),
+                               test_play_tone_47a,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.7b", "PlayTone",
+                               play_tone_472, sizeof(play_tone_472),
+                               play_tone_response_472,
+                               sizeof(play_tone_response_472),
+                               test_play_tone_47b,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.7c", "PlayTone",
+                               play_tone_473, sizeof(play_tone_473),
+                               play_tone_response_473,
+                               sizeof(play_tone_response_473),
+                               test_play_tone_47c,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.8a", "PlayTone",
+                               play_tone_481, sizeof(play_tone_481),
+                               play_tone_response_481,
+                               sizeof(play_tone_response_481),
+                               test_play_tone_48a,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.8b", "PlayTone",
+                               play_tone_482, sizeof(play_tone_482),
+                               play_tone_response_482,
+                               sizeof(play_tone_response_482),
+                               test_play_tone_48b,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.8c", "PlayTone",
+                               play_tone_483, sizeof(play_tone_483),
+                               play_tone_response_483,
+                               sizeof(play_tone_response_483),
+                               test_play_tone_48c,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.9a", "PlayTone",
+                               play_tone_491, sizeof(play_tone_491),
+                               play_tone_response_491,
+                               sizeof(play_tone_response_491),
+                               test_play_tone_49a,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.9b", "PlayTone",
+                               play_tone_492, sizeof(play_tone_492),
+                               play_tone_response_492,
+                               sizeof(play_tone_response_492),
+                               test_play_tone_49b,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.9c", "PlayTone",
+                               play_tone_493, sizeof(play_tone_493),
+                               play_tone_response_493,
+                               sizeof(play_tone_response_493),
+                               test_play_tone_49c,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.10a", "PlayTone",
+                               play_tone_4101, sizeof(play_tone_4101),
+                               play_tone_response_4101,
+                               sizeof(play_tone_response_4101),
+                               test_play_tone_410a,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 4.10b", "PlayTone",
+                               play_tone_4102, sizeof(play_tone_4102),
+                               play_tone_response_4102,
+                               sizeof(play_tone_response_4102),
+                               test_play_tone_410b,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 5.1a", "PlayTone",
+                               play_tone_511, sizeof(play_tone_511),
+                               play_tone_response_511,
+                               sizeof(play_tone_response_511),
+                               test_play_tone_51,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 5.1b", "PlayTone",
+                               play_tone_512, sizeof(play_tone_512),
+                               play_tone_response_512,
+                               sizeof(play_tone_response_512),
+                               test_play_tone_51,
+                               expect_response_and_finish);
+       stktest_add_test("Play Tone 5.1c", "PlayTone",
+                               play_tone_513, sizeof(play_tone_513),
+                               play_tone_response_513,
+                               sizeof(play_tone_response_513),
+                               test_play_tone_51,
+                               expect_response_and_finish);
+       stktest_add_timed_test("Play Tone 6.1a", "LoopTone",
+                               play_tone_611, sizeof(play_tone_611),
+                               play_tone_response_611,
+                               sizeof(play_tone_response_611),
+                               test_play_tone_61a,
+                               expect_response_and_finish,
+                               5.0, 6.0);
+       stktest_add_timed_test("Play Tone 6.1b", "LoopTone",
+                               play_tone_612, sizeof(play_tone_612),
+                               play_tone_response_612,
+                               sizeof(play_tone_response_612),
+                               test_play_tone_61b,
+                               expect_response_and_finish,
+                               5.0, 6.0);
+       stktest_add_timed_test("Play Tone 6.1c", "LoopTone",
+                               play_tone_613, sizeof(play_tone_613),
+                               play_tone_response_613,
+                               sizeof(play_tone_response_613),
+                               test_play_tone_61c,
+                               expect_response_and_finish,
+                               5.0, 6.0);
+       stktest_add_test("Poll Interval 1.1", NULL,
+                               poll_interval_111, sizeof(poll_interval_111),
+                               poll_interval_response_111,
+                               sizeof(poll_interval_response_111),
+                               NULL, expect_response_and_finish);
+}
+
+static void test_destroy(gpointer user_data)
+{
+       struct test *test = user_data;
+
+       g_free(test->name);
+       g_free(test->method);
+       g_free(test->req_pdu);
+       g_free(test->rsp_pdu);
+
+       g_free(test);
+}
+
+static void __stktest_test_summarize(void)
+{
+       GList *l;
+       unsigned int not_run = 0;
+       unsigned int passed = 0;
+       unsigned int failed = 0;
+
+       g_print("\n\nTest Summary\n");
+       g_print("============\n");
+
+       for (l = tests; l; l = l->next) {
+               struct test *test = l->data;
+
+               g_print("%-60s", test->name);
+
+               switch (test->result) {
+               case TEST_RESULT_NOT_RUN:
+                       g_print("Not Run\n");
+                       not_run += 1;
+                       break;
+               case TEST_RESULT_PASSED:
+                       g_print("Passed\n");
+                       passed += 1;
+                       break;
+               case TEST_RESULT_FAILED:
+                       g_print("Failed\n");
+                       failed += 1;
+               break;
+               }
+       }
+
+       g_print("\nTotal: %d, Passed: %d(%.1f%%), Failed: %d, NotRun: %d\n",
+                       not_run + passed + failed, passed,
+                       (float) passed * 100 / (not_run + passed + failed),
+                       failed, not_run);
+}
+
+static void __stktest_test_cleanup(void)
+{
+       g_list_free_full(tests, test_destroy);
+       tests = NULL;
+       cur_test = NULL;
+}
+
+static gboolean option_version = FALSE;
+
+static GOptionEntry options[] = {
+       { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version,
+                               "Show version information and exit" },
+       { NULL },
+};
+
+int main(int argc, char **argv)
+{
+       GOptionContext *context;
+       GError *error = NULL;
+       DBusError err;
+       guint watch;
+       struct sigaction sa;
+
+       context = g_option_context_new(NULL);
+       g_option_context_add_main_entries(context, options, NULL);
+
+       if (g_option_context_parse(context, &argc, &argv, &error) == FALSE) {
+               if (error != NULL) {
+                       g_printerr("%s\n", error->message);
+                       g_error_free(error);
+               } else
+                       g_printerr("An unknown error occurred\n");
+               exit(1);
+       }
+
+       g_option_context_free(context);
+
+       if (option_version == TRUE) {
+               printf("%s\n", VERSION);
+               exit(0);
+       }
+
+       __stktest_test_init();
+
+       main_loop = g_main_loop_new(NULL, FALSE);
+
+       dbus_error_init(&err);
+
+       conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, NULL, &err);
+       if (conn == NULL) {
+               if (dbus_error_is_set(&err) == TRUE) {
+                       fprintf(stderr, "%s\n", err.message);
+                       dbus_error_free(&err);
+               } else
+                       fprintf(stderr, "Can't register with system bus\n");
+               exit(1);
+       }
+
+       g_dbus_set_disconnect_function(conn, disconnect_callback, NULL, NULL);
+
+       memset(&sa, 0, sizeof(sa));
+       sa.sa_handler = sig_term;
+       sigaction(SIGINT, &sa, NULL);
+       sigaction(SIGTERM, &sa, NULL);
+
+       watch = g_dbus_add_service_watch(conn, OFONO_SERVICE,
+                               ofono_connect, ofono_disconnect, NULL, NULL);
+
+       timer = g_timer_new();
+
+       g_main_loop_run(main_loop);
+
+       g_timer_destroy(timer);
+
+       g_dbus_remove_watch(conn, watch);
+
+       if (ofono_running == TRUE)
+               ofono_disconnect(conn, NULL);
+
+       dbus_connection_unref(conn);
+
+       g_main_loop_unref(main_loop);
+
+       __stktest_test_summarize();
+       __stktest_test_cleanup();
+
+       return 0;
+}
diff --git a/tools/tty-redirector.c b/tools/tty-redirector.c
new file mode 100644 (file)
index 0000000..b015a25
--- /dev/null
@@ -0,0 +1,381 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2011-2012  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdbool.h>
+#include <termios.h>
+#include <signal.h>
+#include <sys/signalfd.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <glib.h>
+
+#define IFX_RESET_PATH "/sys/module/hsi_ffl_tty/parameters/reset_modem"
+
+static gchar *option_device = NULL;
+static gboolean option_ifx = FALSE;
+
+static GMainLoop *main_loop;
+static bool main_terminated;
+
+static int device_fd = -1;
+static int client_fd = -1;
+
+static guint device_watch = 0;
+static guint client_watch = 0;
+
+static gboolean shutdown_timeout(gpointer user_data)
+{
+       g_main_loop_quit(main_loop);
+
+       return FALSE;
+}
+
+static void do_terminate(void)
+{
+       if (main_terminated)
+               return;
+
+       main_terminated = true;
+
+       g_timeout_add_seconds(1, shutdown_timeout, NULL);
+}
+
+static gboolean signal_handler(GIOChannel *channel, GIOCondition cond,
+                                                       gpointer user_data)
+{
+       struct signalfd_siginfo si;
+       ssize_t result;
+       int fd;
+
+       if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP))
+               return FALSE;
+
+       fd = g_io_channel_unix_get_fd(channel);
+
+       result = read(fd, &si, sizeof(si));
+       if (result != sizeof(si))
+               return FALSE;
+
+       switch (si.ssi_signo) {
+       case SIGINT:
+       case SIGTERM:
+               do_terminate();
+               break;
+       }
+
+       return TRUE;
+}
+
+static guint create_watch(int fd, GIOFunc func)
+{
+       GIOChannel *channel;
+       guint source;
+
+       channel = g_io_channel_unix_new(fd);
+
+       g_io_channel_set_close_on_unref(channel, TRUE);
+       g_io_channel_set_encoding(channel, NULL, NULL);
+       g_io_channel_set_buffered(channel, FALSE);
+
+       source = g_io_add_watch(channel,
+                       G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, func, NULL);
+
+       g_io_channel_unref(channel);
+
+       return source;
+}
+
+static guint setup_signalfd(void)
+{
+       sigset_t mask;
+       int fd;
+
+       sigemptyset(&mask);
+       sigaddset(&mask, SIGINT);
+       sigaddset(&mask, SIGTERM);
+
+       if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0) {
+               perror("Failed to set signal mask");
+               return 0;
+       }
+
+       fd = signalfd(-1, &mask, 0);
+       if (fd < 0) {
+               perror("Failed to create signal descriptor");
+               return 0;
+       }
+
+       return create_watch(fd, signal_handler);
+}
+
+static int write_file(const char *path, const char *value)
+{
+       ssize_t written;
+       int fd;
+
+       fd = open(path, O_RDWR | O_NOCTTY | O_CLOEXEC);
+       if (fd < 0) {
+               perror("Failed to open file");
+               return -1;
+       }
+
+       written = write(fd, value, strlen(value));
+       if (written < 0) {
+               perror("Failed to write value");
+               return -1;
+       }
+
+       return 0;
+}
+
+static int open_device(const char *path)
+{
+       struct termios ti;
+       int fd;
+
+       /* Switch TTY to raw mode */
+       memset(&ti, 0, sizeof(ti));
+       cfmakeraw(&ti);
+
+       fd = open(path, O_RDWR | O_NOCTTY | O_CLOEXEC);
+       if (fd < 0) {
+               perror("Failed to open device");
+               return -1;
+       }
+
+       tcflush(fd, TCIOFLUSH);
+       tcsetattr(fd, TCSANOW, &ti);
+
+       return fd;
+}
+
+static gboolean forward_data(GIOCondition cond, int input_fd, int output_fd)
+{
+       unsigned char buf[1024];
+       ssize_t bytes_read, bytes_written;
+
+       if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP))
+               return FALSE;
+
+       bytes_read = read(input_fd, buf, sizeof(buf));
+       if (bytes_read < 0)
+               return FALSE;
+
+       bytes_written = write(output_fd, buf, bytes_read);
+       if (bytes_written != bytes_read)
+               return FALSE;
+
+       return TRUE;
+}
+
+static gboolean device_handler(GIOChannel *channel, GIOCondition cond,
+                                                       gpointer user_data)
+{
+       if (forward_data(cond, device_fd, client_fd) == FALSE) {
+               g_printerr("Closing device descriptor\n");
+               if (client_watch > 0) {
+                       g_source_remove(client_watch);
+                       client_watch = 0;
+               }
+
+               device_watch = 0;
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static gboolean client_handler(GIOChannel *channel, GIOCondition cond,
+                                                       gpointer user_data)
+{
+       if (forward_data(cond, client_fd, device_fd) == FALSE) {
+               g_printerr("Closing client connection\n");
+               if (device_watch > 0) {
+                       g_source_remove(device_watch);
+                       device_watch = 0;
+               }
+
+               client_watch = 0;
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static gboolean accept_handler(GIOChannel *channel, GIOCondition cond,
+                                                       gpointer user_data)
+{
+       struct sockaddr_in addr;
+       socklen_t addrlen;
+       int fd, nfd;
+
+       if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP))
+               return FALSE;
+
+       fd = g_io_channel_unix_get_fd(channel);
+
+       memset(&addr, 0, sizeof(addr));
+       addrlen = sizeof(addr);
+
+       nfd = accept4(fd, (struct sockaddr *) &addr, &addrlen, SOCK_CLOEXEC);
+       if (nfd < 0)
+               return TRUE;
+
+       if (device_watch > 0) {
+               g_printerr("Closing previous descriptors\n");
+               g_source_remove(device_watch);
+               device_watch = 0;
+
+               if (client_watch > 0) {
+                       g_source_remove(client_watch);
+                       client_watch = 0;
+               }
+       }
+
+       if (option_ifx == TRUE) {
+               write_file(IFX_RESET_PATH, "1");
+               sleep(1);
+               write_file(IFX_RESET_PATH, "0");
+               sleep(1);
+       }
+
+       device_fd = open_device(option_device);
+       if (device_fd < 0) {
+               close(nfd);
+               return TRUE;
+       }
+
+       device_watch = create_watch(device_fd, device_handler);
+       if (device_watch == 0) {
+               close(nfd);
+               return TRUE;
+       }
+
+       client_watch = create_watch(nfd, client_handler);
+       if (client_watch == 0) {
+               g_source_remove(device_watch);
+               device_watch = 0;
+               close(nfd);
+               return TRUE;
+       }
+
+       client_fd = nfd;
+
+       return TRUE;
+}
+
+static guint setup_server(void)
+{
+       struct sockaddr_in addr;
+       int fd, opt = 1;
+
+       fd = socket(PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
+       if (fd < 0) {
+               perror("Failed to open server socket");
+               return 0;
+       }
+
+       setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
+
+       memset(&addr, 0, sizeof(addr));
+       addr.sin_family = AF_INET;
+       addr.sin_addr.s_addr = INADDR_ANY;
+       addr.sin_port = htons(12345);
+
+       if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
+               perror("Failed to bind server socket");
+               close(fd);
+               return 0;
+       }
+
+       if (listen(fd, 1) < 0) {
+               perror("Failed to listen server socket");
+               close(fd);
+               return 0;
+       }
+
+       return create_watch(fd, accept_handler);
+}
+
+static GOptionEntry options[] = {
+       { "device", 0, 0, G_OPTION_ARG_STRING, &option_device,
+                               "Specify device to use", "DEVNODE" },
+       { "ifx", 0, 0, G_OPTION_ARG_NONE, &option_ifx,
+                               "Use Infineon reset handling" },
+       { NULL },
+};
+
+int main(int argc, char **argv)
+{
+       GOptionContext *context;
+       GError *error = NULL;
+       guint signal_watch;
+       guint server_watch;
+
+       context = g_option_context_new(NULL);
+       g_option_context_add_main_entries(context, options, NULL);
+
+       if (g_option_context_parse(context, &argc, &argv, &error) == FALSE) {
+               if (error != NULL) {
+                       g_printerr("%s\n", error->message);
+                       g_error_free(error);
+               } else
+                       g_printerr("An unknown error occurred\n");
+               return EXIT_FAILURE;
+       }
+
+       g_option_context_free(context);
+
+       if (option_device == NULL) {
+               if (option_ifx == TRUE) {
+                       option_device = g_strdup("/dev/ttyIFX0");
+               } else {
+                       g_printerr("No valid device specified\n");
+                       return EXIT_FAILURE;
+               }
+       }
+
+       main_loop = g_main_loop_new(NULL, FALSE);
+       signal_watch = setup_signalfd();
+       server_watch = setup_server();
+
+       g_main_loop_run(main_loop);
+
+       g_source_remove(server_watch);
+       g_source_remove(signal_watch);
+       g_main_loop_unref(main_loop);
+
+       g_free(option_device);
+
+       return EXIT_SUCCESS;
+}
diff --git a/unit/stk-test-data.h b/unit/stk-test-data.h
new file mode 100644 (file)
index 0000000..2ad285e
--- /dev/null
@@ -0,0 +1,1586 @@
+static const unsigned char display_text_111[] = {
+       0xD0, 0x1A, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x0F, 0x04, 0x54, 0x6F, 0x6F, 0x6C, 0x6B, 0x69, 0x74, 0x20, 0x54, 0x65,
+       0x73, 0x74, 0x20, 0x31
+};
+
+static const unsigned char display_text_response_111[] = {
+       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+};
+
+static const unsigned char display_text_response_121[] = {
+       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82, 0x81, 0x83, 0x02, 0x20,
+       0x01,
+};
+
+static const unsigned char display_text_131[] = {
+       0xD0, 0x1A, 0x81, 0x03, 0x01, 0x21, 0x81, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x0F, 0x04, 0x54, 0x6F, 0x6F, 0x6C, 0x6B, 0x69, 0x74, 0x20, 0x54, 0x65,
+       0x73, 0x74, 0x20, 0x32
+};
+
+static const unsigned char display_text_response_131[] = {
+       0x81, 0x03, 0x01, 0x21, 0x81, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+};
+
+static const unsigned char display_text_141[] = {
+       0xD0, 0x19, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x0E, 0x00, 0xD4, 0xF7, 0x9B, 0xBD, 0x4E, 0xD3, 0x41, 0xD4, 0xF2, 0x9C,
+       0x0E, 0x9A, 0x01
+};
+
+#define display_text_response_141 display_text_response_111
+
+static const unsigned char display_text_151[] = {
+       0xD0, 0x1A, 0x81, 0x03, 0x01, 0x21, 0x00, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x0F, 0x04, 0x54, 0x6F, 0x6F, 0x6C, 0x6B, 0x69, 0x74, 0x20, 0x54, 0x65,
+       0x73, 0x74, 0x20, 0x34
+};
+
+static const unsigned char display_text_response_151[] = {
+       0x81, 0x03, 0x01, 0x21, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+};
+
+static const unsigned char display_text_161[] = {
+       0xD0, 0x81, 0xAD, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02,
+       0x8D, 0x81, 0xA1, 0x04, 0x54, 0x68, 0x69, 0x73, 0x20, 0x63, 0x6F, 0x6D,
+       0x6D, 0x61, 0x6E, 0x64, 0x20, 0x69, 0x6E, 0x73, 0x74, 0x72, 0x75, 0x63,
+       0x74, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4D, 0x45, 0x20, 0x74, 0x6F,
+       0x20, 0x64, 0x69, 0x73, 0x70, 0x6C, 0x61, 0x79, 0x20, 0x61, 0x20, 0x74,
+       0x65, 0x78, 0x74, 0x20, 0x6D, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2E,
+       0x20, 0x49, 0x74, 0x20, 0x61, 0x6C, 0x6C, 0x6F, 0x77, 0x73, 0x20, 0x74,
+       0x68, 0x65, 0x20, 0x53, 0x49, 0x4D, 0x20, 0x74, 0x6F, 0x20, 0x64, 0x65,
+       0x66, 0x69, 0x6E, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x69,
+       0x6F, 0x72, 0x69, 0x74, 0x79, 0x20, 0x6F, 0x66, 0x20, 0x74, 0x68, 0x61,
+       0x74, 0x20, 0x6D, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2C, 0x20, 0x61,
+       0x6E, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20,
+       0x73, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x20, 0x66, 0x6F, 0x72, 0x6D, 0x61,
+       0x74, 0x2E, 0x20, 0x54, 0x77, 0x6F, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73,
+       0x20, 0x6F, 0x66, 0x20, 0x70, 0x72, 0x69, 0x6F
+};
+
+#define display_text_response_161 display_text_response_111
+
+static const unsigned char display_text_171[] = {
+       0xD0, 0x1A, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x0F, 0x04, 0x3C, 0x47, 0x4F, 0x2D, 0x42, 0x41, 0x43, 0x4B, 0x57, 0x41,
+       0x52, 0x44, 0x53, 0x3E
+};
+
+static const unsigned char display_text_response_171[] = {
+       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x11,
+};
+
+static const unsigned char display_text_181[] = {
+       0xD0, 0x13, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x08, 0x04, 0x3C, 0x41, 0x42, 0x4F, 0x52, 0x54, 0x3E
+};
+
+static const unsigned char display_text_response_181[] = {
+       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x10,
+};
+
+static const unsigned char display_text_191[] = {
+       0xD0, 0x0F, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x00, 0x9E, 0x02, 0x00, 0x01
+};
+
+static const unsigned char display_text_response_191[] = {
+       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x32,
+};
+
+static const unsigned char display_text_211[] = {
+       0xD0, 0x16, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x0B, 0x04, 0x3C, 0x54, 0x49, 0x4D, 0x45, 0x2D, 0x4F, 0x55, 0x54, 0x3E,
+};
+
+static const unsigned char display_text_response_211[] = {
+       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x12,
+};
+
+static const unsigned char display_text_311[] = {
+       0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02,
+       0x8D, 0x81, 0xF1, 0x04, 0x54, 0x68, 0x69, 0x73, 0x20, 0x63, 0x6F, 0x6D,
+       0x6D, 0x61, 0x6E, 0x64, 0x20, 0x69, 0x6E, 0x73, 0x74, 0x72, 0x75, 0x63,
+       0x74, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4D, 0x45, 0x20, 0x74, 0x6F,
+       0x20, 0x64, 0x69, 0x73, 0x70, 0x6C, 0x61, 0x79, 0x20, 0x61, 0x20, 0x74,
+       0x65, 0x78, 0x74, 0x20, 0x6D, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2C,
+       0x20, 0x61, 0x6E, 0x64, 0x2F, 0x6F, 0x72, 0x20, 0x61, 0x6E, 0x20, 0x69,
+       0x63, 0x6F, 0x6E, 0x20, 0x28, 0x73, 0x65, 0x65, 0x20, 0x36, 0x2E, 0x35,
+       0x2E, 0x34, 0x29, 0x2E, 0x20, 0x49, 0x74, 0x20, 0x61, 0x6C, 0x6C, 0x6F,
+       0x77, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x53, 0x49, 0x4D, 0x20, 0x74,
+       0x6F, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6E, 0x65, 0x20, 0x74, 0x68, 0x65,
+       0x20, 0x70, 0x72, 0x69, 0x6F, 0x72, 0x69, 0x74, 0x79, 0x20, 0x6F, 0x66,
+       0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x6D, 0x65, 0x73, 0x73, 0x61, 0x67,
+       0x65, 0x2C, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74,
+       0x65, 0x78, 0x74, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x20, 0x66,
+       0x6F, 0x72, 0x6D, 0x61, 0x74, 0x2E, 0x20, 0x54, 0x77, 0x6F, 0x20, 0x74,
+       0x79, 0x70, 0x65, 0x73, 0x20, 0x6F, 0x66, 0x20, 0x70, 0x72, 0x69, 0x6F,
+       0x72, 0x69, 0x74, 0x79, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x65, 0x66,
+       0x69, 0x6E, 0x65, 0x64, 0x3A, 0x2D, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6C,
+       0x61, 0x79, 0x20, 0x6E, 0x6F, 0x72, 0x6D, 0x61, 0x6C, 0x20, 0x70, 0x72,
+       0x69, 0x6F, 0x72, 0x69, 0x74, 0x79, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20,
+       0x61, 0x6E, 0x64, 0x2F,
+};
+
+#define display_text_response_311 display_text_response_111
+
+static const unsigned char display_text_411[] = {
+       0xD0, 0x1C, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x0F, 0x04, 0x54, 0x6F, 0x6F, 0x6C, 0x6B, 0x69, 0x74, 0x20, 0x54, 0x65,
+       0x73, 0x74, 0x20, 0x31, 0xAB, 0x00,
+};
+
+#define display_text_response_411 display_text_response_111
+
+static const unsigned char display_text_421[] = {
+       0xD0, 0x1C, 0x81, 0x03, 0x01, 0x21, 0x00, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x0F, 0x04, 0x54, 0x6F, 0x6F, 0x6C, 0x6B, 0x69, 0x74, 0x20, 0x54, 0x65,
+       0x73, 0x74, 0x20, 0x32, 0xAB, 0x00,
+};
+
+#define display_text_response_421 display_text_response_151
+
+static const unsigned char display_text_431[] = {
+       0xD0, 0x1C, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x0F, 0x04, 0x54, 0x6F, 0x6F, 0x6C, 0x6B, 0x69, 0x74, 0x20, 0x54, 0x65,
+       0x73, 0x74, 0x20, 0x33, 0xAB, 0x00,
+};
+
+#define display_text_response_431 display_text_response_111
+
+static const unsigned char display_text_511[] = {
+       0xD0, 0x1A, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x0B, 0x04, 0x42, 0x61, 0x73, 0x69, 0x63, 0x20, 0x49, 0x63, 0x6F, 0x6E,
+       0x9E, 0x02, 0x00, 0x01
+};
+
+#define display_text_response_511a display_text_response_111
+
+static const unsigned char display_text_response_511b[] = {
+       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x04,
+};
+
+static const unsigned char display_text_521[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x0C, 0x04, 0x43, 0x6F, 0x6C, 0x6F, 0x75, 0x72, 0x20, 0x49, 0x63, 0x6F,
+       0x6E, 0x9E, 0x02, 0x00, 0x02
+};
+
+#define display_text_response_521a display_text_response_111
+#define display_text_response_521b display_text_response_511b
+
+static const unsigned char display_text_531[] = {
+       0xD0, 0x1A, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x0B, 0x04, 0x42, 0x61, 0x73, 0x69, 0x63, 0x20, 0x49, 0x63, 0x6F, 0x6E,
+       0x9E, 0x02, 0x01, 0x01
+};
+
+#define display_text_response_531a display_text_response_111
+#define display_text_response_531b display_text_response_511b
+
+static const unsigned char display_text_611[] = {
+       0xD0, 0x24, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x19, 0x08, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10, 0x04, 0x12,
+       0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19, 0x04, 0x22,
+       0x04, 0x15
+};
+
+#define display_text_response_611 display_text_response_111
+
+static const unsigned char display_text_711[] = {
+       0xD0, 0x19, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x0A, 0x04, 0x31, 0x30, 0x20, 0x53, 0x65, 0x63, 0x6F, 0x6E, 0x64, 0x84,
+       0x02, 0x01, 0x0A
+};
+
+#define display_text_response_711 display_text_response_211
+
+static const unsigned char display_text_811[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x11, 0x04, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69,
+       0x62, 0x75, 0x74, 0x65, 0x20, 0x31, 0xD0, 0x04, 0x00, 0x10, 0x00, 0xB4
+};
+
+static const unsigned char display_text_812[] = {
+       0xD0, 0x1C, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x11, 0x04, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69,
+       0x62, 0x75, 0x74, 0x65, 0x20, 0x32,
+};
+
+#define display_text_response_811 display_text_response_111
+
+static const unsigned char display_text_821[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x11, 0x04, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69,
+       0x62, 0x75, 0x74, 0x65, 0x20, 0x31, 0xD0, 0x04, 0x00, 0x10, 0x01, 0xB4
+};
+
+#define display_text_response_821 display_text_response_111
+
+static const unsigned char display_text_831[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x11, 0x04, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69,
+       0x62, 0x75, 0x74, 0x65, 0x20, 0x31, 0xD0, 0x04, 0x00, 0x10, 0x02, 0xB4
+};
+
+#define display_text_response_831 display_text_response_111
+
+static const unsigned char display_text_841[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x11, 0x04, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69,
+       0x62, 0x75, 0x74, 0x65, 0x20, 0x31, 0xD0, 0x04, 0x00, 0x10, 0x04, 0xB4
+};
+
+#define display_text_response_841 display_text_response_111
+
+static const unsigned char display_text_851[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x11, 0x04, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69,
+       0x62, 0x75, 0x74, 0x65, 0x20, 0x31, 0xD0, 0x04, 0x00, 0x10, 0x08, 0xB4
+};
+
+#define display_text_response_851 display_text_response_111
+
+static const unsigned char display_text_861[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x11, 0x04, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69,
+       0x62, 0x75, 0x74, 0x65, 0x20, 0x31, 0xD0, 0x04, 0x00, 0x10, 0x10, 0xB4
+};
+
+#define display_text_response_861 display_text_response_111
+
+static const unsigned char display_text_871[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x11, 0x04, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69,
+       0x62, 0x75, 0x74, 0x65, 0x20, 0x31, 0xD0, 0x04, 0x00, 0x10, 0x20, 0xB4
+};
+
+#define display_text_response_871 display_text_response_111
+
+static const unsigned char display_text_881[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x11, 0x04, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69,
+       0x62, 0x75, 0x74, 0x65, 0x20, 0x31, 0xD0, 0x04, 0x00, 0x10, 0x40, 0xB4
+};
+
+#define display_text_response_881 display_text_response_111
+
+static const unsigned char display_text_891[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x11, 0x04, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69,
+       0x62, 0x75, 0x74, 0x65, 0x20, 0x31, 0xD0, 0x04, 0x00, 0x10, 0x80, 0xB4
+};
+
+#define display_text_response_891 display_text_response_111
+
+static const unsigned char display_text_8101[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x11, 0x04, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69,
+       0x62, 0x75, 0x74, 0x65, 0x20, 0x31, 0xD0, 0x04, 0x00, 0x10, 0x00, 0xB4,
+};
+
+#define display_text_response_8101 display_text_response_111
+
+static const unsigned char display_text_911[] = {
+       0xD0, 0x10, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x05, 0x08, 0x4F, 0x60, 0x59, 0x7D
+};
+
+#define display_text_response_911 display_text_response_111
+
+static const unsigned char display_text_1011[] = {
+       0xD0, 0x12, 0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
+       0x07, 0x08, 0x00, 0x38, 0x00, 0x30, 0x30, 0xEB
+};
+
+#define display_text_response_1011 display_text_response_111
+
+static const unsigned char get_inkey_111[] = {
+       0xD0, 0x15, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x2B, 0x22
+};
+
+static const unsigned char get_inkey_response_111[] = {
+       0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x02, 0x04, 0x2b,
+};
+
+static const unsigned char get_inkey_121[] = {
+       0xD0, 0x14, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x09, 0x00, 0x45, 0x37, 0xBD, 0x2C, 0x07, 0x89, 0x60, 0x22
+};
+
+static const unsigned char get_inkey_response_121[] = {
+       0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x02, 0x04, 0x30,
+};
+
+static const unsigned char get_inkey_131[] = {
+       0xD0, 0x1A, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0F, 0x04, 0x3C, 0x47, 0x4F, 0x2D, 0x42, 0x41, 0x43, 0x4B, 0x57, 0x41,
+       0x52, 0x44, 0x53, 0x3E
+};
+
+static const unsigned char get_inkey_response_131[] = {
+       0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x11,
+};
+
+static const unsigned char get_inkey_141[] = {
+       0xD0, 0x13, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x08, 0x04, 0x3C, 0x41, 0x42, 0x4F, 0x52, 0x54, 0x3E
+};
+
+static const unsigned char get_inkey_response_141[] = {
+       0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x10,
+};
+
+static const unsigned char get_inkey_151[] = {
+       0xD0, 0x15, 0x81, 0x03, 0x01, 0x22, 0x01, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x71, 0x22,
+};
+
+static const unsigned char get_inkey_response_151[] = {
+       0x81, 0x03, 0x01, 0x22, 0x01, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x02, 0x04, 0x71,
+};
+
+static const unsigned char get_inkey_161[] = {
+       0xD0, 0x81, 0xAD, 0x81, 0x03, 0x01, 0x22, 0x01, 0x82, 0x02, 0x81, 0x82,
+       0x8D, 0x81, 0xA1, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x78,
+       0x22, 0x2E, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x63, 0x6F, 0x6D, 0x6D,
+       0x61, 0x6E, 0x64, 0x20, 0x69, 0x6E, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74,
+       0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4D, 0x45, 0x20, 0x74, 0x6F, 0x20,
+       0x64, 0x69, 0x73, 0x70, 0x6C, 0x61, 0x79, 0x20, 0x74, 0x65, 0x78, 0x74,
+       0x2C, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x65, 0x78, 0x70,
+       0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72,
+       0x20, 0x74, 0x6F, 0x20, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x61, 0x20,
+       0x73, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20, 0x63, 0x68, 0x61, 0x72, 0x61,
+       0x63, 0x74, 0x65, 0x72, 0x2E, 0x20, 0x41, 0x6E, 0x79, 0x20, 0x72, 0x65,
+       0x73, 0x70, 0x6F, 0x6E, 0x73, 0x65, 0x20, 0x65, 0x6E, 0x74, 0x65, 0x72,
+       0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73,
+       0x65, 0x72, 0x20, 0x73, 0x68, 0x61, 0x6C, 0x6C, 0x20, 0x62, 0x65, 0x20,
+       0x70, 0x61, 0x73, 0x73, 0x65, 0x64, 0x20, 0x74,
+};
+
+static const unsigned char get_inkey_response_161[] = {
+       0x81, 0x03, 0x01, 0x22, 0x01, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x02, 0x04, 0x78,
+};
+
+static const unsigned char get_inkey_211[] = {
+       0xD0, 0x16, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0B, 0x04, 0x3C, 0x54, 0x49, 0x4D, 0x45, 0x2D, 0x4F, 0x55, 0x54, 0x3E,
+};
+
+static const unsigned char get_inkey_response_211[] = {
+       0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x12,
+};
+
+static const unsigned char get_inkey_311[] = {
+       0xD0, 0x24, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x19, 0x08, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10, 0x04, 0x12,
+       0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19, 0x04, 0x22,
+       0x04, 0x15
+};
+
+#define get_inkey_response_311 get_inkey_response_111
+
+static const unsigned char get_inkey_321[] = {
+       0xD0, 0x81, 0x99, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82,
+       0x8D, 0x81, 0x8D, 0x08, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+};
+
+#define get_inkey_response_321 get_inkey_response_111
+
+static const unsigned char get_inkey_411[] = {
+       0xD0, 0x11, 0x81, 0x03, 0x01, 0x22, 0x03, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x06, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72
+};
+
+static const unsigned char get_inkey_response_411[] = {
+       0x81, 0x03, 0x01, 0x22, 0x03, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x03, 0x08, 0x04, 0x14,
+};
+
+static const unsigned char get_inkey_511[] = {
+       0xD0, 0x15, 0x81, 0x03, 0x01, 0x22, 0x04, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x59, 0x45, 0x53
+};
+
+static const unsigned char get_inkey_response_511[] = {
+       0x81, 0x03, 0x01, 0x22, 0x04, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x02, 0x04, 0x01,
+};
+
+static const unsigned char get_inkey_512[] = {
+       0xD0, 0x14, 0x81, 0x03, 0x01, 0x22, 0x04, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x09, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x4E, 0x4F
+};
+
+static const unsigned char get_inkey_response_512[] = {
+       0x81, 0x03, 0x01, 0x22, 0x04, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x02, 0x04, 0x00,
+};
+
+static const unsigned char get_inkey_611[] = {
+       0xD0, 0x19, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x3C, 0x4E, 0x4F, 0x2D, 0x49, 0x43, 0x4F, 0x4E, 0x3E, 0x1E,
+       0x02, 0x00, 0x01
+};
+
+#define get_inkey_response_611 get_inkey_response_111
+
+static const unsigned char get_inkey_621[] = {
+       0xD0, 0x1C, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0D, 0x04, 0x3C, 0x42, 0x41, 0x53, 0x49, 0x43, 0x2D, 0x49, 0x43, 0x4F,
+       0x4E, 0x3E, 0x1E, 0x02, 0x01, 0x01
+};
+
+#define get_inkey_response_621 get_inkey_response_111
+
+static const unsigned char get_inkey_631[] = {
+       0xD0, 0x19, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x3C, 0x4E, 0x4F, 0x2D, 0x49, 0x43, 0x4F, 0x4E, 0x3E, 0x1E,
+       0x02, 0x00, 0x02
+};
+
+#define get_inkey_response_631 get_inkey_response_111
+
+static const unsigned char get_inkey_641[] = {
+       0xD0, 0x1D, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0E, 0x04, 0x3C, 0x43, 0x4F, 0x4C, 0x4F, 0x55, 0x52, 0x2D, 0x49, 0x43,
+       0x4F, 0x4E, 0x3E, 0x1E, 0x02, 0x01, 0x02
+};
+
+#define get_inkey_response_641 get_inkey_response_111
+
+static const unsigned char get_inkey_811[] = {
+       0xD0, 0x19, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x2B, 0x22, 0x84,
+       0x02, 0x01, 0x0A
+};
+
+static const unsigned char get_inkey_response_811[] = {
+       0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x12,
+       0x04, 0x02, 0x01, 0x0B,
+};
+
+static const unsigned char get_inkey_911[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x2B, 0x22, 0xD0,
+       0x04, 0x00, 0x09, 0x00, 0xB4
+};
+
+#define get_inkey_response_911 get_inkey_response_111
+
+static const unsigned char get_inkey_921[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x2B, 0x22, 0xD0,
+       0x04, 0x00, 0x09, 0x01, 0xB4
+};
+
+#define get_inkey_response_921 get_inkey_response_111
+
+static const unsigned char get_inkey_931[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x2B, 0x22, 0xD0,
+       0x04, 0x00, 0x09, 0x02, 0xB4
+};
+
+#define get_inkey_response_931 get_inkey_response_111
+
+static const unsigned char get_inkey_941[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x2B, 0x22, 0xD0,
+       0x04, 0x00, 0x09, 0x04, 0xB4
+};
+
+#define get_inkey_response_941 get_inkey_response_111
+
+static const unsigned char get_inkey_951[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x2B, 0x22, 0xD0,
+       0x04, 0x00, 0x09, 0x08, 0xB4
+};
+
+#define get_inkey_response_951 get_inkey_response_111
+
+static const unsigned char get_inkey_961[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x2B, 0x22, 0xD0,
+       0x04, 0x00, 0x09, 0x10, 0xB4
+};
+
+#define get_inkey_response_961 get_inkey_response_111
+
+static const unsigned char get_inkey_971[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x2B, 0x22, 0xD0,
+       0x04, 0x00, 0x09, 0x20, 0xB4
+};
+
+#define get_inkey_response_971 get_inkey_response_111
+
+static const unsigned char get_inkey_981[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x2B, 0x22, 0xD0,
+       0x04, 0x00, 0x09, 0x40, 0xB4
+};
+
+#define get_inkey_response_981 get_inkey_response_111
+
+static const unsigned char get_inkey_991[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x2B, 0x22, 0xD0,
+       0x04, 0x00, 0x09, 0x80, 0xB4
+};
+
+#define get_inkey_response_991 get_inkey_response_111
+
+static const unsigned char get_inkey_9101[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x22, 0x2B, 0x22, 0xD0,
+       0x04, 0x00, 0x09, 0x00, 0xB4
+};
+
+#define get_inkey_response_9101 get_inkey_response_111
+
+static const unsigned char get_inkey_1011[] = {
+       0xD0, 0x10, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x05, 0x08, 0x4F, 0x60, 0x59, 0x7D
+};
+
+#define get_inkey_response_1011 get_inkey_response_111
+
+static const unsigned char get_inkey_1021[] = {
+       0xD0, 0x81, 0x99, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82,
+       0x8D, 0x81, 0x8D, 0x08, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+};
+
+#define get_inkey_response_1021 get_inkey_response_111
+
+static const unsigned char get_inkey_1111[] = {
+       0xD0, 0x11, 0x81, 0x03, 0x01, 0x22, 0x03, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x06, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72
+};
+
+static const unsigned char get_inkey_response_1111[] = {
+       0x81, 0x03, 0x01, 0x22, 0x03, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x03, 0x08, 0x59, 0x7d,
+};
+
+static const unsigned char get_inkey_1211[] = {
+       0xD0, 0x0E, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x03, 0x08, 0x30, 0xEB
+};
+
+#define get_inkey_response_1211 get_inkey_response_111
+
+static const unsigned char get_inkey_1221[] = {
+       0xD0, 0x81, 0x99, 0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x81, 0x82,
+       0x8D, 0x81, 0x8D, 0x08, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+};
+
+#define get_inkey_response_1221 get_inkey_response_111
+
+static const unsigned char get_inkey_1311[] = {
+       0xD0, 0x11, 0x81, 0x03, 0x01, 0x22, 0x03, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x06, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72
+};
+
+static const unsigned char get_inkey_response_1311[] = {
+       0x81, 0x03, 0x01, 0x22, 0x03, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x03, 0x08, 0x30, 0xeb,
+};
+
+static const unsigned char get_input_111[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x31, 0x32, 0x33, 0x34,
+       0x35, 0x91, 0x02, 0x05, 0x05
+};
+
+static const unsigned char get_input_response_111[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x06, 0x04, 0x31, 0x32, 0x33, 0x34, 0x35,
+};
+
+static const unsigned char get_input_121[] = {
+       0xD0, 0x1A, 0x81, 0x03, 0x01, 0x23, 0x08, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0B, 0x00, 0x45, 0x37, 0xBD, 0x2C, 0x07, 0xD9, 0x6E, 0xAA, 0xD1, 0x0A,
+       0x91, 0x02, 0x05, 0x05
+};
+
+static const unsigned char get_input_response_121[] = {
+       0x81, 0x03, 0x01, 0x23, 0x08, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x06, 0x00, 0xb6, 0x9b, 0x6a, 0xb4, 0x02,
+};
+
+static const unsigned char get_input_131[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x41, 0x62, 0x43, 0x64,
+       0x45, 0x91, 0x02, 0x05, 0x05
+};
+
+static const unsigned char get_input_response_131[] = {
+       0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x06, 0x04, 0x41, 0x62, 0x43, 0x64, 0x45,
+};
+
+static const unsigned char get_input_141[] = {
+       0xD0, 0x27, 0x81, 0x03, 0x01, 0x23, 0x04, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x18, 0x04, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6F, 0x72, 0x64, 0x20, 0x31,
+       0x3C, 0x53, 0x45, 0x4E, 0x44, 0x3E, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+       0x38, 0x91, 0x02, 0x04, 0x08
+};
+
+static const unsigned char get_input_response_141[] = {
+       0x81, 0x03, 0x01, 0x23, 0x04, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x08, 0x04, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
+};
+
+static const unsigned char get_input_151[] = {
+       0xD0, 0x24, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x15, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x31, 0x2E, 0x2E, 0x39,
+       0x2C, 0x30, 0x2E, 0x2E, 0x39, 0x2C, 0x30, 0x28, 0x31, 0x29, 0x91, 0x02,
+       0x01, 0x14,
+};
+
+static const unsigned char get_input_response_151[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x15, 0x04, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30,
+};
+
+static const unsigned char get_input_161[] = {
+       0xD0, 0x1E, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0F, 0x04, 0x3C, 0x47, 0x4F, 0x2D, 0x42, 0x41, 0x43, 0x4B, 0x57, 0x41,
+       0x52, 0x44, 0x53, 0x3E, 0x91, 0x02, 0x00, 0x08
+};
+
+static const unsigned char get_input_response_161[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x11,
+};
+
+static const unsigned char get_input_171[] = {
+       0xD0, 0x17, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x08, 0x04, 0x3C, 0x41, 0x42, 0x4F, 0x52, 0x54, 0x3E, 0x91, 0x02, 0x00,
+       0x08
+};
+
+static const unsigned char get_input_response_171[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x10,
+};
+
+static const unsigned char get_input_181[] = {
+       0xD0, 0x81, 0xB1, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82,
+       0x8D, 0x81, 0xA1, 0x04, 0x2A, 0x2A, 0x2A, 0x31, 0x31, 0x31, 0x31, 0x31,
+       0x31, 0x31, 0x31, 0x31, 0x31, 0x23, 0x23, 0x23, 0x2A, 0x2A, 0x2A, 0x32,
+       0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x23, 0x23, 0x23,
+       0x2A, 0x2A, 0x2A, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33,
+       0x33, 0x23, 0x23, 0x23, 0x2A, 0x2A, 0x2A, 0x34, 0x34, 0x34, 0x34, 0x34,
+       0x34, 0x34, 0x34, 0x34, 0x34, 0x23, 0x23, 0x23, 0x2A, 0x2A, 0x2A, 0x35,
+       0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x23, 0x23, 0x23,
+       0x2A, 0x2A, 0x2A, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+       0x36, 0x23, 0x23, 0x23, 0x2A, 0x2A, 0x2A, 0x37, 0x37, 0x37, 0x37, 0x37,
+       0x37, 0x37, 0x37, 0x37, 0x37, 0x23, 0x23, 0x23, 0x2A, 0x2A, 0x2A, 0x38,
+       0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x23, 0x23, 0x23,
+       0x2A, 0x2A, 0x2A, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39,
+       0x39, 0x23, 0x23, 0x23, 0x2A, 0x2A, 0x2A, 0x30, 0x30, 0x30, 0x30, 0x30,
+       0x30, 0x30, 0x30, 0x30, 0x30, 0x23, 0x23, 0x23, 0x91, 0x02, 0xA0, 0xA0
+};
+
+static const unsigned char get_input_response_181[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x81, 0xa1, 0x04, 0x2a, 0x2a, 0x2a, 0x31, 0x31, 0x31, 0x31, 0x31,
+       0x31, 0x31, 0x31, 0x31, 0x31, 0x23, 0x23, 0x23, 0x2a, 0x2a, 0x2a, 0x32,
+       0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x23, 0x23, 0x23,
+       0x2a, 0x2a, 0x2a, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33,
+       0x33, 0x23, 0x23, 0x23, 0x2a, 0x2a, 0x2a, 0x34, 0x34, 0x34, 0x34, 0x34,
+       0x34, 0x34, 0x34, 0x34, 0x34, 0x23, 0x23, 0x23, 0x2a, 0x2a, 0x2a, 0x35,
+       0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x23, 0x23, 0x23,
+       0x2a, 0x2a, 0x2a, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+       0x36, 0x23, 0x23, 0x23, 0x2a, 0x2a, 0x2a, 0x37, 0x37, 0x37, 0x37, 0x37,
+       0x37, 0x37, 0x37, 0x37, 0x37, 0x23, 0x23, 0x23, 0x2a, 0x2a, 0x2a, 0x38,
+       0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x23, 0x23, 0x23,
+       0x2a, 0x2a, 0x2a, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39,
+       0x39, 0x23, 0x23, 0x23, 0x2a, 0x2a, 0x2a, 0x30, 0x30, 0x30, 0x30, 0x30,
+       0x30, 0x30, 0x30, 0x30, 0x30, 0x23, 0x23, 0x23,
+};
+
+static const unsigned char get_input_191[] = {
+       0xD0, 0x16, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x07, 0x04, 0x3C, 0x53, 0x45, 0x4E, 0x44, 0x3E, 0x91, 0x02, 0x00, 0x01
+};
+
+static const unsigned char get_input_response_191a[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x01, 0x04,
+};
+
+static const unsigned char get_input_1101[] = {
+       0xD0, 0x0F, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x00, 0x91, 0x02, 0x01, 0x05
+};
+
+#define get_input_response_1101 get_input_response_111
+
+static const unsigned char get_input_211[] = {
+       0xD0, 0x1A, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0B, 0x04, 0x3C, 0x54, 0x49, 0x4D, 0x45, 0x2D, 0x4F, 0x55, 0x54, 0x3E,
+       0x91, 0x02, 0x00, 0x0A
+};
+
+static const unsigned char get_input_response_211[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x12,
+};
+
+static const unsigned char get_input_311[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x19, 0x08, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10, 0x04, 0x12,
+       0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19, 0x04, 0x22,
+       0x04, 0x15, 0x91, 0x02, 0x05, 0x05
+};
+
+static const unsigned char get_input_response_311[] = {
+       0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x06, 0x04, 0x48, 0x45, 0x4c, 0x4c, 0x4f,
+};
+
+static const unsigned char get_input_321[] = {
+       0xD0, 0x81, 0x9D, 0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x81, 0x82,
+       0x8D, 0x81, 0x8D, 0x08, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x91, 0x02, 0x05, 0x05
+};
+
+#define get_input_response_321 get_input_response_311
+
+static const unsigned char get_input_411[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x48, 0x65, 0x6C, 0x6C,
+       0x6F, 0x91, 0x02, 0x0C, 0x0C
+};
+
+static const unsigned char get_input_response_411[] = {
+       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x19, 0x08, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10, 0x04,
+       0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19, 0x04,
+       0x22, 0x04, 0x15,
+};
+
+static const unsigned char get_input_421[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x48, 0x65, 0x6C, 0x6C,
+       0x6F, 0x91, 0x02, 0x05, 0xFF
+};
+
+static const unsigned char get_input_response_421[] = {
+       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x81, 0x8d, 0x08, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+       0x04, 0x22, 0x04, 0x15, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
+       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19,
+};
+
+static const unsigned char get_input_511[] = {
+       0xD0, 0x23, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x31, 0x32, 0x33, 0x34,
+       0x35, 0x91, 0x02, 0x05, 0x05, 0x17, 0x06, 0x04, 0x31, 0x32, 0x33, 0x34,
+       0x35
+};
+
+#define get_input_response_511 get_input_response_111
+
+static const unsigned char get_input_521[] = {
+       0xD0, 0x81, 0xBA, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82,
+       0x8D, 0x07, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x3A, 0x91, 0x02, 0xA0,
+       0xA0, 0x17, 0x81, 0xA1, 0x04, 0x2A, 0x2A, 0x2A, 0x31, 0x31, 0x31, 0x31,
+       0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x23, 0x23, 0x23, 0x2A, 0x2A, 0x2A,
+       0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x23, 0x23,
+       0x23, 0x2A, 0x2A, 0x2A, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33,
+       0x33, 0x33, 0x23, 0x23, 0x23, 0x2A, 0x2A, 0x2A, 0x34, 0x34, 0x34, 0x34,
+       0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x23, 0x23, 0x23, 0x2A, 0x2A, 0x2A,
+       0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x23, 0x23,
+       0x23, 0x2A, 0x2A, 0x2A, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+       0x36, 0x36, 0x23, 0x23, 0x23, 0x2A, 0x2A, 0x2A, 0x37, 0x37, 0x37, 0x37,
+       0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x23, 0x23, 0x23, 0x2A, 0x2A, 0x2A,
+       0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x23, 0x23,
+       0x23, 0x2A, 0x2A, 0x2A, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39,
+       0x39, 0x39, 0x23, 0x23, 0x23, 0x2A, 0x2A, 0x2A, 0x30, 0x30, 0x30, 0x30,
+       0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x23, 0x23, 0x23
+};
+
+#define get_input_response_521 get_input_response_181
+
+static const unsigned char get_input_611[] = {
+       0xD0, 0x1D, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82,0x8D,
+       0x0A, 0x04, 0x3C, 0x4E, 0x4F, 0x2D, 0x49, 0x43, 0x4F, 0x4E, 0x3E, 0x91,
+       0x02, 0x00, 0x0A, 0x1E, 0x02, 0x00, 0x01
+};
+
+static const unsigned char get_input_response_611a[] = {
+       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x02, 0x04, 0x2b,
+};
+
+static const unsigned char get_input_621[] = {
+       0xD0, 0x20, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0D, 0x04, 0x3C, 0x42, 0x41, 0x53, 0x49, 0x43, 0x2D, 0x49, 0x43, 0x4F,
+       0x4E, 0x3E, 0x91, 0x02, 0x00, 0x0A, 0x1E, 0x02, 0x01, 0x01
+};
+
+#define get_input_response_621a get_input_response_611a
+
+static const unsigned char get_input_631[] = {
+       0xD0, 0x1D, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0A, 0x04, 0x3C, 0x4E, 0x4F, 0x2D, 0x49, 0x43, 0x4F, 0x4E, 0x3E, 0x91,
+       0x02, 0x00, 0x0A, 0x1E, 0x02, 0x00, 0x02
+};
+
+#define get_input_response_631a get_input_response_611a
+
+static const unsigned char get_input_641[] = {
+       0xD0, 0x21, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0E, 0x04, 0x3C, 0x43, 0x4F, 0x4C, 0x4F, 0x55, 0x52, 0x2D, 0x49, 0x43,
+       0x4F, 0x4E, 0x3E, 0x91, 0x02, 0x00, 0x0A, 0x1E, 0x02, 0x01, 0x02
+};
+
+#define get_input_response_641a get_input_response_611a
+
+static const unsigned char get_input_811[] = {
+       0xD0, 0x21, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x31, 0x32, 0x33, 0x34,
+       0x35, 0x91, 0x02, 0x05, 0x05, 0xD0, 0x04, 0x00, 0x0B, 0x00, 0xB4
+};
+
+#define get_input_response_811 get_input_response_111
+
+static const unsigned char get_input_821[] = {
+       0xD0, 0x21, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x31, 0x32, 0x33, 0x34,
+       0x35, 0x91, 0x02, 0x05, 0x05, 0xD0, 0x04, 0x00, 0x0B, 0x01, 0xB4
+};
+
+#define get_input_response_821 get_input_response_111
+
+static const unsigned char get_input_831[] = {
+       0xD0, 0x21, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x31, 0x32, 0x33, 0x34,
+       0x35, 0x91, 0x02, 0x05, 0x05, 0xD0, 0x04, 0x00, 0x0B, 0x02, 0xB4
+};
+
+#define get_input_response_831 get_input_response_111
+
+static const unsigned char get_input_841[] = {
+       0xD0, 0x21, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x31, 0x32, 0x33, 0x34,
+       0x35, 0x91, 0x02, 0x05, 0x05, 0xD0, 0x04, 0x00, 0x0B, 0x04, 0xB4
+};
+
+#define get_input_response_841 get_input_response_111
+
+static const unsigned char get_input_851[] = {
+       0xD0, 0x21, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x31, 0x32, 0x33, 0x34,
+       0x35, 0x91, 0x02, 0x05, 0x05, 0xD0, 0x04, 0x00, 0x0B, 0x08, 0xB4
+};
+
+#define get_input_response_851 get_input_response_111
+
+static const unsigned char get_input_861[] = {
+       0xD0, 0x21, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x31, 0x32, 0x33, 0x34,
+       0x35, 0x91, 0x02, 0x05, 0x05, 0xD0, 0x04, 0x00, 0x0B, 0x10, 0xB4
+};
+
+#define get_input_response_861 get_input_response_111
+
+static const unsigned char get_input_871[] = {
+       0xD0, 0x21, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x31, 0x32, 0x33, 0x34,
+       0x35, 0x91, 0x02, 0x05, 0x05, 0xD0, 0x04, 0x00, 0x0B, 0x20, 0xB4
+};
+
+#define get_input_response_871 get_input_response_111
+
+static const unsigned char get_input_881[] = {
+       0xD0, 0x21, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x31, 0x32, 0x33, 0x34,
+       0x35, 0x91, 0x02, 0x05, 0x05, 0xD0, 0x04, 0x00, 0x0B, 0x40, 0xB4
+};
+
+#define get_input_response_881 get_input_response_111
+
+static const unsigned char get_input_891[] = {
+       0xD0, 0x21, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x31, 0x32, 0x33, 0x34,
+       0x35, 0x91, 0x02, 0x05, 0x05, 0xD0, 0x04, 0x00, 0x0B, 0x80, 0xB4
+};
+
+#define get_input_response_891 get_input_response_111
+
+static const unsigned char get_input_8101[] = {
+       0xD0, 0x21, 0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x31, 0x32, 0x33, 0x34,
+       0x35, 0x91, 0x02, 0x05, 0x05, 0xD0, 0x04, 0x00, 0x0B, 0x00, 0xB4
+};
+
+#define get_input_response_8101 get_input_response_111
+
+static const unsigned char get_input_911[] = {
+       0xD0, 0x14, 0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x05, 0x08, 0x4F, 0x60, 0x59, 0x7D, 0x91, 0x02, 0x05, 0x05
+};
+
+#define get_input_response_911 get_input_response_311
+
+static const unsigned char get_input_921[] = {
+       0xD0, 0x81, 0x9D, 0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x81, 0x82,
+       0x8D, 0x81, 0x8D, 0x08, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D, 0x4F, 0x60, 0x59, 0x7D,
+       0x91, 0x02, 0x05, 0x05
+};
+
+#define get_input_response_921 get_input_response_311
+
+static const unsigned char get_input_1011[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x48, 0x65, 0x6C, 0x6C,
+       0x6F, 0x91, 0x02, 0x02, 0x02
+};
+
+static const unsigned char get_input_response_1011[] = {
+       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x05, 0x08, 0x4f, 0x60, 0x59, 0x7d,
+};
+
+static const unsigned char get_input_1021[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x48, 0x65, 0x6C, 0x6C,
+       0x6F, 0x91, 0x02, 0x05, 0xFF
+};
+
+static const unsigned char get_input_response_1021[] = {
+       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x81, 0x8d, 0x08, 0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
+};
+
+static const unsigned char get_input_1111[] = {
+       0xD0, 0x12, 0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x03, 0x08, 0x30, 0xEB, 0x91, 0x02, 0x05, 0x05
+};
+
+#define get_input_response_1111 get_input_response_311
+
+static const unsigned char get_input_1121[] = {
+       0xD0, 0x81, 0x9D, 0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x81, 0x82,
+       0x8D, 0x81, 0x8D, 0x08, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB, 0x30, 0xEB,
+       0x91, 0x02, 0x05, 0x05 };
+
+#define get_input_response_1121 get_input_response_311
+
+static const unsigned char get_input_1211[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x48, 0x65, 0x6C, 0x6C,
+       0x6F, 0x91, 0x02, 0x02, 0x02
+};
+
+static const unsigned char get_input_response_1211[] = {
+       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x05, 0x08, 0x30, 0xeb, 0x30, 0xeb,
+};
+
+static const unsigned char get_input_1221[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x81, 0x82, 0x8D,
+       0x0C, 0x04, 0x45, 0x6E, 0x74, 0x65, 0x72, 0x20, 0x48, 0x65, 0x6C, 0x6C,
+       0x6F, 0x91, 0x02, 0x05, 0xFF
+};
+
+static const unsigned char get_input_response_1221[] = {
+       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x8d, 0x81, 0x8d, 0x08, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
+};
+
+static const unsigned char more_time_111[] = {
+       0xD0, 0x09, 0x81, 0x03, 0x01, 0x02, 0x00, 0x82, 0x02, 0x81, 0x82
+};
+
+static const unsigned char more_time_response_111[] = {
+       0x81, 0x03, 0x01, 0x02, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+};
+
+static const unsigned char play_tone_111[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x09, 0x44, 0x69, 0x61, 0x6C, 0x20, 0x54, 0x6F, 0x6E, 0x65, 0x8E, 0x01,
+       0x01, 0x84, 0x02, 0x01, 0x05
+};
+
+static const unsigned char play_tone_response_111[] = {
+       0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+};
+
+static const unsigned char play_tone_112[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x09, 0x53, 0x75, 0x62, 0x2E, 0x20, 0x42, 0x75, 0x73, 0x79, 0x8E, 0x01,
+       0x02, 0x84, 0x02, 0x01, 0x05
+};
+
+#define play_tone_response_112 play_tone_response_111
+
+static const unsigned char play_tone_113[] = {
+       0xD0, 0x1C, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x0A, 0x43, 0x6F, 0x6E, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6F, 0x6E, 0x8E,
+       0x01, 0x03, 0x84, 0x02, 0x01, 0x05
+};
+
+#define play_tone_response_113 play_tone_response_111
+
+static const unsigned char play_tone_114[] = {
+       0xD0, 0x18, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x06, 0x52, 0x50, 0x20, 0x41, 0x63, 0x6B, 0x8E, 0x01, 0x04, 0x84, 0x02,
+       0x01, 0x05
+};
+
+#define play_tone_response_114 play_tone_response_111
+
+static const unsigned char play_tone_115[] = {
+       0xD0, 0x17, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x05, 0x4E, 0x6F, 0x20, 0x52, 0x50, 0x8E, 0x01, 0x05, 0x84, 0x02, 0x01,
+       0x05
+};
+
+#define play_tone_response_115 play_tone_response_111
+
+static const unsigned char play_tone_116[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x09, 0x53, 0x70, 0x65, 0x63, 0x20, 0x49, 0x6E, 0x66, 0x6F, 0x8E, 0x01,
+       0x06, 0x84, 0x02, 0x01, 0x05
+};
+
+#define play_tone_response_116 play_tone_response_111
+
+static const unsigned char play_tone_117[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x09, 0x43, 0x61, 0x6C, 0x6C, 0x20, 0x57, 0x61, 0x69, 0x74, 0x8E, 0x01,
+       0x07, 0x84, 0x02, 0x01, 0x05
+};
+
+#define play_tone_response_117 play_tone_response_111
+
+static const unsigned char play_tone_118[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x09, 0x52, 0x69, 0x6E, 0x67, 0x20, 0x54, 0x6F, 0x6E, 0x65, 0x8E, 0x01,
+       0x08, 0x84, 0x02, 0x01, 0x05
+};
+
+#define play_tone_response_118 play_tone_response_111
+
+static const unsigned char play_tone_119[] = {
+       0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03,
+       0x85, 0x81, 0xF1, 0x54, 0x68, 0x69, 0x73, 0x20, 0x63, 0x6F, 0x6D, 0x6D,
+       0x61, 0x6E, 0x64, 0x20, 0x69, 0x6E, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74,
+       0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4D, 0x45, 0x20, 0x74, 0x6F, 0x20,
+       0x70, 0x6C, 0x61, 0x79, 0x20, 0x61, 0x6E, 0x20, 0x61, 0x75, 0x64, 0x69,
+       0x6F, 0x20, 0x74, 0x6F, 0x6E, 0x65, 0x2E, 0x20, 0x55, 0x70, 0x6F, 0x6E,
+       0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x69, 0x6E, 0x67, 0x20, 0x74,
+       0x68, 0x69, 0x73, 0x20, 0x63, 0x6F, 0x6D, 0x6D, 0x61, 0x6E, 0x64, 0x2C,
+       0x20, 0x74, 0x68, 0x65, 0x20, 0x4D, 0x45, 0x20, 0x73, 0x68, 0x61, 0x6C,
+       0x6C, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6B, 0x20, 0x69, 0x66, 0x20, 0x69,
+       0x74, 0x20, 0x69, 0x73, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6E, 0x74,
+       0x6C, 0x79, 0x20, 0x69, 0x6E, 0x2C, 0x20, 0x6F, 0x72, 0x20, 0x69, 0x6E,
+       0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6F, 0x63, 0x65, 0x73, 0x73,
+       0x20, 0x6F, 0x66, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6E, 0x67, 0x20,
+       0x75, 0x70, 0x20, 0x28, 0x53, 0x45, 0x54, 0x2D, 0x55, 0x50, 0x20, 0x6D,
+       0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x73, 0x65, 0x6E, 0x74, 0x20,
+       0x74, 0x6F, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6E, 0x65, 0x74, 0x77, 0x6F,
+       0x72, 0x6B, 0x2C, 0x20, 0x73, 0x65, 0x65, 0x20, 0x47, 0x53, 0x4D, 0x22,
+       0x30, 0x34, 0x2E, 0x30, 0x38, 0x22, 0x28, 0x38, 0x29, 0x29, 0x2C, 0x20,
+       0x61, 0x20, 0x73, 0x70, 0x65, 0x65, 0x63, 0x68, 0x20, 0x63, 0x61, 0x6C,
+       0x6C, 0x2E, 0x20, 0x2D, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,
+       0x4D, 0x45, 0x20, 0x49
+};
+
+#define play_tone_response_119 play_tone_response_111
+
+static const unsigned char play_tone_1110[] = {
+       0xD0, 0x16, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x04, 0x42, 0x65, 0x65, 0x70, 0x8E, 0x01, 0x10, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_1110 play_tone_response_111
+
+static const unsigned char play_tone_1111[] = {
+       0xD0, 0x1A, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x08, 0x50, 0x6F, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x8E, 0x01, 0x11,
+       0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_1111 play_tone_response_111
+
+static const unsigned char play_tone_1112[] = {
+       0xD0, 0x1A, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x08, 0x4E, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x8E, 0x01, 0x12,
+       0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_1112 play_tone_response_111
+
+static const unsigned char play_tone_1113[] = {
+       0xD0, 0x17, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x05, 0x51, 0x75, 0x69, 0x63, 0x6B, 0x8E, 0x01, 0x10, 0x84, 0x02, 0x02,
+       0x02
+};
+
+#define play_tone_response_1113 play_tone_response_111
+
+static const unsigned char play_tone_1114[] = {
+       0xD0, 0x19, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x07, 0x3C, 0x41, 0x42, 0x4F, 0x52, 0x54, 0x3E, 0x8E, 0x01, 0x06, 0x84,
+       0x02, 0x00, 0x01
+};
+
+static const unsigned char play_tone_response_1114[] = {
+       0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x10,
+};
+
+static const unsigned char play_tone_1115[] = {
+       0xD0, 0x09, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03
+};
+
+#define play_tone_response_1115 play_tone_response_111
+
+static const unsigned char play_tone_211[] = {
+       0xD0, 0x2B, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x19, 0x80, 0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10, 0x04, 0x12,
+       0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04, 0x23, 0x04, 0x19, 0x04, 0x22,
+       0x04, 0x15, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_211 play_tone_response_111
+
+static const unsigned char play_tone_212[] = {
+       0xD0, 0x21, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x0F, 0x81, 0x0C, 0x08, 0x97, 0x94, 0xA0, 0x90, 0x92, 0xA1, 0xA2, 0x92,
+       0xA3, 0x99, 0xA2, 0x95, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_212 play_tone_response_111
+
+static const unsigned char play_tone_213[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x82, 0x0C, 0x04, 0x10, 0x87, 0x84, 0x90, 0x80, 0x82, 0x91, 0x92,
+       0x82, 0x93, 0x89, 0x92, 0x85, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_213 play_tone_response_111
+
+static const unsigned char play_tone_311[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x0C, 0x3C, 0x42, 0x41, 0x53, 0x49, 0x43, 0x2D, 0x49, 0x43, 0x4F, 0x4E,
+       0x3E, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01, 0x1E, 0x02, 0x00, 0x01
+};
+
+#define play_tone_response_311 play_tone_response_111
+
+static const unsigned char play_tone_321[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x0C, 0x3C, 0x42, 0x41, 0x53, 0x49, 0x43, 0x2D, 0x49, 0x43, 0x4F, 0x4E,
+       0x3E, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01, 0x1E, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_321 play_tone_response_111
+
+static const unsigned char play_tone_331[] = {
+       0xD0, 0x23, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x0D, 0x3C, 0x43, 0x4F, 0x4C, 0x4F, 0x55, 0x52, 0x2D, 0x49, 0x43, 0x4F,
+       0x4E, 0x3E, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01, 0x1E, 0x02, 0x00,
+       0x02
+};
+
+#define play_tone_response_331 play_tone_response_111
+
+static const unsigned char play_tone_341[] = {
+       0xD0, 0x23, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x0D, 0x3C, 0x43, 0x4F, 0x4C, 0x4F, 0x55, 0x52, 0x2D, 0x49, 0x43, 0x4F,
+       0x4E, 0x3E, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01, 0x1E, 0x02, 0x01,
+       0x02
+};
+
+#define play_tone_response_341 play_tone_response_111
+
+static const unsigned char play_tone_411[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x31, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x00, 0xB4
+};
+
+#define play_tone_response_411 play_tone_response_111
+
+static const unsigned char play_tone_412[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x32, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_412 play_tone_response_111
+
+static const unsigned char play_tone_421[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x31, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x01, 0xB4
+};
+
+#define play_tone_response_421 play_tone_response_111
+
+static const unsigned char play_tone_422[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x32, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_422 play_tone_response_111
+
+static const unsigned char play_tone_431[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x31, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x02, 0xB4
+};
+
+#define play_tone_response_431 play_tone_response_111
+
+static const unsigned char play_tone_432[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x32, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_432 play_tone_response_111
+
+static const unsigned char play_tone_441[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x31, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x04, 0xB4
+};
+
+#define play_tone_response_441 play_tone_response_111
+
+static const unsigned char play_tone_442[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x32, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x00, 0xB4
+};
+
+#define play_tone_response_442 play_tone_response_111
+
+static const unsigned char play_tone_443[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x33, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_443 play_tone_response_111
+
+static const unsigned char play_tone_451[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x31, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x08, 0xB4
+};
+
+#define play_tone_response_451 play_tone_response_111
+
+static const unsigned char play_tone_452[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x32, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x00, 0xB4
+};
+
+#define play_tone_response_452 play_tone_response_111
+
+static const unsigned char play_tone_453[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x33, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_453 play_tone_response_111
+
+static const unsigned char play_tone_461[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x31, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x0E, 0x10, 0xB4
+};
+
+#define play_tone_response_461 play_tone_response_111
+
+static const unsigned char play_tone_462[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x32, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x00, 0xB4
+};
+
+#define play_tone_response_462 play_tone_response_111
+
+static const unsigned char play_tone_463[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x33, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_463 play_tone_response_111
+
+static const unsigned char play_tone_471[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x31, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x0E, 0x20, 0xB4
+};
+
+#define play_tone_response_471 play_tone_response_111
+
+static const unsigned char play_tone_472[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x32, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x00, 0xB4
+};
+
+#define play_tone_response_472 play_tone_response_111
+
+static const unsigned char play_tone_473[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x33, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_473 play_tone_response_111
+
+static const unsigned char play_tone_481[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x31, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x40, 0xB4
+};
+
+#define play_tone_response_481 play_tone_response_111
+
+static const unsigned char play_tone_482[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x32, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x00, 0xB4
+};
+
+#define play_tone_response_482 play_tone_response_111
+
+static const unsigned char play_tone_483[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x33, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_483 play_tone_response_111
+
+static const unsigned char play_tone_491[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x31, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x80, 0xB4
+};
+
+#define play_tone_response_491 play_tone_response_111
+
+static const unsigned char play_tone_492[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x32, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x00, 0xB4
+};
+
+#define play_tone_response_492 play_tone_response_111
+
+static const unsigned char play_tone_493[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x33, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_493 play_tone_response_111
+
+static const unsigned char play_tone_4101[] = {
+       0xD0, 0x28, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x31, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01,
+       0xD0, 0x04, 0x00, 0x10, 0x00, 0xB4
+};
+
+#define play_tone_response_4101 play_tone_response_111
+
+static const unsigned char play_tone_4102[] = {
+       0xD0, 0x22, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x10, 0x54, 0x65, 0x78, 0x74, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+       0x75, 0x74, 0x65, 0x20, 0x32, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01, 0x01
+};
+
+#define play_tone_response_4102 play_tone_response_111
+
+static const unsigned char play_tone_511[] = {
+       0xD0, 0x17, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x05, 0x80, 0x4E, 0x2D, 0x4E, 0x00, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01,
+       0x01
+};
+
+#define play_tone_response_511 play_tone_response_111
+
+static const unsigned char play_tone_512[] = {
+       0xD0, 0x17, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x05, 0x81, 0x02, 0x9C, 0xAD, 0x80, 0x8E, 0x01, 0x11, 0x84, 0x02, 0x01,
+       0x01
+};
+
+#define play_tone_response_512 play_tone_response_111
+
+static const unsigned char play_tone_513[] = {
+       0xD0, 0x18, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x06, 0x82, 0x02, 0x4E, 0x00, 0xAD, 0x80, 0x8E, 0x01, 0x11, 0x84, 0x02,
+       0x01, 0x01
+};
+
+#define play_tone_response_513 play_tone_response_111
+
+static const unsigned char play_tone_611[] = {
+       0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x09, 0x80, 0x00, 0x38, 0x00, 0x30, 0x30, 0xEB, 0x00, 0x30, 0x8E, 0x01,
+       0x01, 0x84, 0x02, 0x01, 0x05
+};
+
+#define play_tone_response_611 play_tone_response_111
+
+static const unsigned char play_tone_612[] = {
+       0xD0, 0x19, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x07, 0x81, 0x04, 0x61, 0x38, 0x31, 0xEB, 0x31, 0x8E, 0x01, 0x01, 0x84,
+       0x02, 0x01, 0x05
+};
+
+#define play_tone_response_612 play_tone_response_111
+
+static const unsigned char play_tone_613[] = {
+       0xD0, 0x1A, 0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x81, 0x03, 0x85,
+       0x08, 0x82, 0x04, 0x30, 0xA0, 0x38, 0x32, 0xCB, 0x32, 0x8E, 0x01, 0x01,
+       0x84, 0x02, 0x01, 0x05
+};
+
+#define play_tone_response_613 play_tone_response_111
+
+static const unsigned char poll_interval_111[] = {
+       0xD0, 0x0D, 0x81, 0x03, 0x01, 0x03, 0x00, 0x82, 0x02, 0x81, 0x82, 0x84,
+       0x02, 0x01, 0x14
+};
+
+static const unsigned char poll_interval_response_111[] = {
+       0x81, 0x03, 0x01, 0x03, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83, 0x01, 0x00,
+       0x84, 0x02, 0x01, 0x14,
+};
index b61eba8..cf76a37 100644 (file)
@@ -395,9 +395,6 @@ static void test_ef_db(void)
 
        info = sim_ef_db_lookup(0x2F05);
        g_assert(info);
-
-       info = sim_ef_db_lookup(0x6FE3);
-       g_assert(info);
 }
 
 static const char *binary_ef = "62178202412183022F058A01058B032F060F8002000A"
@@ -448,7 +445,8 @@ static char *at_cuad_response = "611B4F10A0000000871002FFFFFFFF8905080000"
        "FFFFFFFFFFFFFFFFFFFFFFFFFF611F4F0CA000000063504B43532D"
        "313550094D49445066696C657351043F007F80";
 
-static void test_application_entry_decode(void) {
+static void test_application_entry_decode(void)
+{
        unsigned char *ef_dir;
        long len;
        GSList *entries;
@@ -474,6 +472,28 @@ static void test_application_entry_decode(void) {
        g_free(ef_dir);
 }
 
+static void test_get_3g_path(void)
+{
+       unsigned char path[6];
+       unsigned int len;
+       unsigned char path1[] = { 0x3F, 0x00, 0x7F, 0xFF };
+
+       len = sim_ef_db_get_path_3g(SIM_EFPNN_FILEID, path);
+       g_assert(len == 4);
+       g_assert(!memcmp(path, path1, len));
+}
+
+static void test_get_2g_path(void)
+{
+       unsigned char path[6];
+       unsigned int len;
+       unsigned char path1[] = { 0x3F, 0x00, 0x7F, 0x20 };
+
+       len = sim_ef_db_get_path_2g(SIM_EFPNN_FILEID, path);
+       g_assert(len == 4);
+       g_assert(!memcmp(path, path1, len));
+}
+
 int main(int argc, char **argv)
 {
        g_test_init(&argc, &argv, NULL);
@@ -490,6 +510,8 @@ int main(int argc, char **argv)
        g_test_add_func("/testsimutil/3G Status response", test_3g_status_data);
        g_test_add_func("/testsimutil/Application entries decoding",
                        test_application_entry_decode);
+       g_test_add_func("/testsimutil/3G path", test_get_3g_path);
+       g_test_add_func("/testsimutil/2G path", test_get_2g_path);
 
        return g_test_run();
 }
index 71da4e7..1aede08 100644 (file)
 #include "util.h"
 #include "smsutil.h"
 
+static const char *assembly_pdu1 = "038121F340048155550119906041001222048C0500"
+                                       "031E0301041804420430043A002C002004100"
+                                       "43B0435043A04410430043D04340440002000"
+                                       "200441043B044304480430043B00200437043"
+                                       "000200434043204350440044C044E00200020"
+                                       "04380020002004320441043500200431043E0"
+                                       "43B044C044804350020043F04400435043804"
+                                       "41043F043E043B043D044F043B0441044F002"
+                                       "000200433043D0435";
+static int assembly_pdu_len1 = 155;
+
+static const char *assembly_pdu2 = "038121F340048155550119906041001222048C0500"
+                                       "031E03020432043E043C002E000A041D04300"
+                                       "43A043E043D04350446002C0020043D043500"
+                                       "200432002004410438043B043004450020043"
+                                       "40430043B043504350020044204350440043F"
+                                       "04350442044C002C0020043E043D002004410"
+                                       "44204400435043C043804420435043B044C04"
+                                       "3D043E002004320431043504360430043B002"
+                                       "004320020043A043E";
+static int assembly_pdu_len2 = 155;
+
+static const char *assembly_pdu3 = "038121F340048155550119906041001222044A0500"
+                                       "031E0303043C043D043004420443002C00200"
+                                       "43F043E043704300431044B0432000A043404"
+                                       "3004360435002C002004470442043E0020002"
+                                       "00431044B043B0020043D04300433002E";
+static int assembly_pdu_len3 = 89;
+
 static void test_serialize_assembly(void)
 {
        unsigned char pdu[176];
index e510554..31e18f8 100644 (file)
@@ -1236,6 +1236,10 @@ static const char *cbs2 = "0110003201114679785E96371A8D46A3D168341A8D46A3D1683"
        "41A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168"
        "341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D100";
 
+static const char *cbs3 = "001000000111E280604028180E888462C168381E90886442A95"
+       "82E988C66C3E9783EA09068442A994EA8946AC56AB95EB0986C46ABD96EB89C6EC7EBF"
+       "97EC0A070482C1A8FC8A472C96C3A9FD0A8744AAD5AAFD8AC76CB05";
+
 static void test_cbs_encode_decode(void)
 {
        unsigned char *decoded_pdu;
@@ -1389,6 +1393,58 @@ static void test_cbs_assembly(void)
        cbs_assembly_free(assembly);
 }
 
+static void test_cbs_padding_character(void)
+{
+       unsigned char *decoded_pdu;
+       long pdu_len;
+       gboolean ret;
+       struct cbs cbs;
+       GSList *l;
+       char iso639_lang[3];
+       char *utf8;
+
+       decoded_pdu = decode_hex(cbs3, -1, &pdu_len, 0);
+
+       g_assert(decoded_pdu);
+       g_assert(pdu_len == 88);
+
+       ret = cbs_decode(decoded_pdu, pdu_len, &cbs);
+
+       g_free(decoded_pdu);
+
+       g_assert(ret);
+
+       g_assert(cbs.gs == CBS_GEO_SCOPE_CELL_IMMEDIATE);
+       g_assert(cbs.message_code == 1);
+       g_assert(cbs.update_number == 0);
+       g_assert(cbs.message_identifier == 0);
+       g_assert(cbs.dcs == 1);
+       g_assert(cbs.max_pages == 1);
+       g_assert(cbs.page == 1);
+
+       l = g_slist_append(NULL, &cbs);
+
+       utf8 = cbs_decode_text(l, iso639_lang);
+
+       g_assert(utf8);
+
+       if (g_test_verbose()) {
+               g_printf("%s\n", utf8);
+               if (iso639_lang[0] == '\0')
+                       g_printf("Lang: Unspecified\n");
+               else
+                       g_printf("Lang: %s\n", iso639_lang);
+       }
+
+       g_assert(strcmp(utf8, "b£$¥èéùìòÇ\x0AØø\x0DÅåΔ_ΦΓΛΩΠΨΣΘΞÆæßÉ !\"#¤"
+                               "\x25&'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLM"
+                               "NOPQRSTUVWXYZÄÖ") == 0);
+       g_assert(strcmp(iso639_lang, "en") == 0);
+
+       g_free(utf8);
+       g_slist_free(l);
+}
+
 static const char *ranges[] = { "1-5, 2, 3, 600, 569-900, 999",
                                "0-20, 33, 44, 50-60, 20-50, 1-5, 5, 3, 5",
                                NULL };
@@ -1679,6 +1735,9 @@ int main(int argc, char **argv)
                        test_cbs_encode_decode);
        g_test_add_func("/testsms/Test CBS Assembly", test_cbs_assembly);
 
+       g_test_add_func("/testsms/Test CBS Padding Character",
+                       test_cbs_padding_character);
+
        g_test_add_func("/testsms/Range minimizer", test_range_minimizer);
 
        g_test_add_func("/testsms/Status Report Assembly", test_sr_assembly);
index b0bea5f..77ec353 100644 (file)
@@ -37,6 +37,8 @@
 #include "stkutil.h"
 #include "util.h"
 
+#include "stk-test-data.h"
+
 #define MAX_ITEM 100
 
 struct sms_submit_test {
@@ -607,171 +609,6 @@ struct display_text_test {
        const char *html;
 };
 
-unsigned char display_text_111[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x0F,
-                                       0x04, 0x54, 0x6F, 0x6F, 0x6C, 0x6B,
-                                       0x69, 0x74, 0x20, 0x54, 0x65, 0x73,
-                                       0x74, 0x20, 0x31 };
-
-unsigned char display_text_131[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x21, 0x81,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x0F,
-                                       0x04, 0x54, 0x6F, 0x6F, 0x6C, 0x6B,
-                                       0x69, 0x74, 0x20, 0x54, 0x65, 0x73,
-                                       0x74, 0x20, 0x32 };
-
-unsigned char display_text_141[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x0E,
-                                       0x00, 0xD4, 0xF7, 0x9B, 0xBD, 0x4E,
-                                       0xD3, 0x41, 0xD4, 0xF2, 0x9C, 0x0E,
-                                       0x9A, 0x01 };
-
-unsigned char display_text_151[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x21, 0x00,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x0F,
-                                       0x04, 0x54, 0x6F, 0x6F, 0x6C, 0x6B,
-                                       0x69, 0x74, 0x20, 0x54, 0x65, 0x73,
-                                       0x74, 0x20, 0x34 };
-
-unsigned char display_text_161[] = { 0xD0, 0x81, 0xAD, 0x81, 0x03, 0x01, 0x21,
-                                       0x80, 0x82, 0x02, 0x81, 0x02, 0x8D,
-                                       0x81, 0xA1, 0x04, 0x54, 0x68, 0x69,
-                                       0x73, 0x20, 0x63, 0x6F, 0x6D, 0x6D,
-                                       0x61, 0x6E, 0x64, 0x20, 0x69, 0x6E,
-                                       0x73, 0x74, 0x72, 0x75, 0x63, 0x74,
-                                       0x73, 0x20, 0x74, 0x68, 0x65, 0x20,
-                                       0x4D, 0x45, 0x20, 0x74, 0x6F, 0x20,
-                                       0x64, 0x69, 0x73, 0x70, 0x6C, 0x61,
-                                       0x79, 0x20, 0x61, 0x20, 0x74, 0x65,
-                                       0x78, 0x74, 0x20, 0x6D, 0x65, 0x73,
-                                       0x73, 0x61, 0x67, 0x65, 0x2E, 0x20,
-                                       0x49, 0x74, 0x20, 0x61, 0x6C, 0x6C,
-                                       0x6F, 0x77, 0x73, 0x20, 0x74, 0x68,
-                                       0x65, 0x20, 0x53, 0x49, 0x4D, 0x20,
-                                       0x74, 0x6F, 0x20, 0x64, 0x65, 0x66,
-                                       0x69, 0x6E, 0x65, 0x20, 0x74, 0x68,
-                                       0x65, 0x20, 0x70, 0x72, 0x69, 0x6F,
-                                       0x72, 0x69, 0x74, 0x79, 0x20, 0x6F,
-                                       0x66, 0x20, 0x74, 0x68, 0x61, 0x74,
-                                       0x20, 0x6D, 0x65, 0x73, 0x73, 0x61,
-                                       0x67, 0x65, 0x2C, 0x20, 0x61, 0x6E,
-                                       0x64, 0x20, 0x74, 0x68, 0x65, 0x20,
-                                       0x74, 0x65, 0x78, 0x74, 0x20, 0x73,
-                                       0x74, 0x72, 0x69, 0x6E, 0x67, 0x20,
-                                       0x66, 0x6F, 0x72, 0x6D, 0x61, 0x74,
-                                       0x2E, 0x20, 0x54, 0x77, 0x6F, 0x20,
-                                       0x74, 0x79, 0x70, 0x65, 0x73, 0x20,
-                                       0x6F, 0x66, 0x20, 0x70, 0x72, 0x69,
-                                       0x6F };
-
-unsigned char display_text_171[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x0F,
-                                       0x04, 0x3C, 0x47, 0x4F, 0x2D, 0x42,
-                                       0x41, 0x43, 0x4B, 0x57, 0x41, 0x52,
-                                       0x44, 0x53, 0x3E };
-
-unsigned char display_text_511[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x0B,
-                                       0x04, 0x42, 0x61, 0x73, 0x69, 0x63,
-                                       0x20, 0x49, 0x63, 0x6F, 0x6E, 0x9E,
-                                       0x02, 0x00, 0x01 };
-
-unsigned char display_text_521[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x0C,
-                                       0x04, 0x43, 0x6F, 0x6C, 0x6F, 0x75,
-                                       0x72, 0x20, 0x49, 0x63, 0x6F, 0x6E,
-                                       0x9E, 0x02, 0x00, 0x02 };
-
-unsigned char display_text_531[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x0B,
-                                       0x04, 0x42, 0x61, 0x73, 0x69, 0x63,
-                                       0x20, 0x49, 0x63, 0x6F, 0x6E, 0x9E,
-                                       0x02, 0x01, 0x01 };
-
-unsigned char display_text_611[] = { 0xD0, 0x24, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x19,
-                                       0x08, 0x04, 0x17, 0x04, 0x14, 0x04,
-                                       0x20, 0x04, 0x10, 0x04, 0x12, 0x04,
-                                       0x21, 0x04, 0x22, 0x04, 0x12, 0x04,
-                                       0x23, 0x04, 0x19, 0x04, 0x22, 0x04,
-                                       0x15 };
-
-unsigned char display_text_711[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x0A,
-                                       0x04, 0x31, 0x30, 0x20, 0x53, 0x65,
-                                       0x63, 0x6F, 0x6E, 0x64, 0x84, 0x02,
-                                       0x01, 0x0A };
-
-unsigned char display_text_811[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x11,
-                                       0x04, 0x54, 0x65, 0x78, 0x74, 0x20,
-                                       0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
-                                       0x75, 0x74, 0x65, 0x20, 0x31, 0xD0,
-                                       0x04, 0x00, 0x10, 0x00, 0xB4 };
-
-unsigned char display_text_821[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x11,
-                                       0x04, 0x54, 0x65, 0x78, 0x74, 0x20,
-                                       0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
-                                       0x75, 0x74, 0x65, 0x20, 0x31, 0xD0,
-                                       0x04, 0x00, 0x10, 0x01, 0xB4 };
-
-unsigned char display_text_831[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x11,
-                                       0x04, 0x54, 0x65, 0x78, 0x74, 0x20,
-                                       0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
-                                       0x75, 0x74, 0x65, 0x20, 0x31, 0xD0,
-                                       0x04, 0x00, 0x10, 0x02, 0xB4 };
-
-unsigned char display_text_841[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x11,
-                                       0x04, 0x54, 0x65, 0x78, 0x74, 0x20,
-                                       0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
-                                       0x75, 0x74, 0x65, 0x20, 0x31, 0xD0,
-                                       0x04, 0x00, 0x10, 0x04, 0xB4 };
-
-unsigned char display_text_851[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x11,
-                                       0x04, 0x54, 0x65, 0x78, 0x74, 0x20,
-                                       0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
-                                       0x75, 0x74, 0x65, 0x20, 0x31, 0xD0,
-                                       0x04, 0x00, 0x10, 0x08, 0xB4 };
-
-unsigned char display_text_861[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x11,
-                                       0x04, 0x54, 0x65, 0x78, 0x74, 0x20,
-                                       0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
-                                       0x75, 0x74, 0x65, 0x20, 0x31, 0xD0,
-                                       0x04, 0x00, 0x10, 0x10, 0xB4 };
-
-unsigned char display_text_871[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x11,
-                                       0x04, 0x54, 0x65, 0x78, 0x74, 0x20,
-                                       0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
-                                       0x75, 0x74, 0x65, 0x20, 0x31, 0xD0,
-                                       0x04, 0x00, 0x10, 0x20, 0xB4 };
-
-unsigned char display_text_881[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x11,
-                                       0x04, 0x54, 0x65, 0x78, 0x74, 0x20,
-                                       0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
-                                       0x75, 0x74, 0x65, 0x20, 0x31, 0xD0,
-                                       0x04, 0x00, 0x10, 0x40, 0xB4 };
-
-unsigned char display_text_891[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x11,
-                                       0x04, 0x54, 0x65, 0x78, 0x74, 0x20,
-                                       0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
-                                       0x75, 0x74, 0x65, 0x20, 0x31, 0xD0,
-                                       0x04, 0x00, 0x10, 0x80, 0xB4 };
-
-unsigned char display_text_911[] = { 0xD0, 0x10, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x05,
-                                       0x08, 0x4F, 0x60, 0x59, 0x7D };
-
-unsigned char display_text_1011[] = { 0xD0, 0x12, 0x81, 0x03, 0x01, 0x21, 0x80,
-                                       0x82, 0x02, 0x81, 0x02, 0x8D, 0x07,
-                                       0x08, 0x00, 0x38, 0x00, 0x30, 0x30,
-                                       0xEB };
-
 static struct display_text_test display_text_data_111 = {
        .pdu = display_text_111,
        .pdu_len = sizeof(display_text_111),
@@ -963,7 +800,7 @@ static struct display_text_test display_text_data_871 = {
        },
        .html = "<div style=\"text-align: left;\"><span style=\"font-style: "
                "italic;color: #347235;background-color: #FFFF00;\">"
-               "Text Attribute 1</span>",
+               "Text Attribute 1</span></div>",
 };
 
 static struct display_text_test display_text_data_881 = {
@@ -991,7 +828,7 @@ static struct display_text_test display_text_data_891 = {
        },
        .html = "<div style=\"text-align: left;\"><span style=\""
                "text-decoration: line-through;color: #347235;"
-               "background-color: #FFFF00;\">Text Attribute 1</span>",
+               "background-color: #FFFF00;\">Text Attribute 1</span></div>",
 };
 
 static struct display_text_test display_text_data_911 = {
@@ -1054,164 +891,6 @@ struct get_inkey_test {
        char *html;
 };
 
-static unsigned char get_inkey_111[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x22,
-                                               0x2B, 0x22 };
-
-static unsigned char get_inkey_121[] = { 0xD0, 0x14, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x09, 0x00, 0x45, 0x37,
-                                               0xBD, 0x2C, 0x07, 0x89, 0x60,
-                                               0x22 };
-
-static unsigned char get_inkey_131[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0F, 0x04, 0x3C, 0x47,
-                                               0x4F, 0x2D, 0x42, 0x41, 0x43,
-                                               0x4B, 0x57, 0x41, 0x52, 0x44,
-                                               0x53, 0x3E };
-
-static unsigned char get_inkey_141[] = { 0xD0, 0x13, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x08, 0x04, 0x3C, 0x41,
-                                               0x42, 0x4F, 0x52, 0x54, 0x3E };
-
-static unsigned char get_inkey_151[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
-                                               0x01, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x22,
-                                               0x71, 0x22 };
-
-static unsigned char get_inkey_161[] = { 0xD0, 0x81, 0xAD, 0x81, 0x03, 0x01,
-                                               0x22, 0x01, 0x82, 0x02, 0x81,
-                                               0x82, 0x8D, 0x81, 0xA1, 0x04,
-                                               0x45, 0x6E, 0x74, 0x65, 0x72,
-                                               0x20, 0x22, 0x78, 0x22, 0x2E,
-                                               0x20, 0x54, 0x68, 0x69, 0x73,
-                                               0x20, 0x63, 0x6F, 0x6D, 0x6D,
-                                               0x61, 0x6E, 0x64, 0x20, 0x69,
-                                               0x6E, 0x73, 0x74, 0x72, 0x75,
-                                               0x63, 0x74, 0x73, 0x20, 0x74,
-                                               0x68, 0x65, 0x20, 0x4D, 0x45,
-                                               0x20, 0x74, 0x6F, 0x20, 0x64,
-                                               0x69, 0x73, 0x70, 0x6C, 0x61,
-                                               0x79, 0x20, 0x74, 0x65, 0x78,
-                                               0x74, 0x2C, 0x20, 0x61, 0x6E,
-                                               0x64, 0x20, 0x74, 0x6F, 0x20,
-                                               0x65, 0x78, 0x70, 0x65, 0x63,
-                                               0x74, 0x20, 0x74, 0x68, 0x65,
-                                               0x20, 0x75, 0x73, 0x65, 0x72,
-                                               0x20, 0x74, 0x6F, 0x20, 0x65,
-                                               0x6E, 0x74, 0x65, 0x72, 0x20,
-                                               0x61, 0x20, 0x73, 0x69, 0x6E,
-                                               0x67, 0x6C, 0x65, 0x20, 0x63,
-                                               0x68, 0x61, 0x72, 0x61, 0x63,
-                                               0x74, 0x65, 0x72, 0x2E, 0x20,
-                                               0x41, 0x6E, 0x79, 0x20, 0x72,
-                                               0x65, 0x73, 0x70, 0x6F, 0x6E,
-                                               0x73, 0x65, 0x20, 0x65, 0x6E,
-                                               0x74, 0x65, 0x72, 0x65, 0x64,
-                                               0x20, 0x62, 0x79, 0x20, 0x74,
-                                               0x68, 0x65, 0x20, 0x75, 0x73,
-                                               0x65, 0x72, 0x20, 0x73, 0x68,
-                                               0x61, 0x6C, 0x6C, 0x20, 0x62,
-                                               0x65, 0x20, 0x70, 0x61, 0x73,
-                                               0x73, 0x65, 0x64, 0x20, 0x74 };
-
-static unsigned char get_inkey_211[] = { 0xD0, 0x16, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0B, 0x04, 0x3C, 0x54,
-                                               0x49, 0x4D, 0x45, 0x2D, 0x4F,
-                                               0x55, 0x54, 0x3E };
-
-static unsigned char get_inkey_311[] = { 0xD0, 0x24, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x19, 0x08, 0x04, 0x17,
-                                               0x04, 0x14, 0x04, 0x20, 0x04,
-                                               0x10, 0x04, 0x12, 0x04, 0x21,
-                                               0x04, 0x22, 0x04, 0x12, 0x04,
-                                               0x23, 0x04, 0x19, 0x04, 0x22,
-                                               0x04, 0x15 };
-
-static unsigned char get_inkey_321[] = { 0xD0, 0x81, 0x99, 0x81, 0x03, 0x01,
-                                               0x22, 0x00, 0x82, 0x02, 0x81,
-                                               0x82, 0x8D, 0x81, 0x8D, 0x08,
-                                               0x04, 0x17, 0x04, 0x14, 0x04,
-                                               0x20, 0x04, 0x10, 0x04, 0x12,
-                                               0x04, 0x21, 0x04, 0x22, 0x04,
-                                               0x12, 0x04, 0x23, 0x04, 0x19,
-                                               0x04, 0x22, 0x04, 0x15, 0x04,
-                                               0x17, 0x04, 0x14, 0x04, 0x20,
-                                               0x04, 0x10, 0x04, 0x12, 0x04,
-                                               0x21, 0x04, 0x22, 0x04, 0x12,
-                                               0x04, 0x23, 0x04, 0x19, 0x04,
-                                               0x22, 0x04, 0x15, 0x04, 0x17,
-                                               0x04, 0x14, 0x04, 0x20, 0x04,
-                                               0x10, 0x04, 0x12, 0x04, 0x21,
-                                               0x04, 0x22, 0x04, 0x12, 0x04,
-                                               0x23, 0x04, 0x19, 0x04, 0x22,
-                                               0x04, 0x15, 0x04, 0x17, 0x04,
-                                               0x14, 0x04, 0x20, 0x04, 0x10,
-                                               0x04, 0x12, 0x04, 0x21, 0x04,
-                                               0x22, 0x04, 0x12, 0x04, 0x23,
-                                               0x04, 0x19, 0x04, 0x22, 0x04,
-                                               0x15, 0x04, 0x17, 0x04, 0x14,
-                                               0x04, 0x20, 0x04, 0x10, 0x04,
-                                               0x12, 0x04, 0x21, 0x04, 0x22,
-                                               0x04, 0x12, 0x04, 0x23, 0x04,
-                                               0x19, 0x04, 0x22, 0x04, 0x15,
-                                               0x04, 0x17, 0x04, 0x14, 0x04,
-                                               0x20, 0x04, 0x10, 0x04, 0x12,
-                                               0x04, 0x21, 0x04, 0x22, 0x04,
-                                               0x12, 0x04, 0x23, 0x04, 0x19 };
-
-static unsigned char get_inkey_411[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x22,
-                                               0x03, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x06, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72 };
-
-static unsigned char get_inkey_511[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
-                                               0x04, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x59,
-                                               0x45, 0x53 };
-
-static unsigned char get_inkey_512[] = { 0xD0, 0x14, 0x81, 0x03, 0x01, 0x22,
-                                               0x04, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x09, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x4E,
-                                               0x4F };
-
-static unsigned char get_inkey_611[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x3C, 0x4E,
-                                               0x4F, 0x2D, 0x49, 0x43, 0x4F,
-                                               0x4E, 0x3E, 0x1E, 0x02, 0x00,
-                                               0x01 };
-
-static unsigned char get_inkey_621[] = { 0xD0, 0x1C, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0D, 0x04, 0x3C, 0x42,
-                                               0x41, 0x53, 0x49, 0x43, 0x2D,
-                                               0x49, 0x43, 0x4F, 0x4E, 0x3E,
-                                               0x1E, 0x02, 0x01, 0x01 };
-
-static unsigned char get_inkey_631[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x3C, 0x4E,
-                                               0x4F, 0x2D, 0x49, 0x43, 0x4F,
-                                               0x4E, 0x3E, 0x1E, 0x02, 0x00,
-                                               0x02 };
-
-static unsigned char get_inkey_641[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0E, 0x04, 0x3C, 0x43,
-                                               0x4F, 0x4C, 0x4F, 0x55, 0x52,
-                                               0x2D, 0x49, 0x43, 0x4F, 0x4E,
-                                               0x3E, 0x1E, 0x02, 0x01, 0x02 };
-
 static unsigned char get_inkey_711[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
                                                0x80, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0A, 0x04, 0x45, 0x6E,
@@ -1224,59 +903,24 @@ static unsigned char get_inkey_712[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
                                                0x74, 0x65, 0x72, 0x20, 0x22,
                                                0x2B, 0x22 };
 
-static unsigned char get_inkey_811[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x22,
-                                               0x2B, 0x22, 0x84, 0x02, 0x01,
-                                               0x0A };
-
-static unsigned char get_inkey_911[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x22,
-                                               0x2B, 0x22, 0xD0, 0x04, 0x00,
-                                               0x09, 0x00, 0xB4 };
-
 static unsigned char get_inkey_912[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0A, 0x04, 0x45, 0x6E,
                                                0x74, 0x65, 0x72, 0x20, 0x22,
                                                0x23, 0x22 };
 
-static unsigned char get_inkey_921[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x22,
-                                               0x2B, 0x22, 0xD0, 0x04, 0x00,
-                                               0x09, 0x01, 0xB4 };
-
 static unsigned char get_inkey_922[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0A, 0x04, 0x45, 0x6E,
                                                0x74, 0x65, 0x72, 0x20, 0x22,
                                                0x23, 0x22 };
 
-static unsigned char get_inkey_931[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x22,
-                                               0x2B, 0x22, 0xD0, 0x04, 0x00,
-                                               0x09, 0x02, 0xB4 };
-
 static unsigned char get_inkey_932[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0A, 0x04, 0x45, 0x6E,
                                                0x74, 0x65, 0x72, 0x20, 0x22,
                                                0x23, 0x22 };
 
-static unsigned char get_inkey_941[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x22,
-                                               0x2B, 0x22, 0xD0, 0x04, 0x00,
-                                               0x09, 0x04, 0xB4 };
-
 static unsigned char get_inkey_942[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0A, 0x04, 0x45, 0x6E,
@@ -1290,13 +934,6 @@ static unsigned char get_inkey_943[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
                                                0x74, 0x65, 0x72, 0x20, 0x22,
                                                0x23, 0x22 };
 
-static unsigned char get_inkey_951[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x22,
-                                               0x2B, 0x22, 0xD0, 0x04, 0x00,
-                                               0x09, 0x08, 0xB4 };
-
 static unsigned char get_inkey_952[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0A, 0x04, 0x45, 0x6E,
@@ -1310,13 +947,6 @@ static unsigned char get_inkey_953[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
                                                0x74, 0x65, 0x72, 0x20, 0x22,
                                                0x23, 0x22 };
 
-static unsigned char get_inkey_961[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x22,
-                                               0x2B, 0x22, 0xD0, 0x04, 0x00,
-                                               0x09, 0x10, 0xB4 };
-
 static unsigned char get_inkey_962[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0A, 0x04, 0x45, 0x6E,
@@ -1330,13 +960,6 @@ static unsigned char get_inkey_963[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
                                                0x74, 0x65, 0x72, 0x20, 0x22,
                                                0x23, 0x22 };
 
-static unsigned char get_inkey_971[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x22,
-                                               0x2B, 0x22, 0xD0, 0x04, 0x00,
-                                               0x09, 0x20, 0xB4 };
-
 static unsigned char get_inkey_972[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0A, 0x04, 0x45, 0x6E,
@@ -1350,13 +973,6 @@ static unsigned char get_inkey_973[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
                                                0x74, 0x65, 0x72, 0x20, 0x22,
                                                0x23, 0x22 };
 
-static unsigned char get_inkey_981[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x22,
-                                               0x2B, 0x22, 0xD0, 0x04, 0x00,
-                                               0x09, 0x40, 0xB4 };
-
 static unsigned char get_inkey_982[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0A, 0x04, 0x45, 0x6E,
@@ -1370,13 +986,6 @@ static unsigned char get_inkey_983[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
                                                0x74, 0x65, 0x72, 0x20, 0x22,
                                                0x23, 0x22 };
 
-static unsigned char get_inkey_991[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x22,
-                                               0x2B, 0x22, 0xD0, 0x04, 0x00,
-                                               0x09, 0x80, 0xB4 };
-
 static unsigned char get_inkey_992a[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0A, 0x04, 0x45, 0x6E,
@@ -1396,102 +1005,12 @@ static unsigned char get_inkey_993[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
                                                0x74, 0x65, 0x72, 0x20, 0x22,
                                                0x23, 0x22 };
 
-static unsigned char get_inkey_9101[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x22,
-                                               0x2B, 0x22, 0xD0, 0x04, 0x00,
-                                               0x09, 0x00, 0xB4 };
-
 static unsigned char get_inkey_9102[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0A, 0x04, 0x45, 0x6E,
                                                0x74, 0x65, 0x72, 0x20, 0x22,
                                                0x23, 0x22 };
 
-static unsigned char get_inkey_1011[] = { 0xD0, 0x10, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x05, 0x08, 0x4F, 0x60,
-                                               0x59, 0x7D };
-
-static unsigned char get_inkey_1021[] = { 0xD0, 0x81, 0x99, 0x81, 0x03, 0x01,
-                                               0x22, 0x00, 0x82, 0x02, 0x81,
-                                               0x82, 0x8D, 0x81, 0x8D, 0x08,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D };
-
-static unsigned char get_inkey_1111[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x22,
-                                               0x03, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x06, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72 };
-
-static unsigned char get_inkey_1211[] = { 0xD0, 0x0E, 0x81, 0x03, 0x01, 0x22,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x03, 0x08, 0x30, 0xEB };
-
-static unsigned char get_inkey_1221[] = { 0xD0, 0x81, 0x99, 0x81, 0x03, 0x01,
-                                               0x22, 0x00, 0x82, 0x02, 0x81,
-                                               0x82, 0x8D, 0x81, 0x8D, 0x08,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB };
-
-static unsigned char get_inkey_1311[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x22,
-                                               0x03, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x06, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72 };
-
 static struct get_inkey_test get_inkey_data_111 = {
        .pdu = get_inkey_111,
        .pdu_len = sizeof(get_inkey_111),
@@ -2034,249 +1553,6 @@ struct get_input_test {
        char *html;
 };
 
-static unsigned char get_input_111[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x31,
-                                               0x32, 0x33, 0x34, 0x35, 0x91,
-                                               0x02, 0x05, 0x05 };
-
-static unsigned char get_input_121[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x23,
-                                               0x08, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0B, 0x00, 0x45, 0x37,
-                                               0xBD, 0x2C, 0x07, 0xD9, 0x6E,
-                                               0xAA, 0xD1, 0x0A, 0x91, 0x02,
-                                               0x05, 0x05 };
-
-static unsigned char get_input_131[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
-                                               0x01, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x41,
-                                               0x62, 0x43, 0x64, 0x45, 0x91,
-                                               0x02, 0x05, 0x05 };
-
-static unsigned char get_input_141[] = { 0xD0, 0x27, 0x81, 0x03, 0x01, 0x23,
-                                               0x04, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x18, 0x04, 0x50, 0x61,
-                                               0x73, 0x73, 0x77, 0x6F, 0x72,
-                                               0x64, 0x20, 0x31, 0x3C, 0x53,
-                                               0x45, 0x4E, 0x44, 0x3E, 0x32,
-                                               0x33, 0x34, 0x35, 0x36, 0x37,
-                                               0x38, 0x91, 0x02, 0x04, 0x08 };
-
-static unsigned char get_input_151[] = { 0xD0, 0x24, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x15, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x31,
-                                               0x2E, 0x2E, 0x39, 0x2C, 0x30,
-                                               0x2E, 0x2E, 0x39, 0x2C, 0x30,
-                                               0x28, 0x31, 0x29, 0x91, 0x02,
-                                               0x01, 0x14 };
-
-static unsigned char get_input_161[] = { 0xD0, 0x1E, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0F, 0x04, 0x3C, 0x47,
-                                               0x4F, 0x2D, 0x42, 0x41, 0x43,
-                                               0x4B, 0x57, 0x41, 0x52, 0x44,
-                                               0x53, 0x3E, 0x91, 0x02, 0x00,
-                                               0x08 };
-
-static unsigned char get_input_171[] = { 0xD0, 0x17, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x08, 0x04, 0x3C, 0x41,
-                                               0x42, 0x4F, 0x52, 0x54, 0x3E,
-                                               0x91, 0x02, 0x00, 0x08 };
-
-static unsigned char get_input_181[] = { 0xD0, 0x81, 0xB1, 0x81, 0x03, 0x01,
-                                               0x23, 0x00, 0x82, 0x02, 0x81,
-                                               0x82, 0x8D, 0x81, 0xA1, 0x04,
-                                               0x2A, 0x2A, 0x2A, 0x31, 0x31,
-                                               0x31, 0x31, 0x31, 0x31, 0x31,
-                                               0x31, 0x31, 0x31, 0x23, 0x23,
-                                               0x23, 0x2A, 0x2A, 0x2A, 0x32,
-                                               0x32, 0x32, 0x32, 0x32, 0x32,
-                                               0x32, 0x32, 0x32, 0x32, 0x23,
-                                               0x23, 0x23, 0x2A, 0x2A, 0x2A,
-                                               0x33, 0x33, 0x33, 0x33, 0x33,
-                                               0x33, 0x33, 0x33, 0x33, 0x33,
-                                               0x23, 0x23, 0x23, 0x2A, 0x2A,
-                                               0x2A, 0x34, 0x34, 0x34, 0x34,
-                                               0x34, 0x34, 0x34, 0x34, 0x34,
-                                               0x34, 0x23, 0x23, 0x23, 0x2A,
-                                               0x2A, 0x2A, 0x35, 0x35, 0x35,
-                                               0x35, 0x35, 0x35, 0x35, 0x35,
-                                               0x35, 0x35, 0x23, 0x23, 0x23,
-                                               0x2A, 0x2A, 0x2A, 0x36, 0x36,
-                                               0x36, 0x36, 0x36, 0x36, 0x36,
-                                               0x36, 0x36, 0x36, 0x23, 0x23,
-                                               0x23, 0x2A, 0x2A, 0x2A, 0x37,
-                                               0x37, 0x37, 0x37, 0x37, 0x37,
-                                               0x37, 0x37, 0x37, 0x37, 0x23,
-                                               0x23, 0x23, 0x2A, 0x2A, 0x2A,
-                                               0x38, 0x38, 0x38, 0x38, 0x38,
-                                               0x38, 0x38, 0x38, 0x38, 0x38,
-                                               0x23, 0x23, 0x23, 0x2A, 0x2A,
-                                               0x2A, 0x39, 0x39, 0x39, 0x39,
-                                               0x39, 0x39, 0x39, 0x39, 0x39,
-                                               0x39, 0x23, 0x23, 0x23, 0x2A,
-                                               0x2A, 0x2A, 0x30, 0x30, 0x30,
-                                               0x30, 0x30, 0x30, 0x30, 0x30,
-                                               0x30, 0x30, 0x23, 0x23, 0x23,
-                                               0x91, 0x02, 0xA0, 0xA0 };
-
-static unsigned char get_input_191[] = { 0xD0, 0x16, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x07, 0x04, 0x3C, 0x53,
-                                               0x45, 0x4E, 0x44, 0x3E, 0x91,
-                                               0x02, 0x00, 0x01 };
-
-static unsigned char get_input_1101[] = { 0xD0, 0x0F, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x00, 0x91, 0x02, 0x01,
-                                               0x05 };
-
-static unsigned char get_input_211[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0B, 0x04, 0x3C, 0x54,
-                                               0x49, 0x4D, 0x45, 0x2D, 0x4F,
-                                               0x55, 0x54, 0x3E, 0x91, 0x02,
-                                               0x00, 0x0A };
-
-static unsigned char get_input_311[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x23,
-                                               0x01, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x19, 0x08, 0x04, 0x17,
-                                               0x04, 0x14, 0x04, 0x20, 0x04,
-                                               0x10, 0x04, 0x12, 0x04, 0x21,
-                                               0x04, 0x22, 0x04, 0x12, 0x04,
-                                               0x23, 0x04, 0x19, 0x04, 0x22,
-                                               0x04, 0x15, 0x91, 0x02, 0x05,
-                                               0x05 };
-
-static unsigned char get_input_321[] = { 0xD0, 0x81, 0x9D, 0x81, 0x03, 0x01,
-                                               0x23, 0x01, 0x82, 0x02, 0x81,
-                                               0x82, 0x8D, 0x81, 0x8D, 0x08,
-                                               0x04, 0x17, 0x04, 0x14, 0x04,
-                                               0x20, 0x04, 0x10, 0x04, 0x12,
-                                               0x04, 0x21, 0x04, 0x22, 0x04,
-                                               0x12, 0x04, 0x23, 0x04, 0x19,
-                                               0x04, 0x22, 0x04, 0x15, 0x04,
-                                               0x17, 0x04, 0x14, 0x04, 0x20,
-                                               0x04, 0x10, 0x04, 0x12, 0x04,
-                                               0x21, 0x04, 0x22, 0x04, 0x12,
-                                               0x04, 0x23, 0x04, 0x19, 0x04,
-                                               0x22, 0x04, 0x15, 0x04, 0x17,
-                                               0x04, 0x14, 0x04, 0x20, 0x04,
-                                               0x10, 0x04, 0x12, 0x04, 0x21,
-                                               0x04, 0x22, 0x04, 0x12, 0x04,
-                                               0x23, 0x04, 0x19, 0x04, 0x22,
-                                               0x04, 0x15, 0x04, 0x17, 0x04,
-                                               0x14, 0x04, 0x20, 0x04, 0x10,
-                                               0x04, 0x12, 0x04, 0x21, 0x04,
-                                               0x22, 0x04, 0x12, 0x04, 0x23,
-                                               0x04, 0x19, 0x04, 0x22, 0x04,
-                                               0x15, 0x04, 0x17, 0x04, 0x14,
-                                               0x04, 0x20, 0x04, 0x10, 0x04,
-                                               0x12, 0x04, 0x21, 0x04, 0x22,
-                                               0x04, 0x12, 0x04, 0x23, 0x04,
-                                               0x19, 0x04, 0x22, 0x04, 0x15,
-                                               0x04, 0x17, 0x04, 0x14, 0x04,
-                                               0x20, 0x04, 0x10, 0x04, 0x12,
-                                               0x04, 0x21, 0x04, 0x22, 0x04,
-                                               0x12, 0x04, 0x23, 0x04, 0x19,
-                                               0x91, 0x02, 0x05, 0x05 };
-
-static unsigned char get_input_411[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
-                                               0x03, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x48,
-                                               0x65, 0x6C, 0x6C, 0x6F, 0x91,
-                                               0x02, 0x0C, 0x0C };
-
-static unsigned char get_input_421[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
-                                               0x03, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x48,
-                                               0x65, 0x6C, 0x6C, 0x6F, 0x91,
-                                               0x02, 0x05, 0xFF };
-
-static unsigned char get_input_511[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x31,
-                                               0x32, 0x33, 0x34, 0x35, 0x91,
-                                               0x02, 0x05, 0x05, 0x17, 0x06,
-                                               0x04, 0x31, 0x32, 0x33, 0x34,
-                                               0x35 };
-
-static unsigned char get_input_521[] = { 0xD0, 0x81, 0xBA, 0x81, 0x03, 0x01,
-                                               0x23, 0x00, 0x82, 0x02, 0x81,
-                                               0x82, 0x8D, 0x07, 0x04, 0x45,
-                                               0x6E, 0x74, 0x65, 0x72, 0x3A,
-                                               0x91, 0x02, 0xA0, 0xA0, 0x17,
-                                               0x81, 0xA1, 0x04, 0x2A, 0x2A,
-                                               0x2A, 0x31, 0x31, 0x31, 0x31,
-                                               0x31, 0x31, 0x31, 0x31, 0x31,
-                                               0x31, 0x23, 0x23, 0x23, 0x2A,
-                                               0x2A, 0x2A, 0x32, 0x32, 0x32,
-                                               0x32, 0x32, 0x32, 0x32, 0x32,
-                                               0x32, 0x32, 0x23, 0x23, 0x23,
-                                               0x2A, 0x2A, 0x2A, 0x33, 0x33,
-                                               0x33, 0x33, 0x33, 0x33, 0x33,
-                                               0x33, 0x33, 0x33, 0x23, 0x23,
-                                               0x23, 0x2A, 0x2A, 0x2A, 0x34,
-                                               0x34, 0x34, 0x34, 0x34, 0x34,
-                                               0x34, 0x34, 0x34, 0x34, 0x23,
-                                               0x23, 0x23, 0x2A, 0x2A, 0x2A,
-                                               0x35, 0x35, 0x35, 0x35, 0x35,
-                                               0x35, 0x35, 0x35, 0x35, 0x35,
-                                               0x23, 0x23, 0x23, 0x2A, 0x2A,
-                                               0x2A, 0x36, 0x36, 0x36, 0x36,
-                                               0x36, 0x36, 0x36, 0x36, 0x36,
-                                               0x36, 0x23, 0x23, 0x23, 0x2A,
-                                               0x2A, 0x2A, 0x37, 0x37, 0x37,
-                                               0x37, 0x37, 0x37, 0x37, 0x37,
-                                               0x37, 0x37, 0x23, 0x23, 0x23,
-                                               0x2A, 0x2A, 0x2A, 0x38, 0x38,
-                                               0x38, 0x38, 0x38, 0x38, 0x38,
-                                               0x38, 0x38, 0x38, 0x23, 0x23,
-                                               0x23, 0x2A, 0x2A, 0x2A, 0x39,
-                                               0x39, 0x39, 0x39, 0x39, 0x39,
-                                               0x39, 0x39, 0x39, 0x39, 0x23,
-                                               0x23, 0x23, 0x2A, 0x2A, 0x2A,
-                                               0x30, 0x30, 0x30, 0x30, 0x30,
-                                               0x30, 0x30, 0x30, 0x30, 0x30,
-                                               0x23, 0x23, 0x23 };
-
-static unsigned char get_input_611[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x3C, 0x4E,
-                                               0x4F, 0x2D, 0x49, 0x43, 0x4F,
-                                               0x4E, 0x3E, 0x91, 0x02, 0x00,
-                                               0x0A, 0x1E, 0x02, 0x00, 0x01 };
-
-static unsigned char get_input_621[] = { 0xD0, 0x20, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0D, 0x04, 0x3C, 0x42,
-                                               0x41, 0x53, 0x49, 0x43, 0x2D,
-                                               0x49, 0x43, 0x4F, 0x4E, 0x3E,
-                                               0x91, 0x02, 0x00, 0x0A, 0x1E,
-                                               0x02, 0x01, 0x01 };
-
-static unsigned char get_input_631[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0A, 0x04, 0x3C, 0x4E,
-                                               0x4F, 0x2D, 0x49, 0x43, 0x4F,
-                                               0x4E, 0x3E, 0x91, 0x02, 0x00,
-                                               0x0A, 0x1E, 0x02, 0x00, 0x02 };
-
-static unsigned char get_input_641[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0E, 0x04, 0x3C, 0x43,
-                                               0x4F, 0x4C, 0x4F, 0x55, 0x52,
-                                               0x2D, 0x49, 0x43, 0x4F, 0x4E,
-                                               0x3E, 0x91, 0x02, 0x00, 0x0A,
-                                               0x1E, 0x02, 0x01, 0x02 };
-
 static unsigned char get_input_711[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x80, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0C, 0x04, 0x45, 0x6E,
@@ -2284,14 +1560,6 @@ static unsigned char get_input_711[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x32, 0x33, 0x34, 0x35, 0x91,
                                                0x02, 0x05, 0x05 };
 
-static unsigned char get_input_811[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x31,
-                                               0x32, 0x33, 0x34, 0x35, 0x91,
-                                               0x02, 0x05, 0x05, 0xD0, 0x04,
-                                               0x00, 0x0B, 0x00, 0xB4 };
-
 static unsigned char get_input_812[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0C, 0x04, 0x45, 0x6E,
@@ -2299,14 +1567,6 @@ static unsigned char get_input_812[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x32, 0x32, 0x32, 0x32, 0x91,
                                                0x02, 0x05, 0x05 };
 
-static unsigned char get_input_821[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x31,
-                                               0x32, 0x33, 0x34, 0x35, 0x91,
-                                               0x02, 0x05, 0x05, 0xD0, 0x04,
-                                               0x00, 0x0B, 0x01, 0xB4 };
-
 static unsigned char get_input_822[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0C, 0x04, 0x45, 0x6E,
@@ -2314,14 +1574,6 @@ static unsigned char get_input_822[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x32, 0x32, 0x32, 0x32, 0x91,
                                                0x02, 0x05, 0x05 };
 
-static unsigned char get_input_831[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x31,
-                                               0x32, 0x33, 0x34, 0x35, 0x91,
-                                               0x02, 0x05, 0x05, 0xD0, 0x04,
-                                               0x00, 0x0B, 0x02, 0xB4 };
-
 static unsigned char get_input_832[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0C, 0x04, 0x45, 0x6E,
@@ -2329,14 +1581,6 @@ static unsigned char get_input_832[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x32, 0x32, 0x32, 0x32, 0x91,
                                                0x02, 0x05, 0x05 };
 
-static unsigned char get_input_841[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x31,
-                                               0x32, 0x33, 0x34, 0x35, 0x91,
-                                               0x02, 0x05, 0x05, 0xD0, 0x04,
-                                               0x00, 0x0B, 0x04, 0xB4 };
-
 static unsigned char get_input_842[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0C, 0x04, 0x45, 0x6E,
@@ -2352,14 +1596,6 @@ static unsigned char get_input_843[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x33, 0x33, 0x33, 0x33, 0x91,
                                                0x02, 0x05, 0x05 };
 
-static unsigned char get_input_851[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x31,
-                                               0x32, 0x33, 0x34, 0x35, 0x91,
-                                               0x02, 0x05, 0x05, 0xD0, 0x04,
-                                               0x00, 0x0B, 0x08, 0xB4 };
-
 static unsigned char get_input_852[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0C, 0x04, 0x45, 0x6E,
@@ -2375,14 +1611,6 @@ static unsigned char get_input_853[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x33, 0x33, 0x33, 0x33, 0x91,
                                                0x02, 0x05, 0x05 };
 
-static unsigned char get_input_861[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x31,
-                                               0x32, 0x33, 0x34, 0x35, 0x91,
-                                               0x02, 0x05, 0x05, 0xD0, 0x04,
-                                               0x00, 0x0B, 0x10, 0xB4 };
-
 static unsigned char get_input_862[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0C, 0x04, 0x45, 0x6E,
@@ -2398,14 +1626,6 @@ static unsigned char get_input_863[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x33, 0x33, 0x33, 0x33, 0x91,
                                                0x02, 0x05, 0x05 };
 
-static unsigned char get_input_871[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x31,
-                                               0x32, 0x33, 0x34, 0x35, 0x91,
-                                               0x02, 0x05, 0x05, 0xD0, 0x04,
-                                               0x00, 0x0B, 0x20, 0xB4 };
-
 static unsigned char get_input_872[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0C, 0x04, 0x45, 0x6E,
@@ -2421,14 +1641,6 @@ static unsigned char get_input_873[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x33, 0x33, 0x33, 0x33, 0x91,
                                                0x02, 0x05, 0x05 };
 
-static unsigned char get_input_881[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x31,
-                                               0x32, 0x33, 0x34, 0x35, 0x91,
-                                               0x02, 0x05, 0x05, 0xD0, 0x04,
-                                               0x00, 0x0B, 0x40, 0xB4 };
-
 static unsigned char get_input_882[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0C, 0x04, 0x45, 0x6E,
@@ -2444,14 +1656,6 @@ static unsigned char get_input_883[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x33, 0x33, 0x33, 0x33, 0x91,
                                                0x02, 0x05, 0x05 };
 
-static unsigned char get_input_891[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x31,
-                                               0x32, 0x33, 0x34, 0x35, 0x91,
-                                               0x02, 0x05, 0x05, 0xD0, 0x04,
-                                               0x00, 0x0B, 0x80, 0xB4 };
-
 static unsigned char get_input_892[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0C, 0x04, 0x45, 0x6E,
@@ -2467,14 +1671,6 @@ static unsigned char get_input_893[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x33, 0x33, 0x33, 0x33, 0x91,
                                                0x02, 0x05, 0x05 };
 
-static unsigned char get_input_8101[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x31,
-                                               0x32, 0x33, 0x34, 0x35, 0x91,
-                                               0x02, 0x05, 0x05, 0xD0, 0x04,
-                                               0x00, 0x0B, 0x00, 0xB4 };
-
 static unsigned char get_input_8102[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x00, 0x82, 0x02, 0x81, 0x82,
                                                0x8D, 0x0C, 0x04, 0x45, 0x6E,
@@ -2482,111 +1678,6 @@ static unsigned char get_input_8102[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
                                                0x32, 0x32, 0x32, 0x32, 0x91,
                                                0x02, 0x05, 0x05 };
 
-static unsigned char get_input_911[] = { 0xD0, 0x14, 0x81, 0x03, 0x01, 0x23,
-                                               0x01, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x05, 0x08, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x91, 0x02, 0x05,
-                                               0x05 };
-
-static unsigned char get_input_921[] = { 0xD0, 0x81, 0x9D, 0x81, 0x03, 0x01,
-                                               0x23, 0x01, 0x82, 0x02, 0x81,
-                                               0x82, 0x8D, 0x81, 0x8D, 0x08,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D,
-                                               0x4F, 0x60, 0x59, 0x7D, 0x4F,
-                                               0x60, 0x59, 0x7D, 0x4F, 0x60,
-                                               0x59, 0x7D, 0x4F, 0x60, 0x59,
-                                               0x7D, 0x4F, 0x60, 0x59, 0x7D,
-                                               0x91, 0x02, 0x05, 0x05 };
-
-static unsigned char get_input_1011[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
-                                               0x03, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x48,
-                                               0x65, 0x6C, 0x6C, 0x6F, 0x91,
-                                               0x02, 0x02, 0x02 };
-
-static unsigned char get_input_1021[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
-                                               0x03, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x48,
-                                               0x65, 0x6C, 0x6C, 0x6F, 0x91,
-                                               0x02, 0x05, 0xFF };
-
-static unsigned char get_input_1111[] = { 0xD0, 0x12, 0x81, 0x03, 0x01, 0x23,
-                                               0x01, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x03, 0x08, 0x30, 0xEB,
-                                               0x91, 0x02, 0x05, 0x05 };
-
-static unsigned char get_input_1121[] = { 0xD0, 0x81, 0x9D, 0x81, 0x03, 0x01,
-                                               0x23, 0x01, 0x82, 0x02, 0x81,
-                                               0x82, 0x8D, 0x81, 0x8D, 0x08,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x30, 0xEB, 0x30, 0xEB, 0x30,
-                                               0xEB, 0x30, 0xEB, 0x30, 0xEB,
-                                               0x91, 0x02, 0x05, 0x05 };
-
-static unsigned char get_input_1211[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
-                                               0x03, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x48,
-                                               0x65, 0x6C, 0x6C, 0x6F, 0x91,
-                                               0x02, 0x02, 0x02 };
-
-static unsigned char get_input_1221[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
-                                               0x03, 0x82, 0x02, 0x81, 0x82,
-                                               0x8D, 0x0C, 0x04, 0x45, 0x6E,
-                                               0x74, 0x65, 0x72, 0x20, 0x48,
-                                               0x65, 0x6C, 0x6C, 0x6F, 0x91,
-                                               0x02, 0x05, 0xFF };
-
 static struct get_input_test get_input_data_111 = {
        .pdu = get_input_111,
        .pdu_len = sizeof(get_input_111),
@@ -3326,582 +2417,97 @@ static struct get_input_test get_input_data_1211 = {
                .min = 2,
                .max = 2
        }
-};
-
-static struct get_input_test get_input_data_1221 = {
-       .pdu = get_input_1221,
-       .pdu_len = sizeof(get_input_1221),
-       .qualifier = 0x03,
-       .text = "Enter Hello",
-       .resp_len = {
-               .min = 5,
-               .max = 0xFF
-       }
-};
-
-/* Defined in TS 102.384 Section 27.22.4.3 */
-static void test_get_input(gconstpointer data)
-{
-       const struct get_input_test *test = data;
-       struct stk_command *command;
-
-       command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
-
-       g_assert(command);
-       g_assert(command->status == STK_PARSE_RESULT_OK);
-
-       g_assert(command->number == 1);
-       g_assert(command->type == STK_COMMAND_TYPE_GET_INPUT);
-       g_assert(command->qualifier == test->qualifier);
-
-       g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
-       g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
-
-       if (test->text)
-               g_assert(command->get_input.text);
-       check_text(command->get_input.text, test->text);
-       check_response_length(&command->get_input.resp_len, &test->resp_len);
-       check_default_text(command->get_input.default_text, test->default_text);
-       check_icon_id(&command->get_input.icon_id, &test->icon_id);
-       check_text_attr(&command->get_input.text_attr,
-                                               &test->text_attr);
-       check_text_attr_html(&command->get_input.text_attr,
-                               command->get_input.text, test->html);
-       check_frame_id(&command->get_input.frame_id, &test->frame_id);
-
-       stk_command_free(command);
-}
-
-struct more_time_test {
-       const unsigned char *pdu;
-       unsigned int pdu_len;
-       unsigned char qualifier;
-};
-
-static unsigned char more_time_111[] = { 0xD0, 0x09, 0x81, 0x03, 0x01, 0x02,
-                                               0x00, 0x82, 0x02, 0x81, 0x82 };
-
-static struct more_time_test more_time_data_111 = {
-       .pdu = more_time_111,
-       .pdu_len = sizeof(more_time_111),
-       .qualifier = 0x00,
-};
-
-/* Defined in TS 102.384 Section 27.22.4.4 */
-static void test_more_time(gconstpointer data)
-{
-       const struct get_input_test *test = data;
-       struct stk_command *command;
-
-       command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
-
-       g_assert(command);
-       g_assert(command->status == STK_PARSE_RESULT_OK);
-
-       g_assert(command->number == 1);
-       g_assert(command->type == STK_COMMAND_TYPE_MORE_TIME);
-       g_assert(command->qualifier == test->qualifier);
-
-       g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
-       g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
-
-       stk_command_free(command);
-}
-
-struct play_tone_test {
-       const unsigned char *pdu;
-       unsigned int pdu_len;
-       unsigned char qualifier;
-       char *alpha_id;
-       unsigned char tone;
-       struct stk_duration duration;
-       struct stk_icon_id icon_id;
-       struct stk_text_attribute text_attr;
-       struct stk_frame_id frame_id;
-       char *html;
-};
-
-static unsigned char play_tone_111[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x09, 0x44, 0x69, 0x61,
-                                               0x6C, 0x20, 0x54, 0x6F, 0x6E,
-                                               0x65, 0x8E, 0x01, 0x01, 0x84,
-                                               0x02, 0x01, 0x05 };
-
-static unsigned char play_tone_112[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x09, 0x53, 0x75, 0x62,
-                                               0x2E, 0x20, 0x42, 0x75, 0x73,
-                                               0x79, 0x8E, 0x01, 0x02, 0x84,
-                                               0x02, 0x01, 0x05 };
-
-static unsigned char play_tone_113[] = { 0xD0, 0x1C, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x0A, 0x43, 0x6F, 0x6E,
-                                               0x67, 0x65, 0x73, 0x74, 0x69,
-                                               0x6F, 0x6E, 0x8E, 0x01, 0x03,
-                                               0x84, 0x02, 0x01, 0x05 };
-
-static unsigned char play_tone_114[] = { 0xD0, 0x18, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x06, 0x52, 0x50, 0x20,
-                                               0x41, 0x63, 0x6B, 0x8E, 0x01,
-                                               0x04, 0x84, 0x02, 0x01, 0x05 };
-
-static unsigned char play_tone_115[] = { 0xD0, 0x17, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x05, 0x4E, 0x6F, 0x20,
-                                               0x52, 0x50, 0x8E, 0x01, 0x05,
-                                               0x84, 0x02, 0x01, 0x05 };
-
-static unsigned char play_tone_116[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x09, 0x53, 0x70, 0x65,
-                                               0x63, 0x20, 0x49, 0x6E, 0x66,
-                                               0x6F, 0x8E, 0x01, 0x06, 0x84,
-                                               0x02, 0x01, 0x05 };
-
-static unsigned char play_tone_117[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x09, 0x43, 0x61, 0x6C,
-                                               0x6C, 0x20, 0x57, 0x61, 0x69,
-                                               0x74, 0x8E, 0x01, 0x07, 0x84,
-                                               0x02, 0x01, 0x05 };
-
-static unsigned char play_tone_118[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x09, 0x52, 0x69, 0x6E,
-                                               0x67, 0x20, 0x54, 0x6F, 0x6E,
-                                               0x65, 0x8E, 0x01, 0x08, 0x84,
-                                               0x02, 0x01, 0x05 };
-
-static unsigned char play_tone_119[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
-                                               0x20, 0x00, 0x82, 0x02, 0x81,
-                                               0x03, 0x85, 0x81, 0xF1, 0x54,
-                                               0x68, 0x69, 0x73, 0x20, 0x63,
-                                               0x6F, 0x6D, 0x6D, 0x61, 0x6E,
-                                               0x64, 0x20, 0x69, 0x6E, 0x73,
-                                               0x74, 0x72, 0x75, 0x63, 0x74,
-                                               0x73, 0x20, 0x74, 0x68, 0x65,
-                                               0x20, 0x4D, 0x45, 0x20, 0x74,
-                                               0x6F, 0x20, 0x70, 0x6C, 0x61,
-                                               0x79, 0x20, 0x61, 0x6E, 0x20,
-                                               0x61, 0x75, 0x64, 0x69, 0x6F,
-                                               0x20, 0x74, 0x6F, 0x6E, 0x65,
-                                               0x2E, 0x20, 0x55, 0x70, 0x6F,
-                                               0x6E, 0x20, 0x72, 0x65, 0x63,
-                                               0x65, 0x69, 0x76, 0x69, 0x6E,
-                                               0x67, 0x20, 0x74, 0x68, 0x69,
-                                               0x73, 0x20, 0x63, 0x6F, 0x6D,
-                                               0x6D, 0x61, 0x6E, 0x64, 0x2C,
-                                               0x20, 0x74, 0x68, 0x65, 0x20,
-                                               0x4D, 0x45, 0x20, 0x73, 0x68,
-                                               0x61, 0x6C, 0x6C, 0x20, 0x63,
-                                               0x68, 0x65, 0x63, 0x6B, 0x20,
-                                               0x69, 0x66, 0x20, 0x69, 0x74,
-                                               0x20, 0x69, 0x73, 0x20, 0x63,
-                                               0x75, 0x72, 0x72, 0x65, 0x6E,
-                                               0x74, 0x6C, 0x79, 0x20, 0x69,
-                                               0x6E, 0x2C, 0x20, 0x6F, 0x72,
-                                               0x20, 0x69, 0x6E, 0x20, 0x74,
-                                               0x68, 0x65, 0x20, 0x70, 0x72,
-                                               0x6F, 0x63, 0x65, 0x73, 0x73,
-                                               0x20, 0x6F, 0x66, 0x20, 0x73,
-                                               0x65, 0x74, 0x74, 0x69, 0x6E,
-                                               0x67, 0x20, 0x75, 0x70, 0x20,
-                                               0x28, 0x53, 0x45, 0x54, 0x2D,
-                                               0x55, 0x50, 0x20, 0x6D, 0x65,
-                                               0x73, 0x73, 0x61, 0x67, 0x65,
-                                               0x20, 0x73, 0x65, 0x6E, 0x74,
-                                               0x20, 0x74, 0x6F, 0x20, 0x74,
-                                               0x68, 0x65, 0x20, 0x6E, 0x65,
-                                               0x74, 0x77, 0x6F, 0x72, 0x6B,
-                                               0x2C, 0x20, 0x73, 0x65, 0x65,
-                                               0x20, 0x47, 0x53, 0x4D, 0x22,
-                                               0x30, 0x34, 0x2E, 0x30, 0x38,
-                                               0x22, 0x28, 0x38, 0x29, 0x29,
-                                               0x2C, 0x20, 0x61, 0x20, 0x73,
-                                               0x70, 0x65, 0x65, 0x63, 0x68,
-                                               0x20, 0x63, 0x61, 0x6C, 0x6C,
-                                               0x2E, 0x20, 0x2D, 0x20, 0x49,
-                                               0x66, 0x20, 0x74, 0x68, 0x65,
-                                               0x20, 0x4D, 0x45, 0x20, 0x49 };
-
-static unsigned char play_tone_1110[] = { 0xD0, 0x16, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x04, 0x42, 0x65, 0x65,
-                                               0x70, 0x8E, 0x01, 0x10, 0x84,
-                                               0x02, 0x01, 0x01 };
-
-static unsigned char play_tone_1111[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x08, 0x50, 0x6F, 0x73,
-                                               0x69, 0x74, 0x69, 0x76, 0x65,
-                                               0x8E, 0x01, 0x11, 0x84, 0x02,
-                                               0x01, 0x01 };
-
-static unsigned char play_tone_1112[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x08, 0x4E, 0x65, 0x67,
-                                               0x61, 0x74, 0x69, 0x76, 0x65,
-                                               0x8E, 0x01, 0x12, 0x84, 0x02,
-                                               0x01, 0x01 };
-
-static unsigned char play_tone_1113[] = { 0xD0, 0x17, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x05, 0x51, 0x75, 0x69,
-                                               0x63, 0x6B, 0x8E, 0x01, 0x10,
-                                               0x84, 0x02, 0x02, 0x02 };
-
-static unsigned char play_tone_1114[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x07, 0x3C, 0x41, 0x42,
-                                               0x4F, 0x52, 0x54, 0x3E, 0x8E,
-                                               0x01, 0x06, 0x84, 0x02, 0x00,
-                                               0x01 };
-
-static unsigned char play_tone_1115[] = { 0xD0, 0x09, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03 };
-
-static unsigned char play_tone_211[] = { 0xD0, 0x2B, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x19, 0x80, 0x04, 0x17,
-                                               0x04, 0x14, 0x04, 0x20, 0x04,
-                                               0x10, 0x04, 0x12, 0x04, 0x21,
-                                               0x04, 0x22, 0x04, 0x12, 0x04,
-                                               0x23, 0x04, 0x19, 0x04, 0x22,
-                                               0x04, 0x15, 0x8E, 0x01, 0x11,
-                                               0x84, 0x02, 0x01, 0x01 };
-
-
-static unsigned char play_tone_212[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x0F, 0x81, 0x0C, 0x08,
-                                               0x97, 0x94, 0xA0, 0x90, 0x92,
-                                               0xA1, 0xA2, 0x92, 0xA3, 0x99,
-                                               0xA2, 0x95, 0x8E, 0x01, 0x11,
-                                               0x84, 0x02, 0x01, 0x01 };
-
-static unsigned char play_tone_213[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x82, 0x0C, 0x04,
-                                               0x10, 0x87, 0x84, 0x90, 0x80,
-                                               0x82, 0x91, 0x92, 0x82, 0x93,
-                                               0x89, 0x92, 0x85, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01 };
-
-static unsigned char play_tone_311[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x0C, 0x3C, 0x42, 0x41,
-                                               0x53, 0x49, 0x43, 0x2D, 0x49,
-                                               0x43, 0x4F, 0x4E, 0x3E, 0x8E,
-                                               0x01, 0x11, 0x84, 0x02, 0x01,
-                                               0x01, 0x1E, 0x02, 0x00, 0x01 };
-
-static unsigned char play_tone_321[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x0C, 0x3C, 0x42, 0x41,
-                                               0x53, 0x49, 0x43, 0x2D, 0x49,
-                                               0x43, 0x4F, 0x4E, 0x3E, 0x8E,
-                                               0x01, 0x11, 0x84, 0x02, 0x01,
-                                               0x01, 0x1E, 0x02, 0x01, 0x01 };
-
-static unsigned char play_tone_331[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x0D, 0x3C, 0x43, 0x4F,
-                                               0x4C, 0x4F, 0x55, 0x52, 0x2D,
-                                               0x49, 0x43, 0x4F, 0x4E, 0x3E,
-                                               0x8E, 0x01, 0x11, 0x84, 0x02,
-                                               0x01, 0x01, 0x1E, 0x02, 0x00,
-                                               0x02 };
-
-static unsigned char play_tone_341[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x0D, 0x3C, 0x43, 0x4F,
-                                               0x4C, 0x4F, 0x55, 0x52, 0x2D,
-                                               0x49, 0x43, 0x4F, 0x4E, 0x3E,
-                                               0x8E, 0x01, 0x11, 0x84, 0x02,
-                                               0x01, 0x01, 0x1E, 0x02, 0x01,
-                                               0x02 };
-
-static unsigned char play_tone_411[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x31, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x00,
-                                               0xB4 };
-
-static unsigned char play_tone_412[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x32, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01 };
-
-static unsigned char play_tone_421[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x31, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x01,
-                                               0xB4 };
-
-static unsigned char play_tone_422[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x32, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01 };
-
-static unsigned char play_tone_431[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x31, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x02,
-                                               0xB4 };
-
-static unsigned char play_tone_432[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x32, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01 };
-
-static unsigned char play_tone_441[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x31, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x04,
-                                               0xB4 };
-
-static unsigned char play_tone_442[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x32, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x00,
-                                               0xB4 };
-
-static unsigned char play_tone_443[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x33, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01 };
-
-static unsigned char play_tone_451[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x31, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x08,
-                                               0xB4 };
-
-static unsigned char play_tone_452[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x32, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x00,
-                                               0xB4 };
-
-static unsigned char play_tone_453[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x33, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01 };
-
-static unsigned char play_tone_461[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x31, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x0E, 0x10,
-                                               0xB4 };
-
-static unsigned char play_tone_462[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x32, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x00,
-                                               0xB4 };
-
-static unsigned char play_tone_463[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x33, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01 };
+};
 
-static unsigned char play_tone_471[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x31, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x0E, 0x20,
-                                               0xB4 };
+static struct get_input_test get_input_data_1221 = {
+       .pdu = get_input_1221,
+       .pdu_len = sizeof(get_input_1221),
+       .qualifier = 0x03,
+       .text = "Enter Hello",
+       .resp_len = {
+               .min = 5,
+               .max = 0xFF
+       }
+};
 
-static unsigned char play_tone_472[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x32, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x00,
-                                               0xB4 };
+/* Defined in TS 102.384 Section 27.22.4.3 */
+static void test_get_input(gconstpointer data)
+{
+       const struct get_input_test *test = data;
+       struct stk_command *command;
 
-static unsigned char play_tone_473[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x33, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01 };
+       command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
 
-static unsigned char play_tone_481[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x31, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x40,
-                                               0xB4 };
+       g_assert(command);
+       g_assert(command->status == STK_PARSE_RESULT_OK);
 
-static unsigned char play_tone_482[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x32, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x00,
-                                               0xB4 };
+       g_assert(command->number == 1);
+       g_assert(command->type == STK_COMMAND_TYPE_GET_INPUT);
+       g_assert(command->qualifier == test->qualifier);
 
-static unsigned char play_tone_483[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x33, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01 };
+       g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+       g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
 
-static unsigned char play_tone_491[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x31, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x80,
-                                               0xB4 };
+       if (test->text)
+               g_assert(command->get_input.text);
+       check_text(command->get_input.text, test->text);
+       check_response_length(&command->get_input.resp_len, &test->resp_len);
+       check_default_text(command->get_input.default_text, test->default_text);
+       check_icon_id(&command->get_input.icon_id, &test->icon_id);
+       check_text_attr(&command->get_input.text_attr,
+                                               &test->text_attr);
+       check_text_attr_html(&command->get_input.text_attr,
+                               command->get_input.text, test->html);
+       check_frame_id(&command->get_input.frame_id, &test->frame_id);
 
-static unsigned char play_tone_492[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x32, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x00,
-                                               0xB4 };
+       stk_command_free(command);
+}
 
-static unsigned char play_tone_493[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x33, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01 };
+struct more_time_test {
+       const unsigned char *pdu;
+       unsigned int pdu_len;
+       unsigned char qualifier;
+};
 
-static unsigned char play_tone_4101[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x31, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01,
-                                               0xD0, 0x04, 0x00, 0x10, 0x00,
-                                               0xB4 };
+static struct more_time_test more_time_data_111 = {
+       .pdu = more_time_111,
+       .pdu_len = sizeof(more_time_111),
+       .qualifier = 0x00,
+};
 
-static unsigned char play_tone_4102[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x10, 0x54, 0x65, 0x78,
-                                               0x74, 0x20, 0x41, 0x74, 0x74,
-                                               0x72, 0x69, 0x62, 0x75, 0x74,
-                                               0x65, 0x20, 0x32, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01 };
+/* Defined in TS 102.384 Section 27.22.4.4 */
+static void test_more_time(gconstpointer data)
+{
+       const struct get_input_test *test = data;
+       struct stk_command *command;
 
-static unsigned char play_tone_511[] = { 0xD0, 0x17, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x05, 0x80, 0x4E, 0x2D,
-                                               0x4E, 0x00, 0x8E, 0x01, 0x11,
-                                               0x84, 0x02, 0x01, 0x01 };
+       command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
 
-static unsigned char play_tone_512[] = { 0xD0, 0x17, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x05, 0x81, 0x02, 0x9C,
-                                               0xAD, 0x80, 0x8E, 0x01, 0x11,
-                                               0x84, 0x02, 0x01, 0x01 };
+       g_assert(command);
+       g_assert(command->status == STK_PARSE_RESULT_OK);
 
-static unsigned char play_tone_513[] = { 0xD0, 0x18, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x06, 0x82, 0x02, 0x4E,
-                                               0x00, 0xAD, 0x80, 0x8E, 0x01,
-                                               0x11, 0x84, 0x02, 0x01, 0x01 };
+       g_assert(command->number == 1);
+       g_assert(command->type == STK_COMMAND_TYPE_MORE_TIME);
+       g_assert(command->qualifier == test->qualifier);
 
-static unsigned char play_tone_611[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x09, 0x80, 0x00, 0x38,
-                                               0x00, 0x30, 0x30, 0xEB, 0x00,
-                                               0x30, 0x8E, 0x01, 0x01, 0x84,
-                                               0x02, 0x01, 0x05 };
+       g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+       g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
 
-static unsigned char play_tone_612[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x07, 0x81, 0x04, 0x61,
-                                               0x38, 0x31, 0xEB, 0x31, 0x8E,
-                                               0x01, 0x01, 0x84, 0x02, 0x01,
-                                               0x05 };
+       stk_command_free(command);
+}
 
-static unsigned char play_tone_613[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x20,
-                                               0x00, 0x82, 0x02, 0x81, 0x03,
-                                               0x85, 0x08, 0x82, 0x04, 0x30,
-                                               0xA0, 0x38, 0x32, 0xCB, 0x32,
-                                               0x8E, 0x01, 0x01, 0x84, 0x02,
-                                               0x01, 0x05 };
+struct play_tone_test {
+       const unsigned char *pdu;
+       unsigned int pdu_len;
+       unsigned char qualifier;
+       char *alpha_id;
+       unsigned char tone;
+       struct stk_duration duration;
+       struct stk_icon_id icon_id;
+       struct stk_text_attribute text_attr;
+       struct stk_frame_id frame_id;
+       char *html;
+};
 
 static struct play_tone_test play_tone_data_111 = {
        .pdu = play_tone_111,
@@ -4584,7 +3190,8 @@ static struct play_tone_test play_tone_data_4101 = {
                .attributes = { 0x00, 0x10, 0x00, 0xB4 }
        },
        .html = "<div style=\"text-align: left;\"><span style=\"color: "
-               "#347235;background-color: #FFFF00;\">Text Attribute 1</span>",
+               "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
+               "</div>",
 };
 
 static struct play_tone_test play_tone_data_4102 = {
@@ -4708,10 +3315,6 @@ struct poll_interval_test {
        struct stk_duration duration;
 };
 
-static unsigned char poll_interval_111[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01, 0x03,
-                                               0x00, 0x82, 0x02, 0x81, 0x82,
-                                               0x84, 0x02, 0x01, 0x14 };
-
 static struct poll_interval_test poll_interval_data_111 = {
        .pdu = poll_interval_111,
        .pdu_len = sizeof(poll_interval_111),
@@ -17629,11 +16232,6 @@ static void test_terminal_response_encoding(gconstpointer data)
        g_assert(memcmp(pdu, test->pdu, pdu_len) == 0);
 }
 
-static const unsigned char display_text_response_111[] = {
-       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00,
-};
-
 static const struct terminal_response_test display_text_response_data_111 = {
        .pdu = display_text_response_111,
        .pdu_len = sizeof(display_text_response_111),
@@ -17649,11 +16247,6 @@ static const struct terminal_response_test display_text_response_data_111 = {
        },
 };
 
-static const unsigned char display_text_response_121[] = {
-       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x02, 0x20, 0x01,
-};
-
 static const struct terminal_response_test display_text_response_data_121 = {
        .pdu = display_text_response_121,
        .pdu_len = sizeof(display_text_response_121),
@@ -17671,11 +16264,6 @@ static const struct terminal_response_test display_text_response_data_121 = {
        },
 };
 
-static const unsigned char display_text_response_131[] = {
-       0x81, 0x03, 0x01, 0x21, 0x81, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00,
-};
-
 static const struct terminal_response_test display_text_response_data_131 = {
        .pdu = display_text_response_131,
        .pdu_len = sizeof(display_text_response_131),
@@ -17691,11 +16279,6 @@ static const struct terminal_response_test display_text_response_data_131 = {
        },
 };
 
-static const unsigned char display_text_response_151[] = {
-       0x81, 0x03, 0x01, 0x21, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00,
-};
-
 static const struct terminal_response_test display_text_response_data_151 = {
        .pdu = display_text_response_151,
        .pdu_len = sizeof(display_text_response_151),
@@ -17711,11 +16294,6 @@ static const struct terminal_response_test display_text_response_data_151 = {
        },
 };
 
-static const unsigned char display_text_response_171[] = {
-       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x11,
-};
-
 static const struct terminal_response_test display_text_response_data_171 = {
        .pdu = display_text_response_171,
        .pdu_len = sizeof(display_text_response_171),
@@ -17731,11 +16309,6 @@ static const struct terminal_response_test display_text_response_data_171 = {
        },
 };
 
-static const unsigned char display_text_response_181[] = {
-       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x10,
-};
-
 static const struct terminal_response_test display_text_response_data_181 = {
        .pdu = display_text_response_181,
        .pdu_len = sizeof(display_text_response_181),
@@ -17751,11 +16324,6 @@ static const struct terminal_response_test display_text_response_data_181 = {
        },
 };
 
-static const unsigned char display_text_response_191[] = {
-       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x32,
-};
-
 static const struct terminal_response_test display_text_response_data_191 = {
        .pdu = display_text_response_191,
        .pdu_len = sizeof(display_text_response_191),
@@ -17771,11 +16339,6 @@ static const struct terminal_response_test display_text_response_data_191 = {
        },
 };
 
-static const unsigned char display_text_response_211[] = {
-       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x12,
-};
-
 static const struct terminal_response_test display_text_response_data_211 = {
        .pdu = display_text_response_211,
        .pdu_len = sizeof(display_text_response_211),
@@ -17791,11 +16354,6 @@ static const struct terminal_response_test display_text_response_data_211 = {
        },
 };
 
-static const unsigned char display_text_response_511b[] = {
-       0x81, 0x03, 0x01, 0x21, 0x80, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x04,
-};
-
 static const struct terminal_response_test display_text_response_data_511b = {
        .pdu = display_text_response_511b,
        .pdu_len = sizeof(display_text_response_511b),
@@ -17811,11 +16369,6 @@ static const struct terminal_response_test display_text_response_data_511b = {
        },
 };
 
-static const unsigned char get_inkey_response_111[] = {
-       0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x02, 0x04, 0x2b,
-};
-
 static const struct terminal_response_test get_inkey_response_data_111 = {
        .pdu = get_inkey_response_111,
        .pdu_len = sizeof(get_inkey_response_111),
@@ -17836,11 +16389,6 @@ static const struct terminal_response_test get_inkey_response_data_111 = {
        },
 };
 
-static const unsigned char get_inkey_response_121[] = {
-       0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x02, 0x04, 0x30,
-};
-
 static const struct terminal_response_test get_inkey_response_data_121 = {
        .pdu = get_inkey_response_121,
        .pdu_len = sizeof(get_inkey_response_121),
@@ -17861,11 +16409,6 @@ static const struct terminal_response_test get_inkey_response_data_121 = {
        },
 };
 
-static const unsigned char get_inkey_response_131[] = {
-       0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x11,
-};
-
 static const struct terminal_response_test get_inkey_response_data_131 = {
        .pdu = get_inkey_response_131,
        .pdu_len = sizeof(get_inkey_response_131),
@@ -17881,11 +16424,6 @@ static const struct terminal_response_test get_inkey_response_data_131 = {
        },
 };
 
-static const unsigned char get_inkey_response_141[] = {
-       0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x10,
-};
-
 static const struct terminal_response_test get_inkey_response_data_141 = {
        .pdu = get_inkey_response_141,
        .pdu_len = sizeof(get_inkey_response_141),
@@ -17901,11 +16439,6 @@ static const struct terminal_response_test get_inkey_response_data_141 = {
        },
 };
 
-static const unsigned char get_inkey_response_151[] = {
-       0x81, 0x03, 0x01, 0x22, 0x01, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x02, 0x04, 0x71,
-};
-
 static const struct terminal_response_test get_inkey_response_data_151 = {
        .pdu = get_inkey_response_151,
        .pdu_len = sizeof(get_inkey_response_151),
@@ -17926,11 +16459,6 @@ static const struct terminal_response_test get_inkey_response_data_151 = {
        },
 };
 
-static const unsigned char get_inkey_response_161[] = {
-       0x81, 0x03, 0x01, 0x22, 0x01, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x02, 0x04, 0x78,
-};
-
 static const struct terminal_response_test get_inkey_response_data_161 = {
        .pdu = get_inkey_response_161,
        .pdu_len = sizeof(get_inkey_response_161),
@@ -17951,11 +16479,6 @@ static const struct terminal_response_test get_inkey_response_data_161 = {
        },
 };
 
-static const unsigned char get_inkey_response_211[] = {
-       0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x12,
-};
-
 static const struct terminal_response_test get_inkey_response_data_211 = {
        .pdu = get_inkey_response_211,
        .pdu_len = sizeof(get_inkey_response_211),
@@ -17971,12 +16494,6 @@ static const struct terminal_response_test get_inkey_response_data_211 = {
        },
 };
 
-static const unsigned char get_inkey_response_411[] = {
-       0x81, 0x03, 0x01, 0x22, 0x03, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x03, 0x08, 0x04,
-       0x14,
-};
-
 static const struct terminal_response_test get_inkey_response_data_411 = {
        .pdu = get_inkey_response_411,
        .pdu_len = sizeof(get_inkey_response_411),
@@ -17997,11 +16514,6 @@ static const struct terminal_response_test get_inkey_response_data_411 = {
        },
 };
 
-static const unsigned char get_inkey_response_511[] = {
-       0x81, 0x03, 0x01, 0x22, 0x04, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x02, 0x04, 0x01,
-};
-
 static const struct terminal_response_test get_inkey_response_data_511 = {
        .pdu = get_inkey_response_511,
        .pdu_len = sizeof(get_inkey_response_511),
@@ -18023,11 +16535,6 @@ static const struct terminal_response_test get_inkey_response_data_511 = {
        },
 };
 
-static const unsigned char get_inkey_response_512[] = {
-       0x81, 0x03, 0x01, 0x22, 0x04, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x02, 0x04, 0x00,
-};
-
 static const struct terminal_response_test get_inkey_response_data_512 = {
        .pdu = get_inkey_response_512,
        .pdu_len = sizeof(get_inkey_response_512),
@@ -18119,11 +16626,6 @@ static const struct terminal_response_test get_inkey_response_data_712 = {
        },
 };
 
-static const unsigned char get_inkey_response_811[] = {
-       0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x12, 0x04, 0x02, 0x01, 0x11,
-};
-
 static const struct terminal_response_test get_inkey_response_data_811 = {
        .pdu = get_inkey_response_811,
        .pdu_len = sizeof(get_inkey_response_811),
@@ -18139,7 +16641,7 @@ static const struct terminal_response_test get_inkey_response_data_811 = {
                { .get_inkey = {
                        .duration = {
                                .unit = STK_DURATION_TYPE_SECONDS,
-                               .interval = 17,
+                               .interval = 11,
                        },
                }},
        },
@@ -18170,12 +16672,6 @@ static const struct terminal_response_test get_inkey_response_data_912 = {
        },
 };
 
-static const unsigned char get_inkey_response_1111[] = {
-       0x81, 0x03, 0x01, 0x22, 0x03, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x03, 0x08, 0x59,
-       0x7d,
-};
-
 static const struct terminal_response_test get_inkey_response_data_1111 = {
        .pdu = get_inkey_response_1111,
        .pdu_len = sizeof(get_inkey_response_1111),
@@ -18196,12 +16692,6 @@ static const struct terminal_response_test get_inkey_response_data_1111 = {
        },
 };
 
-static const unsigned char get_inkey_response_1311[] = {
-       0x81, 0x03, 0x01, 0x22, 0x03, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x03, 0x08, 0x30,
-       0xeb,
-};
-
 static const struct terminal_response_test get_inkey_response_data_1311 = {
        .pdu = get_inkey_response_1311,
        .pdu_len = sizeof(get_inkey_response_1311),
@@ -18222,12 +16712,6 @@ static const struct terminal_response_test get_inkey_response_data_1311 = {
        },
 };
 
-static const unsigned char get_input_response_111[] = {
-       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x04, 0x31,
-       0x32, 0x33, 0x34, 0x35,
-};
-
 static const struct terminal_response_test get_input_response_data_111 = {
        .pdu = get_input_response_111,
        .pdu_len = sizeof(get_input_response_111),
@@ -18248,12 +16732,6 @@ static const struct terminal_response_test get_input_response_data_111 = {
        },
 };
 
-static const unsigned char get_input_response_121[] = {
-       0x81, 0x03, 0x01, 0x23, 0x08, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x00, 0xb6,
-       0x9b, 0x6a, 0xb4, 0x02,
-};
-
 static const struct terminal_response_test get_input_response_data_121 = {
        .pdu = get_input_response_121,
        .pdu_len = sizeof(get_input_response_121),
@@ -18275,12 +16753,6 @@ static const struct terminal_response_test get_input_response_data_121 = {
        },
 };
 
-static const unsigned char get_input_response_131[] = {
-       0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x04, 0x41,
-       0x62, 0x43, 0x64, 0x45,
-};
-
 static const struct terminal_response_test get_input_response_data_131 = {
        .pdu = get_input_response_131,
        .pdu_len = sizeof(get_input_response_131),
@@ -18301,12 +16773,6 @@ static const struct terminal_response_test get_input_response_data_131 = {
        },
 };
 
-static const unsigned char get_input_response_141[] = {
-       0x81, 0x03, 0x01, 0x23, 0x04, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x08, 0x04, 0x32,
-       0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
-};
-
 static const struct terminal_response_test get_input_response_data_141 = {
        .pdu = get_input_response_141,
        .pdu_len = sizeof(get_input_response_141),
@@ -18327,14 +16793,6 @@ static const struct terminal_response_test get_input_response_data_141 = {
        },
 };
 
-static const unsigned char get_input_response_151[] = {
-       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x15, 0x04, 0x31,
-       0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
-       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
-       0x38, 0x39, 0x30,
-};
-
 static const struct terminal_response_test get_input_response_data_151 = {
        .pdu = get_input_response_151,
        .pdu_len = sizeof(get_input_response_151),
@@ -18355,11 +16813,6 @@ static const struct terminal_response_test get_input_response_data_151 = {
        },
 };
 
-static const unsigned char get_input_response_161[] = {
-       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x11,
-};
-
 static const struct terminal_response_test get_input_response_data_161 = {
        .pdu = get_input_response_161,
        .pdu_len = sizeof(get_input_response_161),
@@ -18375,11 +16828,6 @@ static const struct terminal_response_test get_input_response_data_161 = {
        },
 };
 
-static const unsigned char get_input_response_171[] = {
-       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x10,
-};
-
 static const struct terminal_response_test get_input_response_data_171 = {
        .pdu = get_input_response_171,
        .pdu_len = sizeof(get_input_response_171),
@@ -18395,31 +16843,6 @@ static const struct terminal_response_test get_input_response_data_171 = {
        },
 };
 
-static const unsigned char get_input_response_181[] = {
-       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x81, 0xa1, 0x04,
-       0x2a, 0x2a, 0x2a, 0x31, 0x31, 0x31, 0x31, 0x31,
-       0x31, 0x31, 0x31, 0x31, 0x31, 0x23, 0x23, 0x23,
-       0x2a, 0x2a, 0x2a, 0x32, 0x32, 0x32, 0x32, 0x32,
-       0x32, 0x32, 0x32, 0x32, 0x32, 0x23, 0x23, 0x23,
-       0x2a, 0x2a, 0x2a, 0x33, 0x33, 0x33, 0x33, 0x33,
-       0x33, 0x33, 0x33, 0x33, 0x33, 0x23, 0x23, 0x23,
-       0x2a, 0x2a, 0x2a, 0x34, 0x34, 0x34, 0x34, 0x34,
-       0x34, 0x34, 0x34, 0x34, 0x34, 0x23, 0x23, 0x23,
-       0x2a, 0x2a, 0x2a, 0x35, 0x35, 0x35, 0x35, 0x35,
-       0x35, 0x35, 0x35, 0x35, 0x35, 0x23, 0x23, 0x23,
-       0x2a, 0x2a, 0x2a, 0x36, 0x36, 0x36, 0x36, 0x36,
-       0x36, 0x36, 0x36, 0x36, 0x36, 0x23, 0x23, 0x23,
-       0x2a, 0x2a, 0x2a, 0x37, 0x37, 0x37, 0x37, 0x37,
-       0x37, 0x37, 0x37, 0x37, 0x37, 0x23, 0x23, 0x23,
-       0x2a, 0x2a, 0x2a, 0x38, 0x38, 0x38, 0x38, 0x38,
-       0x38, 0x38, 0x38, 0x38, 0x38, 0x23, 0x23, 0x23,
-       0x2a, 0x2a, 0x2a, 0x39, 0x39, 0x39, 0x39, 0x39,
-       0x39, 0x39, 0x39, 0x39, 0x39, 0x23, 0x23, 0x23,
-       0x2a, 0x2a, 0x2a, 0x30, 0x30, 0x30, 0x30, 0x30,
-       0x30, 0x30, 0x30, 0x30, 0x30, 0x23, 0x23, 0x23,
-};
-
 static const struct terminal_response_test get_input_response_data_181 = {
        .pdu = get_input_response_181,
        .pdu_len = sizeof(get_input_response_181),
@@ -18444,11 +16867,6 @@ static const struct terminal_response_test get_input_response_data_181 = {
        },
 };
 
-static const unsigned char get_input_response_191a[] = {
-       0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x01, 0x04,
-};
-
 static const unsigned char get_input_response_191b[] = {
        0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82,
        0x81, 0x83, 0x01, 0x00, 0x8d, 0x00,
@@ -18461,7 +16879,7 @@ static const struct terminal_response_test get_input_response_data_191 = {
        .response = {
                .number = 1,
                .type = STK_COMMAND_TYPE_GET_INPUT,
-               .qualifier = 0x01, /* Allow all SMS characters */
+               .qualifier = 0x00, /* Allow all SMS characters */
                .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
                .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
                .result = {
@@ -18475,11 +16893,6 @@ static const struct terminal_response_test get_input_response_data_191 = {
        },
 };
 
-static const unsigned char get_input_response_211[] = {
-       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x12,
-};
-
 static const struct terminal_response_test get_input_response_data_211 = {
        .pdu = get_input_response_211,
        .pdu_len = sizeof(get_input_response_211),
@@ -18495,12 +16908,6 @@ static const struct terminal_response_test get_input_response_data_211 = {
        },
 };
 
-static const unsigned char get_input_response_311[] = {
-       0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x04, 0x48,
-       0x45, 0x4c, 0x4c, 0x4f,
-};
-
 static const struct terminal_response_test get_input_response_data_311 = {
        .pdu = get_input_response_311,
        .pdu_len = sizeof(get_input_response_311),
@@ -18521,14 +16928,6 @@ static const struct terminal_response_test get_input_response_data_311 = {
        },
 };
 
-static const unsigned char get_input_response_411[] = {
-       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x19, 0x08, 0x04,
-       0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10, 0x04,
-       0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04,
-       0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
-};
-
 static const struct terminal_response_test get_input_response_data_411 = {
        .pdu = get_input_response_411,
        .pdu_len = sizeof(get_input_response_411),
@@ -18549,29 +16948,6 @@ static const struct terminal_response_test get_input_response_data_411 = {
        },
 };
 
-static const unsigned char get_input_response_421[] = {
-       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x81, 0x8d, 0x08,
-       0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
-       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
-       0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
-       0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
-       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
-       0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
-       0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
-       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
-       0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
-       0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
-       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
-       0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
-       0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
-       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
-       0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
-       0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
-       0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
-       0x04, 0x23, 0x04, 0x19,
-};
-
 static const struct terminal_response_test get_input_response_data_421 = {
        .pdu = get_input_response_421,
        .pdu_len = sizeof(get_input_response_421),
@@ -18594,11 +16970,6 @@ static const struct terminal_response_test get_input_response_data_421 = {
        },
 };
 
-static const unsigned char get_input_response_611a[] = {
-       0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x02, 0x04, 0x2b,
-};
-
 static const struct terminal_response_test get_input_response_data_611a = {
        .pdu = get_input_response_611a,
        .pdu_len = sizeof(get_input_response_611a),
@@ -18716,12 +17087,6 @@ static const struct terminal_response_test get_input_response_data_843 = {
        },
 };
 
-static const unsigned char get_input_response_1011[] = {
-       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x05, 0x08, 0x4f,
-       0x60, 0x59, 0x7d,
-};
-
 static const struct terminal_response_test get_input_response_data_1011 = {
        .pdu = get_input_response_1011,
        .pdu_len = sizeof(get_input_response_1011),
@@ -18742,29 +17107,6 @@ static const struct terminal_response_test get_input_response_data_1011 = {
        },
 };
 
-static const unsigned char get_input_response_1021[] = {
-       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x81, 0x8d, 0x08,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
-       0x4f, 0x60, 0x59, 0x7d,
-};
-
 static const struct terminal_response_test get_input_response_data_1021 = {
        .pdu = get_input_response_1021,
        .pdu_len = sizeof(get_input_response_1021),
@@ -18790,12 +17132,6 @@ static const struct terminal_response_test get_input_response_data_1021 = {
        },
 };
 
-static const unsigned char get_input_response_1211[] = {
-       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x05, 0x08, 0x30,
-       0xeb, 0x30, 0xeb,
-};
-
 static const struct terminal_response_test get_input_response_data_1211 = {
        .pdu = get_input_response_1211,
        .pdu_len = sizeof(get_input_response_1211),
@@ -18816,29 +17152,6 @@ static const struct terminal_response_test get_input_response_data_1211 = {
        },
 };
 
-static const unsigned char get_input_response_1221[] = {
-       0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x8d, 0x81, 0x8d, 0x08,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
-       0x30, 0xeb, 0x30, 0xeb,
-};
-
 static const struct terminal_response_test get_input_response_data_1221 = {
        .pdu = get_input_response_1221,
        .pdu_len = sizeof(get_input_response_1221),
@@ -18864,11 +17177,6 @@ static const struct terminal_response_test get_input_response_data_1221 = {
        },
 };
 
-static const unsigned char more_time_response_111[] = {
-       0x81, 0x03, 0x01, 0x02, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00,
-};
-
 static const struct terminal_response_test more_time_response_data_111 = {
        .pdu = more_time_response_111,
        .pdu_len = sizeof(more_time_response_111),
@@ -18944,11 +17252,6 @@ static const struct terminal_response_test send_sms_response_data_311b = {
        },
 };
 
-static const unsigned char play_tone_response_111[] = {
-       0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00,
-};
-
 static const struct terminal_response_test play_tone_response_data_111 = {
        .pdu = play_tone_response_111,
        .pdu_len = sizeof(play_tone_response_111),
@@ -18984,11 +17287,6 @@ static const struct terminal_response_test play_tone_response_data_119b = {
        },
 };
 
-static const unsigned char play_tone_response_1114[] = {
-       0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x10,
-};
-
 static const struct terminal_response_test play_tone_response_data_1114 = {
        .pdu = play_tone_response_1114,
        .pdu_len = sizeof(play_tone_response_1114),
@@ -19024,12 +17322,6 @@ static const struct terminal_response_test play_tone_response_data_311b = {
        },
 };
 
-/* TS 102 384 */
-static const unsigned char poll_interval_response_111[] = {
-       0x81, 0x03, 0x01, 0x03, 0x00, 0x82, 0x02, 0x82,
-       0x81, 0x83, 0x01, 0x00, 0x84, 0x02, 0x01, 0x14,
-};
-
 static const struct terminal_response_test poll_interval_response_data_111 = {
        .pdu = poll_interval_response_111,
        .pdu_len = sizeof(poll_interval_response_111),