Commit Graph
620 Commits
Author SHA1 Message Date
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
Dan Williams 9f14d83047 gsm: treat "no network" error as zero signal for Simple.GetStatus 2011-12-14 14:19:10 -06:00
Dan Williams 2af1a612e9 core: don't crash on error if response is NULL
Various bits of the code didn't check if response was valid
or not during error conditions, and when an error occurs
sometimes it'll be NULL (since not all errors are translated
errors from the modem, some are serial or general ones).  We
have to make sure we don't try to use response->str when
response doesn't exist.

Found in the generic CDMA code likely as a result of
d5d9eec2b5 but was a bug long
before that commit happened anyway.
2011-12-07 17:07:46 -06:00
Nathan Williams c1e64f1a33 gsm: improve scan response regex construction error handling
Change the error handling to be a bit more like what appears to have
been intended: if constructing the regex fails, report an error and
return. The existing code looked like it was set up to do this, but
wasn't quite wired together, and had process-terminating calls
(g_error()) followed by other code.

Change-Id: I4a7cee8fe01291976edc2e343fcbeb73e882f20b
2011-12-02 13:06:44 -06:00
Nathan Williams 58b2a79f83 sms: fix two bugs with multipart SMS handling: signals and listing
First, arrange for received/complete signals to be sent by calling
cmti_received_has_sms() with the message properties even if the
message isn't complete yet.

Second, make the operation of the List command's multipart message
handling independent of message order by doing one pass to insert the
messages into the cache and second pass to retrieve the complete messages.

Change-Id: I3dcae940d71aec3ddb65c508675f710d1567b0e2
2011-12-02 12:57:36 -06:00
Vitaly Gimly ae92c74a77 trivial: remove unecessary semicolons 2011-11-30 10:56:50 -06:00
Jiří Klimeš 65340bdf6c cdma: free one more GError 2011-11-30 12:38:52 +01:00
Nathan Williams 8d64d0fdda gsm/cdma: free up a couple of dangling GErrors
Change-Id: I4f07e7e08bcbfc116114191c759cc0af4bb8ea23
2011-11-30 09:38:42 +01:00
Nathan Williams d5d9eec2b5 serial: report port-not-open in queueing commands via callback
Reporting errors instead of just returning permits routines like
mm-generic-gsm.c:simple_get_status() to work again, as their callbacks
get the error they are expecting. To make this work, adapt get_csq_done()
to handle a NULL response when error is set, and make sure that multiple
errors don't step on each other in the mm_callback_info_chain() sequence
created by simple_get_status().

Change-Id: Ie3a72b1ce71b7f117e8b1f3da7a406c4d2da9e02
2011-11-30 09:38:42 +01:00
Dan Williams 02aa10c72a gsm: check facility locks after unlocking PIN
Some modems don't allow most commands when they are PIN locked, so
the initial facility lock check errors out.  Check the locks again
after the SIM is unlocked.
2011-11-16 23:41:49 -06:00
Eric Shienbrood eede5bb621 gsm: add new property to track which facility locks are enabled
The property EnabledFacilityLocks on the .Modem.Gsm.Card interface
is a bit mask that indicates which of the various personalization
codes from 3GPP TS 22.022, plus the SIM PIN lock and SIM PIN2 lock,
are enabled. The set of facility locks supported by the modem is
determined at the time the modem is initialized, and the state of
each supported lock (enabled or disabled) is determined. When the
state of a lock changes, a property-change signal is sent out. Note
that ModemManager only supports enabling and disabling SIM-PIN, via
the EnablePin method on Modem.Gsm.Card.
2011-11-16 23:41:49 -06:00
Eric Shienbrood e7b6b2dc1c core: keep track of all PIN retry counts
Added a PinRetryCounts property on org.freedesktop.ModemManager.Modem.
This is dictionary that records the number of PIN tries remaining
for each of the possible PIN code types for which the modem is
capable of reporting the count. Also, these counts are kept up
to date across ChangePin and EnablePin operations, not just when
an unlock is attempted.
2011-11-16 17:42:50 -06:00