Commit Graph
71 Commits
Author SHA1 Message Date
Aleksander Morgado 5a485d74a2 qcdm-serial-port: allow cancelling the response timeout 2012-03-16 14:53:22 +01:00
Aleksander Morgado 1f250585dd modem-helpers: refactor and reorganize sources 2012-03-16 14:53:21 +01:00
Aleksander Morgado 51c28d0f79 modem-helpers: new +CNUM response parser and tests 2012-03-16 14:53:21 +01:00
Aleksander Morgado 4a52a19c41 tests,modem-helpers: cleanup tests
Properly order the tests in blocks, and ensure that the common data for
registration tests is not passed to other non-registration related tests.
2012-03-16 14:53:21 +01:00
Aleksander Morgado 4c38ab4864 test,modem-helpers: remove conditional compilation
We require already GLib 2.30
2012-03-16 14:53:21 +01:00
Aleksander Morgado 8f200940ec tests: fix automake rule dependencies
We need to ensure all test programs are built.
2012-03-16 14:53:18 +01:00
Aleksander Morgado 21c0731ad9 tests: fix CGDCONT reply test, NULL expected instead of empty string 2012-03-16 14:53:17 +01:00
Aleksander Morgado 680e292914 build: fix header dependencies
We shouldn't depend on any header file from the previous implementation.
2012-03-16 14:28:15 +01:00
Aleksander Morgado 4de848de39 tests,sms: print traces if enabled during compilation 2012-03-16 14:28:15 +01:00
Aleksander Morgado 2522acf899 tests,sms: refactor SMS part related tests
Now using the MMSmsPart setup.
2012-03-16 14:28:15 +01:00
Aleksander Morgado 2a12322a80 modem-helpers: allow leading zeroes in CREG/CGREG responses 2012-03-15 14:15:06 +01:00
Aleksander Morgado f8cc4114ad qcdm-serial-port: no need to pass port type when creating the object 2012-03-15 14:15:05 +01:00
Aleksander Morgado cd184f33f9 test: new tester for CPMS=? results 2012-03-15 14:15:03 +01:00
Aleksander Morgado 516b097331 api,enums: renamed MMModemAccessTech' to MMModemAccessTechnology'
This one was the last enum without full name.
2012-03-15 14:14:35 +01:00
Aleksander Morgado b6a3ccd578 modem-helpers: renamed 3GPP registration related helpers with `mm_3gpp' prefix 2012-03-15 14:14:35 +01:00
Aleksander Morgado 5f4655c574 helpers: implement CGDCONT reply parsing
New method to parse the PDP query reply, and build a list of structs with the
found info.
2012-03-15 14:14:33 +01:00
Aleksander Morgado a92e9c59c1 modem-helpers: provide list of scanned networks in a list of structs
We provide the result of the +COPS=? parsing in a GList of MM3gppNetworkInfo
structures. We avoid the previous hash table, or using a dictionary, as a
list of structs with a predefined set of elements, which should be easier for
plugins wanting to make their own version
2012-03-15 14:14:30 +01:00
Aleksander Morgado b3389ff2d4 test-modem-helpers: fix C(G)REG parsing tests 2012-03-15 14:14:29 +01:00
Aleksander Morgado 5805a931e6 modem-helpers: use MMModemAccessTech when parsing C(G)REG responses 2012-03-15 14:14:29 +01:00
Aleksander Morgado c58db4e015 core: start using our newly defined errors 2012-03-15 14:14:25 +01:00
Aleksander Morgado 6b69605633 build: chain up new 0.6 API and link against libmm-common
Also removed the MMSerialError implementation from `src/mm-errors.[h|c]', as it
is now included in the new `include/ModemManager-errors.h' header file. All the
other enums and errors without clashing names will be ported afterwards to the
new base code.
2012-03-15 14:14:19 +01:00
Aleksander Morgado c164246642 tests: serial port tests don't need errors header 2012-03-15 14:14:17 +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
Aleksander Morgado 26d69ca0f2 gsm: allow leading zeroes in numbers in CREG/CGREG responses 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
Dan Williams 7b4d6cf605 test: fix SMS testcase errors due to uninitialized GError 2012-02-07 14:12:15 -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 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 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
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
Aleksander Morgado ea23851326 api: use common ModemManager.h for API, core and plugins 2011-08-19 22:54:48 +02:00
Nathan Williams 061d410888 sms: calculate user-data bit padding correctly
Fourth and final in a series.

This fixes an off-by-one (septet) error in the calculation of the
amount of data to skip in the presence of a user data header, and adds
the test case from the wild that triggered it.
2011-07-25 01:18:35 -05:00
Nathan Williams c717dbd928 sms: add unit tests
Second in a series. Builds on the previous by actually unit-testing
the sms_parse_pdu() function. Note that the dcf1 test does not pass
as the code is currently written.
2011-07-25 01:18:22 -05:00
Nathan Williams d05c87e4c8 charset: change GSM unpack to take number of characters rather than octets
Change interface to take the number of GSM characters
rather than the number of octets, so that it is possible to
distinguish the 7-character and 8-character cases.
2011-04-14 13:30:15 -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 292c98029d test: fix CIND test index checking
CIND indexes returned from helper are 1-based, not 0-based, because
that makes it easier to match against the modem's unsolicited CIND
message.
2010-12-21 11:54:47 -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 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 a2d54b1437 trivial: avoid build warning by using g_message() correctly 2010-11-03 10:03:51 -05:00
Dan Williams 0ec4dbcc1a trivial: fix formatting 2010-10-22 11:25:03 -05: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