Commit Graph

70 Commits

Author SHA1 Message Date
Ben Chan
31655bb5a5 glib: remove invocations of g_type_init()
g_type_init() has been deprecated (and also marked with the attribute
'deprecated') since glib 2.36 as the type system is automatically
initialized. Since the minimum version of glib required by ModemManager
is 2.36, calling g_type_init() isn't necessarily in the ModemManager
code.
2017-02-03 10:05:14 +01:00
Aleksander Morgado
58c955f5f2 core: allow building and running without udev
Instead of relying on the udev daemon and GUDev to manage the devices reported
by the kernel, we can now run ModemManager relying solely on the kernel events
reported via the new ReportKernelEvent() API. Therefore, the '--no-auto-scan'
option is implicit for the ModemManager daemon when udev is disabled in the
build.

Additionally, a new custom implementation of the kernel device object is
provided, which uses sysfs to load the properties and attributes required in
each kernel device, instead of using a GUdevDevice.

The udev rule files are kept in place, and a simple custom parser is provided
which preloads all rules in memory once and then applies them to the different
kernel objects reported via ReportKernelEvent(), e.g. to set port type hints.
A simple unit test setup is prepared to validate the udev rules during the
`check' Makefile target.
2016-09-29 15:43:05 +02:00
Aleksander Morgado
ae9ede926a core: use the kernel device object in the port object and the plugin interface
The mm_base_modem_grab_port() now receives a MMKernelDevice directly from the
plugin, which is then stored in the MMPort corresponding to the port.

This means that we have direct access to e.g. all properties set by udev rules
everywhere, and we don't need additional GUdevClient objects (e.g. like the one
used in the Huawei plugin to detect NDISDUP support during runtime).

For virtual ports (e.g. generated during unit tests), we have a new 'generic'
kernel device object which just provides the values from the kernel device
properties given during its creation.
2016-09-29 15:43:05 +02:00
Aleksander Morgado
3b8361eb06 build,core: update build rules
We try to combine in common envvars the compiler and linker flags shared by the
different components, and where possible, also re-using the implicit AM_CFLAGS
and AM_LDFLAGS variables that automake provides, and which apply to all objects
being built in the same Makefile.am.

The internal libmodem-helpers.la library is also renamed to libhelpers.la
2016-03-15 19:15:25 +01:00
Aleksander Morgado
ffde429843 core: use G_SOURCE_REMOVE and G_SOURCE_CONTINUE in GSourceFuncs 2015-12-02 17:07:39 +01:00
Aleksander Morgado
f4ec32e633 test: new 'mmtty' utility
The new tester allows to play with the AT-capable TTY using the same code as
ModemManager itself.

    $ sudo ./test/mmtty -d /dev/ttyHS0 --verbose
    opening serial port '/dev/ttyHS0'...
    (ttyHS0) opening serial port...
    (ttyHS0): port attributes not fully set
    (ttyHS0) device open count is 1 (open)
    flashing serial port '/dev/ttyHS0'...
    ready
    > AT+GCAP
    (ttyHS0): --> 'AT+GCAP<LF><CR>'
    (ttyHS0): <-- '<CR><LF>+GCAP: +CGSM,+DS,+ES<CR><LF><CR><LF>OK<CR><LF>'
    +GCAP: +CGSM,+DS,+ES
    > AT+GMI
    (ttyHS0): --> 'AT+GMI<LF><CR>'
    (ttyHS0): <-- '<CR><LF>Option N.V.<CR><LF><CR><LF>OK<CR><LF>'
    Option N.V.
    > ^C

    cancelling the main loop...

    (ttyHS0) device open count is 0 (close)
    (ttyHS0) closing serial port...
    (ttyHS0) serial port closed
    (ttyHS0) forced to close port
2015-02-11 19:58:12 +01:00
Aleksander Morgado
f3f499fcec test: remove testers of the old interface
Old python tests using the old ModemManager interface are removed, as mmcli
provides already a much nicer way to test the DBus interface.

Also, mm-test.py and the PPPD plugin get removed, which were also using the old
interface, and which were not very useful for testing newer non-PPP based
modems.

https://bugzilla.gnome.org/show_bug.cgi?id=702061
2013-06-18 16:30:26 +02:00
Aleksander Morgado
2da9474d0c test: new tester for the messaging capabilities of a modem, using `mmcli'
Usage:
  mmcli-test-sms [MODEM INDEX] [all|ucs2|gsm7|data] [NUMBER]"

