Commit Graph

33 Commits

Author SHA1 Message Date
Aleksander Morgado
c58db4e015 core: start using our newly defined errors 2012-03-15 14:14:25 +01:00
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
Aleksander Morgado
26d69ca0f2 gsm: allow leading zeroes in numbers in CREG/CGREG responses 2012-02-17 13:25:02 +01: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
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
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
Dan Williams
889ae2fb4b gsm: fix parsing of unsolicited CREG/CGREG response with RAC 2011-10-27 16:38:11 -05:00
Dan Williams
ccad4aaa9d gsm: add regex for unsolicited CREG/CGREG response with RAC 2011-10-27 15:13:30 -05:00
Nathan Williams
8710820156 core: ensure that GMatchInfo and GRegex objects are freed properly
In particular, g_regex_match() and g_regex_match_full() allocate a
match_info structure on both success and failure, so calling
g_match_info_free() only in the success case is insufficient.

BUG=None
TEST=Inspection

Change-Id: Iea76b5b5dc3ec48120e15601a5e2dd45322133d8
2011-09-27 13:40:39 -05:00
Dan Williams
0c4b94458a gsm: fix for parsing malformed Gobi CREG response
From an HP un2400;

GMR: D1020-SUUAASFA-4352  1  [Apr 14 2008 18:00:00]
GMM: 88
2011-03-11 21:36:55 -06:00
Dan Williams
16039244bb core: rework logging
Make it more flexible, add logging to a file, and absolute and
relative timestamps.
2011-01-23 20:51:48 -06:00
Michał Sroczyński
f4d4569cdd gsm: correctly parse Samsung S8500 Wave CREG response
(testcases by dcbw)
2011-01-11 13:42:54 -06:00
Dan Williams
a502fd2b19 gsm: add access technology support for HSPA+ 2011-01-01 11:55:41 -06:00
Dan Williams
ea0797cbec gsm: prefer AT+CIND signal quality for modems that support it (lp:682282) (bgo #636040)
Some devices always reply with 99 for AT+CSQ when in UMTS mode (Linktop LW273)
so if the modem supports it, use CIND/CIEV instead.
2010-11-30 10:04:46 -06:00
Dan Williams
6d37c9b471 core: +CIND indexes start at 1 2010-11-28 21:46:27 -06:00
Dan Williams
2dd59c3ddd core: add index to CIND helper 2010-11-28 21:34:00 -06:00
Dan Williams
9479c04aec core: add +CIND parsing helpers 2010-11-28 19:45:53 -06:00
Dan Williams
7ae8ffe21b core: use hardware IDs as part of DeviceIdentifier
Pass the device's hardware IDs through modem creation and use them
when calculating the device's identifier.  Add a bunch of testcases
for real hardware to ensure we don't break the device ID in the
future unless we really want to.
2010-10-22 11:06:48 -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
9cbd68e96c cdma: return numeric ERI too 2010-05-18 13:04:43 -07:00
Dan Williams
533ffaddc4 cdma: make ERI parsing generic 2010-05-18 12:24:42 -07:00
Dan Williams
5769929668 helpers: add generic helper for string -> access technology 2010-05-01 22:41:33 -07:00
Dan Williams
0d381e2f11 gsm: fix CSCS=? parsing and add testcases
Some devices (at least one Blackberry we know about) don't include
the () around the response.  Handle that and add testcases for it.
2010-04-09 13:50:45 -07:00
Dan Williams
7fbe4d8383 cdma: check SPSERVICE and SPERI when getting registration state 2010-03-22 00:28:21 -07:00
Dan Williams
3b32e2a679 cdma: check for +SPSERVICE and $SPERI
Which are Sprint-specific commands which appear to be implemented by
various phones for getting access technology and roaming status.
2010-03-21 17:50:45 -07:00
Dan Williams
4558df894b helpers: add generic response stripping function 2010-03-19 10:57:01 -07:00
Dan Williams
46ec3bdb47 gsm: fix CREG/CGREG parsing with multiple responses
When a modem sends both CREG and CGREG in the same response packet,
the parser was failing to correctly distinguish which response
was being parsed, since the string passed to g_regex_match() is
the whole response including both CREG + CGREG.
2010-03-09 23:34:19 -08:00
Dan Williams
ad7bbb2f16 gsm: indicate CREG vs. CGREG 2010-03-05 14:08:40 -08:00
Dan Williams
e4350152c8 gsm: common CREG/CGREG parsing function and testcases 2010-03-05 11:47:23 -08:00
Dan Williams
c30f23e02c gsm: add testcase for invalid +COPS response 2010-01-05 15:03:06 -06:00
Dan Williams
3988f53d2e gsm: correctly parse Nokia N80 +COPS response 2010-01-05 14:57:30 -06:00
Dan Williams
216e49f8d8 gsm: split out +COPS response parsing and add testcases 2010-01-05 14:29:19 -06:00