On Wed, Sep 19, 2018 at 11:46:34AM -0500, Denis Kenzior wrote:
Hi,

> Hi,
> 
> On 09/18/2018 03:36 PM, ClémentViel wrote:
> >From: clem <[email protected]>
> >
> >---
> >  plugins/udevng.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 49 insertions(+)
> >
> >diff --git a/plugins/udevng.c b/plugins/udevng.c
> >index 02d049e..9a1be6a 100644
> >--- a/plugins/udevng.c
> >+++ b/plugins/udevng.c
> >@@ -710,6 +710,53 @@ static gboolean setup_telitqmi(struct modem_info *modem)
> >     return TRUE;
> >  }
> >+static gboolean setup_sim800(struct modem_info *modem)
> >+{
> >+    const char *mdm = NULL, *aux = NULL, *gps = NULL, *diag = NULL;
> >+    GSList *list;
> >+
> >+    DBG("%s", modem->syspath);
> >+
> >+    for (list = modem->devices; list; list = list->next) {
> >+            struct device_info *info = list->data;
> >+
> >+            DBG("%s %s %s %s", info->devnode, info->interface,
> >+                    info->number, info->label);
> >+
> >+            if (g_strcmp0(info->label, "aux") == 0) {
> >+                    DBG("setting aux as info->devnode");
> >+                    aux = info->devnode;
> >+                    if (mdm != NULL)
> >+                    break;
> >+            } else if (g_strcmp0(info->label, "modem") == 0) {
> >+                    mdm = info->devnode;
> >+                    if (aux != NULL)
> >+                    break;
> >+            } else if (g_strcmp0(info->interface, "255/0/0") == 0) {
> >+                    if (g_strcmp0(info->number, "00") == 0)
> >+                            mdm = info->devnode;
> >+                    else if (g_strcmp0(info->number, "01") == 0)
> >+                            gps = info->devnode;
> >+                    else if (g_strcmp0(info->number, "02") == 0)
> >+                            aux = info->devnode;
> >+                    else if (g_strcmp0(info->number, "03") == 0)
> >+                            mdm = info->devnode;
> >+            }
> >+    }
> >+
> 
> So I'm confused now.  If sim800 is a serial device, why do you have all this
> here?  Shouldn't this be handled by setup_serial_modem ?
> 

Because the modem was seen through a serial/USB converter, my kernel sees it as 
a USB device. So I used this function.
Should this be coded in a more generic way ?

> >+    DBG("modem=%s aux=%s gps=%s diag=%s", mdm, aux, gps, diag);
> >+
> >+    if (mdm == NULL) {
> >+            DBG("modem did not set up");
> >+            return FALSE;
> >+    }
> >+
> >+    ofono_modem_set_string(modem->modem, "Device", mdm);
> >+    ofono_modem_set_string(modem->modem, "Modem", mdm);
> >+
> >+    return TRUE;
> >+}
> >+
> >  /* TODO: Not used as we have no simcom driver */
> >  static gboolean setup_simcom(struct modem_info *modem)
> >  {
> >@@ -1282,6 +1329,7 @@ static struct {
> >     { "telit",      setup_telit,    "device/interface"      },
> >     { "telitqmi",   setup_telitqmi  },
> >     { "simcom",     setup_simcom    },
> >+    { "sim800",     setup_sim800    },
> >     { "sim7100",    setup_sim7100   },
> >     { "zte",        setup_zte       },
> >     { "icera",      setup_icera     },
> >@@ -1654,6 +1702,7 @@ static struct {
> >     { "alcatel",    "option",       "1bbb", "0017"  },
> >     { "novatel",    "option",       "1410"          },
> >     { "zte",        "option",       "19d2"          },
> >+    { "sim800",     "option",       "05c6", "9000"  },
> >     { "simcom",     "option",       "05c6", "9000"  },
> >     { "sim7100",    "option",       "1e0e", "9001"  },
> >     { "telit",      "usbserial",    "1bc7"          },
> >

I must use tabs instead of spaces....I have no excuses...

> 
> Regards,
> -Denis

Regards
Clem
_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to