Commit Graph
1781 Commits
Author SHA1 Message Date
Aleksander Morgado bc118aa160 modem-helpers: plug memleak
g_match_info_fetch() returns always a heap-allocated string which should be
freed by the caller.
2012-02-29 16:51:50 +01:00
Dan Williams 4dad94d500 core: rework port grabbing and organization
Make port roles more flexible.  We have modems that do PPP
on interfaces other than the primary interface, and that
wasn't possible with the old code.  So clean up all that
logic and move the port organization code into the core
so we can reduce code in the plugins.

In the new world order, the plugins say whether the port
is a QCDM port, an AT port, or ignored.  If it's an AT
port the plugins get to tag it as primary, secondary, or
PPP, or any combination of the 3.  This allows for modems
where PPP should really be done on the secondary port
(Huawei E220, Sierra devices) so that the primary port
stays open for command and status.

Modem subclasses no longer get asked to handle port grabbing
themselves.  Instead, that's now done by the generic classes
(MMGenericCdma and MMGenericGsm) and the plugins are notified
when a port is grabbed so they can add unsolicited response
handlers for it.  After all ports are grabbed by the generic
classes, they get "organized", which assigns various ports
to the roles of PRIMARY, SECONDARY, DATA, and QCDM based
on specific rules and hints that the plugin provided (which
are expressed as MMAtPortFlags).  The plugins then have
a chance to perform fixups on the primary port if they choose.