If [NUMBER] is not given, a dummy number will be used and NO SMS will be sent.

If you give a proper [NUMBER], we will try to send the SMS.
2012-09-14 07:05:26 +02:00
Dan Williams
31d98a43c8 test: add utility to force a modem disconnect 2012-08-31 09:24:01 +02:00
Dan Williams
99b877ee68 test: ignore ESN errors in info.py 2012-05-30 12:11:25 -05:00
Aleksander Morgado
c52762ea67 build: require gudev >= 147
Since udev 147 the gudev API is no longer marked as experimental, and therefore
`G_UDEV_API_IS_SUBJECT_TO_CHANGE' is no longer needed.
2012-03-16 14:53:25 +01:00
Dan Williams
76c9b29415 test: (sms-get.py) don't fail if we don't get an SMSC 2012-02-02 21:12:17 -06:00
Dan Williams
70978d58a0 test: pretty-print SMS messages in sms-get.py 2012-02-01 10:45:28 -06:00
Dan Williams
346060efe8 test: add SMS get example/test 2012-01-26 12:35:30 -06:00
Dan Williams
b9037d1150 test: add missing examples to Makefile.am 2012-01-26 09:08:18 -06:00
Dan Williams
13d2eee6f1 test: rename SMS send example 2012-01-26 09:07:48 -06:00
Dan Williams
fc3fd7b983 test: print sent SMS message index on success 2012-01-18 18:07:45 -06:00
Dan Williams
e2306a0dd5 gsm: change SMS send validity from 5-minute units to minutes
Might as well keep it simple.
2012-01-18 16:30:15 -06:00
Dan Williams
c437da20ff test: enhance SMS send util to accept validity and SMSC address 2012-01-18 15:43:22 -06:00
Dan Williams
1655b3d323 test: print out error if sending SMS fails 2012-01-18 13:24:35 -06:00
Dan Williams
6789a87a58 tests: better handling of encodings in SMS test tool
Python usually uses Unicode, but often the shell encoding
will be in UTF-8, so Python needs some help converting the
message to Unicode.  Use LANG to do that if we can.
2012-01-18 13:00:50 -06:00
Dan Williams
7a7014330c examples: add example of auto-enabling modems 2011-09-30 14:38:11 -05:00
Dan Williams
f683391169 test: allow modem numbers in addition to object paths
If the command-line arg doesn't look like an object path,
treat it as the modem # and make the object path.
2011-08-09 16:49:29 +02:00
Dan Williams
4267a15b4b tests: fix access tech reporting in scan.py 2011-07-24 23:15:51 -05:00
Guido Günther
94e717b854 test: improve ussd.py help message 2011-07-21 15:16:44 -05:00
Dan Williams
c38da2d2c1 test: add test program to send SIM PIN 2011-03-26 12:28:29 -05:00
Guido Günther
7613b46b50 test: handle cancel and distinguish between initiate and respond (bgo #638038) 2011-01-14 12:56:52 -06:00
Guido Günther
3c13d9aec8 gsm: add preliminary USSD support (bgo #590798)
We currently convert to and from the modem's set charset and always pass
'15' as the data coding scheme. Passing the correct data coding scheme
as third argument to CUSD only upsets the network. This contradicts 3GPP
TS 23.038. Other tools like gsm-ussd handle it the same way.

Network responses that require further actions are not yet implemented.

(some fixes and cleanups by Dan Williams)
2010-11-05 14:50:50 -05:00
Dan Williams
1684d8b173 gsm: add SimIdentifier property
An obfuscated SimIdentifier that may be available before the PIN has
been entered, for use in auto-unlocking a device.  If this value is
present, it should be used in preference to DeviceIdentifier as it
is SIM-specific like the PIN code.
2010-10-25 17:41:08 -05:00
Dan Williams
328d2369a9 core: add DeviceIdentifier property
This is computed before any PIN is entered, and thus before we can
usually get IMEI or MEID/ESN out of the device in many cases. It's
therefore not the same as EquipmentIdentifier.

This is intended to be used by UI programs for matching devices with
PIN numbers for automatic unlocking.  While the PIN number is actually
*SIM* specific, no modems allow access to the IMSI before the PIN is
entered, and thus we cannot actually match the PIN with the SIM.  The
device ID is the next best thing we can use and should allow auto
unlocking in most cases.
2010-10-21 16:57:37 -05:00
Dan Williams
48aabcb60b test: add scan helper/tester 2010-08-30 14:39:25 -05:00
Dan Williams
fe2145ddc4 test: add modem info helper 2010-07-09 15:24:42 -07:00
Dan Williams
88ee478bb6 gsm: implement location API
Depends on dbus-glib 0.86 + this patch:

https://bugs.freedesktop.org/show_bug.cgi?id=28835

Still have to do the bits that allow plugins to add other
location capabilities, but that can come later.
2010-06-29 22:47:40 -07:00
Dan Williams
1c2df96f8d test: add some simple testing utilities 2010-06-29 22:24:00 -07:00
Dan Williams
c96e736700 test: fix lsudev crash 2010-04-09 19:03:03 -07:00
Dan Williams
564d054e8e cdma: increase data call initiation timeout
Some cards (Novatel S720 for example) can take a long time to start
a data call if the device isn't activated on the network or the
signal strength is low.
2010-01-19 14:35:48 -08:00
Dan Williams
1faead71aa test: handle various missing operator strings if the modem doesn't report them 2010-01-05 18:07:12 -06:00
Dan Williams
71cbcb834c build: don't require pppd headers to build
If they're not there, just ignore them and don't build the PPP-enabled
bits of the test tool.
2009-12-21 11:18:38 -08:00
Dan Williams
36d8d328c7 test: add support for static IP configured devices (ie, 'hso') 2009-12-21 10:02:57 -08:00
Dan Williams
a8fc7ecd77 test: add ability to drive ppp for connection tests 2009-12-20 00:17:12 -08:00
Dan Williams
87ee623923 test: fix build warning 2009-12-20 00:16:45 -08:00
Dan Williams
eaf167bebd test: argument parsing and connect improvements 2009-12-11 12:53:50 -08:00
Dan Williams
872fe9bf6b test: give some time before disconnecting 2009-12-02 14:42:58 -08:00
Dan Williams
3890009bcc test: actually send username and password when connecting 2009-11-29 22:45:03 -08:00
Dan Williams
01db3f1c2f test: give connect a bit more time
Registration can be part of the connect process, which can take quite a while.
2009-11-29 21:49:46 -08:00
Dan Williams
d5b0574f58 test: handle scan errors more gracefully 2009-11-29 18:56:29 -08:00
Dan Williams
50412ba3f9 test: handle signal quality exceptions 2009-11-24 15:16:58 -08:00
Dan Williams
1fe9150f5c test: add lsudev.c since I don't know where else to put it
A helpful little tool to debug udev device relationships.
2009-11-17 15:24:52 -08:00
Dan Williams
f916d939f3 test: add connect ability 2009-10-12 22:43:46 -07:00
Dan Williams
958b9048a3 cdma: split 1x and EVDO registration states
Like UMTS vs. GSM, EVDO and 1x are separate networks and technologies
and have separate registration state.  You can even be roaming on
EVDO while in your home 1x network.  Handle that.
2009-10-12 10:06:53 -07:00