Bug 92243 - SMS Storage couldn't be parsed on Huawai MU609
Summary: SMS Storage couldn't be parsed on Huawai MU609
Status: RESOLVED FIXED
Alias: None
Product: ModemManager
Classification: Unclassified
Component: general (show other bugs)
Version: git master
Hardware: All All
: medium normal
Assignee: ModemManager bug user
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-02 13:59 UTC by Titouan Mesot
Modified: 2015-12-02 21:47 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Titouan Mesot 2015-10-02 13:59:25 UTC
Hello, 
I have some trouble with a Huawei MU609 modem. The SMS storage is detected as unknown so SMS can not be deleted on the SIM card and it became full. 

Here is the debug log : 

<debug> [1443785966.873323] [mm-iface-modem-messaging.c:1127] load_supported_storages_ready(): Couldn't load supported storages: 'Couldn't parse supported storages reply: '+CPMS: "SM","SM","SM"''

<info>  [1443785976.459443] [mm-iface-modem-messaging.c:968] interface_enabling_step(): Cannot set default storage, none of the suggested ones supported. 

The problem seems to be located in mm_3gpp_parse_cpms_test_response() in mm-modem-helpers.c. This method use g_strsplit_set and a regex to detect the replay based on this example : 

+CPMS: ("SM","ME"),("SM","ME"),("SM","ME")

but this Huawei one is formated differently : 

+CPMS: "SM","SM","SM"

So method return false ... and the messaging store is detected as unknown. 

For testing propose I modified those lines : 

split = g_strsplit_set (mm_strip_tag (reply, "+CPMS:"), "()", -1);
r = g_regex_new ("\\s*\"([^,\\)]+)\"\\s*", 0, 0, NULL);

by those ones

split = g_strsplit_set (mm_strip_tag (reply, "+CPMS:"), ",", -1);
r = g_regex_new ("\\s*([^,\\)]+)\\s*", 0, 0, NULL);

and it works on my hardware but I don't own another to test if it's the good way to fix this. 

Hope it could help to fix this bug upstream. 

Regards, 
Titouan Mesot
Comment 1 Titouan Mesot 2015-10-06 11:58:53 UTC
Hello, 
Sorry, the small fix I send was not the good one ...

ModemManager current code is : 


split = g_strsplit_set (mm_strip_tag (reply, "+CPMS:"), "()", -1);
r = g_regex_new ("\\s*\"([^,\\)]+)\"\\s*", 0, 0, NULL);


and it should be replaced by this one (for Huawei MU609)


split = g_strsplit_set (mm_strip_tag (reply, "+CPMS:"), "\"", -1);
r = g_regex_new ("\\s*([^,\\)]+)\\s*", 0, 0, NULL);

As before, I don't know if it breaks compatibility for other modems, be careful !
Comment 2 Aleksander Morgado 2015-10-20 08:02:59 UTC
Hey!

Would you be willing to write a proper git patch with your changes, but also adding unit tests to make sure the previous parsing isn't broken? I could gide you on the steps required to do that.
Comment 3 Aleksander Morgado 2015-12-02 21:47:43 UTC
Fixed in git master and the mm-1-4 branch:

http://cgit.freedesktop.org/ModemManager/ModemManager/commit/?id=508a37a8916a70831cc74cba1d8b977cf95e4a27


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.