udev: fix detection of HP HS2330 (3607gw)
authorMichael Schloh von Bennewitz <ofonoconn@encambio.com>
Thu, 30 Jun 2011 05:39:44 +0000 (00:39 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 30 Jun 2011 05:39:44 +0000 (00:39 -0500)
commit 6a2847f7aba5d84b06940ee29300d4b6fd31d682 introduced basic
detection of HP HS2330 based on OEM Ericsson F3607gw modems.

Because some (or all?) HS2330 modems contain flawed text identifiers
containing strange (probably erroneous) binary sequences in place of
the ASCII space '\x20' character, the previous commit is incomplete.
The following logic detects the modem properly, by comparing binary
data as well as ASCII text values.

plugins/udev.c

index 8ea937c..4faf63e 100644 (file)
@@ -134,6 +134,7 @@ static void add_mbm(struct ofono_modem *modem,
                        (g_str_has_suffix(desc, "Minicard Data Modem") ||
                        g_str_has_suffix(desc, "Mini-Card Data Modem") ||
                        g_str_has_suffix(desc, "Module Data Modem") ||
+                       g_str_has_suffix(desc, "Module\xc2\xa0""Data Modem") ||
                        g_str_has_suffix(desc, "Broadband Data Modem"))) {
                devnode = udev_device_get_devnode(udev_device);
                ofono_modem_set_string(modem, DATA_DEVICE, devnode);