Commit Graph
46 Commits
Author SHA1 Message Date
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
Dan Williams 8a4f621245 core: add more QCDM frame marker testcases 2010-10-14 10:22:41 -05:00
Dan Williams e16a58e54b core: add basic QCDM serial port unit tests
Test that a Version Info request/response works as expected, and
add a testcase for a bug where specific Sierra CnS responses to
the Version Info request do not properly return an error when
attempting to parse the response as a QCDM packet.  Fix for the
second thing forthcoming.
2010-10-14 00:10:46 -05:00
Dan Williams 3c8c3f7425 test: add CGREG repsonse test for X220D
To test spaces between some members of the response.
2010-09-27 14:48:46 -05:00
Dan Williams 85f827ddff trivial: remove unused code 2010-09-04 00:15:02 -05:00
Dan Williams 34709e0c7b trivial: whitespace fixup 2010-09-04 00:07:09 -05:00
Dan Williams ee4166f66f gsm: add GSM 03.38 pack/unpack functions and testcases 2010-09-04 00:06:36 -05:00
Dan Williams 9e94dd5b61 gsm: add GSM 03.38 encoding/decoding functions and testcases 2010-09-02 19:29:05 -05:00
Vincent Untz be28089dc4 build: fix build with glib >= 2.25.12 (bgo #626421)
Work around an API break in glib.
2010-08-09 10:31:45 -05:00
Dan Williams 437c4ea8d9 test: add a few more CREG/CGREG responses 2010-05-25 15:24:27 -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 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 7fdacfc89b test: add SE K600i COPS response testcase 2010-02-08 11:45:50 -08:00
Dan Williams eeb7807044 test: add Gobi COPS response testcase 2010-01-05 23:24:59 -06:00
Dan Williams d3b5688d43 test: add Nokia 2720 COPS response testcase 2010-01-05 21:54:05 -06:00
Dan Williams 008c7e322d test: add Novatel XU870 and Option GT Ultra Express COPS response testcases 2010-01-05 21:47:40 -06:00
Dan Williams f444533a74 test: add +COPS response testcases for E1550, MF622, and E226 2010-01-05 18:07:29 -06: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