The plugin code is responsible for determining the port
hints (ie MMAtPortFlags) at probe time, instead of having
a combination of the plugin and the modem class do the
job.  This simplifies things greatly for the plugins at
the expense of more complicated logic in the core.
2012-02-28 10:06:04 -06:00
Tom Goetz 86bfe96ddb cdma: fix crash on NULL error (bgo #670145) 2012-02-25 20:06:33 -06:00
Aleksander Morgado b42ce2d8e6 charsets: plug memleak
The string passed to utils_bin2hexstr() needs to be freed afterwards.
2012-02-18 11:15:31 +01:00
Aleksander Morgado 7b8e9203f2 gsm: don't query PS network registration status if not supported 2012-02-17 13:25:03 +01:00
Aleksander Morgado 920fefa8e2 modem: new property to allow specifying longer timeouts when configuring IP
This IpTimeout property will be read by NetworkManager, and used as the time to
wait for pppd to establish the IP configuration.
2012-02-17 13:25:03 +01:00
Aleksander Morgado 4b0cd28baf iridium: fix operator name and code to be reported 2012-02-17 13:25:02 +01:00
Aleksander Morgado 3a7f970931 gsm: let plugins override the operator name and code retrieval 2012-02-17 13:25:02 +01:00
Aleksander Morgado 26d69ca0f2 gsm: allow leading zeroes in numbers in CREG/CGREG responses 2012-02-17 13:25:02 +01:00
Aleksander Morgado 40512451cc generic: only send CGACT if PS network is supported 2012-02-17 13:25:02 +01:00
Aleksander Morgado 740680fd3b generic: query PS network registration status only if PS network supported by the modem 2012-02-17 13:25:02 +01:00
Aleksander Morgado a87b4b46c8 gsm: set pin check flag before requesting ICCID check 2012-02-17 13:25:02 +01:00
Aleksander Morgado 7cbc8f3b80 gsm: allow no whitespaces before CPIN? reply value 2012-02-17 13:25:02 +01:00
Aleksander Morgado 670f560b3d iridium: add initial dummy plugin 2012-02-17 13:25:02 +01:00
Aleksander Morgado 20693529ef core: fix loop limits in echo removal
-1 was actually correct, if data->len is 10, i goes from 0 to 8.
2012-02-16 18:20:31 +01:00
Aleksander Morgado 21162a366a at-serial-port: implement built-in echo/garbage removal
We expect the responses to start always with <CR><LF>. We just remove anything
that comes before that.
2012-02-16 10:27:22 +01:00
Aleksander Morgado 1db0004033 charsets: don't crash when passing a NULL string to the UTF-8 converter 2012-02-08 12:06:59 -06:00
Dan Williams 7b4d6cf605 test: fix SMS testcase errors due to uninitialized GError 2012-02-07 14:12:15 -06:00
Dan Williams 2104cd725a gsm: ensure text mode SMS list doesn't pick up too much text
This likely has no effect, but just make sure the regex stops
grabbing message content when it hits the CF/LF that terminates
the message content in text mode.
2012-02-07 13:59:32 -06:00
Dan Williams c7f54a635a gsm: fix text mode SMS list regex for single messages
We don't get a \r\n at the end for single messages.
2012-02-07 13:48:47 -06:00
Aleksander Morgado 4af8483ae4 gsm: use new common charset converter when parsing operator name/code 2012-02-07 19:24:50 +01:00
Aleksander Morgado 03678df6fd gsm: convert SMS text and number from current charset to UTF-8 2012-02-07 19:24:36 +01:00
Aleksander Morgado 00ce1d6874 charsets: new method to do our best to convert from current charset to UTF-8
This method will try to convert the input string to UTF-8. The input string is
supposed to be in the given charset; or otherwise is supposed to be the hex
representation of the string in the given charset.
2012-02-07 19:24:36 +01:00
Aleksander Morgado 9f6f80a63a charsets: don't warn if we couldn't convert from hex to utf8 2012-02-07 17:52:53 +01:00
Aleksander Morgado 0c6e5e713e core: plug leaks when passing GValueArrays to dbus_g_method_return()
The ownership of the GValueArray is not transferred.
2012-02-07 11:42:06 +01:00
Dan Williams 4706ea488e sms: handle text mode SMS listing
Undoubtedly we'll need to adjust the regex but this works for now.
2012-02-02 21:12:44 -06:00
Dan Williams 14a59c4384 gsm: fix listing SMS messages in text mode
Even though we don't parse them correctly yet, at least
send the right command for listing them.
2012-02-01 11:21:20 -06:00
Dan Williams d84214184c gsm: fix setting PDU mode for SMS messages
Stupid signed/unsigned mistake.
2012-02-01 10:45:47 -06:00
Dan Williams 20a1c412fd core: fix warning about MMModemTime interface initialization
The MMModemTime interface was getting initialized more than once.
2012-02-01 01:43:28 -06:00
Thomas Tuttle 0e246fb61d time: poll for timezone
Signed-off-by: Thomas Tuttle <ttuttle@chromium.org>
2012-01-27 15:14:24 -06:00
Thomas Tuttle 8121b8e319 time: implement ModemTime in ModemBase
Signed-off-by: Thomas Tuttle <ttuttle@chromium.org>
2012-01-27 14:38:52 -06:00
Thomas Tuttle 7f12201494 time: implement MMModemTime boilerplate
Signed-off-by: Thomas Tuttle <ttuttle@chromium.org>
2012-01-25 15:54:28 -06:00
Dan Williams 8915f7964a core: fix copy & paste error 2012-01-23 15:52:47 -06:00
Aleksander Morgado 83b92ecebc ussd: ensure coded string is valid before stripping quotes 2012-01-23 15:43:55 +01:00
Aleksander Morgado 62e94727fe ussd: plug a leak 2012-01-23 15:31:58 +01:00
Dan Williams f9a32a47ed gsm: fix return value of SMS send method
The introspection data specified the Send() method to return
an array of unsigned integers, presumably the indexes of the
messages just sent.  But the code wasn't doing that, leading
to a crash when dbus-glib tried to interpret garbage on the
return.

The problem is that sms_send_auth_cb() gave async_call_done()
as the callback for sending the SMS, but that method just calls
dbus_g_method_return() with no return arguments.  dbus-glib
interprets the arguments of dbus_g_method_return() according
to the XML introspection data, and thus it was attempting to
read the non-existent argument as an 'au' and getting garbage.

Fix that by actually returning an array of message indexes from
the SMS send code, and propagate that back to the SMS dbus
code so it can return something sensible.
2012-01-18 18:08:20 -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 5c561995aa gsm: fix CMGS PDU mode length calculation
The first byte of the PDU is the SMSC length, but it's not
the padded SMSC length.  So we need to subtract the actual
byte index of the start of the message from length of the
PDU, and since the PDU creation function knows all about
where the SMSC address stops and the message begins, just
have it return that length instead of making the callers
calculate it.
2012-01-18 15:26:12 -06:00
Dan Williams d51ff9ac07 gsm: use PDU modem when the modem doesn't support text mode
Eventually we should be using PDU mode whenever the modem supports
it instead of defaulting to text mode, but there are still some
bugs.
2012-01-18 13:45:03 -06:00
Dan Williams 3f4056caab tests: add a test for 25-character SMS messages
Tests that the last septet (packed in an octet by itself)
doesn't get left off the message like the old code used to
do before "core: fix some bugs in GSM7 packing code".
2012-01-18 12:56:52 -06:00
Dan Williams 27b981237e core: fix some bugs in GSM7 packing code
The existing gsm_pack() had a bug where if the last
septet should be in an octet by itself, that last
octet wouldn't be added.  Plus, kinda pointless to
use a GByteArray here when we already know what the
length will be through simple arithmetic.

We can also simplify the function too.

Furthermore, there weren't any testcases for starting
packing at an offset other than zero, so add one.
2012-01-18 12:28:50 -06:00
Dan Williams 80a41ed11b gsm: add SMS PDU creation function
Only for basic SMS-SUBMIT PDUs at the moment, and doesn't
support large SMSs yet.
2012-01-17 13:13:09 -06:00
Dan Williams dec9cc66eb core: register SMS errors with dbus-glib 2012-01-16 14:11:25 -06:00
Dan Williams bab6ae9552 serial: handle CMS errors correctly 2012-01-16 12:22:18 -06:00
Dan Williams 7dea934844 core: add CMS errors 2012-01-16 12:15:43 -06:00
Dan Williams 86e3ab1540 sms: punt handling of 8-bit encoded SMSs to clients
There's no encoding information about 8-bit SMS messages,
and they are often binary things like ringtones or voicemail
indicator commands.  Since there's no point to our parsing
them just let clients deal with it.
2012-01-09 17:23:48 -06:00
Dan Williams 30bb9e878f cdma: fixes for libqcdm changes 2012-01-03 00:30:59 -06:00
Aleksander Morgado a2b578d755 modem-helpers: plug a leak when parsing CREG responses 2011-12-30 19:34:39 +01:00
Aleksander Morgado d38787c460 modem-helpers: plug a leak when building device ID 2011-12-30 19:34:21 +01:00
Aleksander Morgado 9ee88e8286 serial-parsers: plug small leak 2011-12-30 18:43:03 +01:00