Open Source Telephony
 help / color / mirror / Atom feed
From: Clement Viel <vielclement@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 2/3] sim800: add udev detection
Date: Wed, 19 Sep 2018 22:01:36 +0200	[thread overview]
Message-ID: <20180919200135.GD3536@turing> (raw)
In-Reply-To: <87d6a98b-e80c-1f82-3c40-93d6ddc13e3d@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3220 bytes --]

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 <vielclement@gmail.com>
> >
> >---
> >  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

  reply	other threads:[~2018-09-19 20:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18 20:36 [PATCH 1/3] sim800: adding support for Simcom SIM800 modem =?unknown-8bit?q?Cl=C3=A9mentViel?=
2018-09-18 20:36 ` [PATCH 2/3] sim800: add udev detection =?unknown-8bit?q?Cl=C3=A9mentViel?=
2018-09-19 16:46   ` Denis Kenzior
2018-09-19 20:01     ` Clement Viel [this message]
2018-09-19 20:03       ` Denis Kenzior
2018-09-19 20:10         ` Clement Viel
2018-09-18 20:36 ` [PATCH 3/3] sim800: adding documentation to inform about the udev rule the user must add =?unknown-8bit?q?Cl=C3=A9mentViel?=
2018-09-19 16:43   ` Denis Kenzior
2018-09-19 19:25     ` Clement Viel
2018-09-19 19:27       ` =?unknown-8bit?q?Pi=C4=8Dugins?= Arsenijs
2018-09-20 22:05   ` Pavel Machek
2018-09-19 16:51 ` [PATCH 1/3] sim800: adding support for Simcom SIM800 modem Denis Kenzior
2018-09-19 17:03   ` =?unknown-8bit?q?Pi=C4=8Dugins?= Arsenijs
2018-09-19 19:52     ` Clement Viel
2018-09-19 19:45   ` Clement Viel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180919200135.GD3536@turing \
    --to=vielclement@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox