All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 2/6] gemalto: support ALS3 in gemalto's plugin
Date: Fri, 16 Mar 2018 09:23:19 -0500	[thread overview]
Message-ID: <dfdb1740-fa49-61ac-627b-2fe6ba0d3659@gmail.com> (raw)
In-Reply-To: <8218aab0-70f1-a997-ebd7-3bcea51676ad@smile.fr>

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

Hi Gabriel,

>>>   { >>>       struct gemalto_data *data = ofono_modem_get_data(modem);
>>>       const char *app, *mdm;
>>>   -    DBG("%p", modem);
>>> +    /* Close devices */
>>> +    g_at_chat_unref(data->mdm);
>>> +    g_at_chat_unref(data->app);
>>> +
>>
>> Why would you close both devices?  It is unnecessary, especially in 
>> the case that the modem is already up and responding to commands.
> Because it seems that opening the device while it is not ready leads the 
> driver to a weird state.
> When the modem becomes ready, I am not able to send any AT command to 
> the APP device.
> Here is the output:
> 
> ofonod[12826]: src/modem.c:get_modem_property() modem 0x72b750 property 
> Application
> ofonod[12826]: src/modem.c:get_modem_property() modem 0x72b750 property 
> Modem
> ofonod[12826]: plugins/gemalto.c:open_device() Opening device /dev/ttyACM1
> ofonod[12826]: plugins/gemalto.c:open_device() Opening device /dev/ttyACM0
> ofonod[12826]: plugins/gemalto.c:gemalto_modem_ready()
> ofonod[12826]: plugins/gemalto.c:gemalto_initialize()
> ofonod[12826]: src/modem.c:get_modem_property() modem 0x72b750 property 
> Application
> ofonod[12826]: src/modem.c:get_modem_property() modem 0x72b750 property 
> Modem
> ofonod[12826]: plugins/gemalto.c:gemalto_hardware_monitor_enable()
> ofonod[12826]: Mdm> ATE0\r
> ofonod[12826]: Mdm< ATE0\r\r\nOK\r\n
> ofonod[12826]: Mdm> AT&C0\r
> ofonod[12826]: Mdm< \r\n+CME ERROR: operation not supported\r\n
> ofonod[12826]: src/modem.c:set_powered_timeout() modem: 0x72b750
> 
> When it is re-opened, it works fine.

So my question was two fold:

1. Why would you open both devices?  Wouldn't opening just one to figure 
out whether the modem is 'ready' or not be enough?
2. If the modem is ready, why would you close the opened device?  That 
just seems to be a waste of time.

If the device isn't ready then I could see how re-opening the port might 
be required.

>>> +
>>> +    if(!strncmp(model, GEMALTO_MODEL_ALS3, 4)) {
>>> +        ofono_lte_create(modem, "atmodem", data->app);
>>> +    }
>>
>> Why strncmp?  No need for {} and there should be a space between if 
>> and '('
> Because strncmp is more secured than strcmp. But if you prefer strcmp or 
> anything else, I'll change it.

In this case they're the same and its not like you have user input to 
worry about here...

Regards,
-Denis

  reply	other threads:[~2018-03-16 14:23 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15 12:49 [PATCH 0/6] gemalto's ALS3 and PHS8P support Gabriel Lucas
2018-03-15 12:49 ` [PATCH 1/6] gemalto: add detection of ALS3 modem Gabriel Lucas
2018-03-15 17:22   ` Denis Kenzior
2018-03-15 12:49 ` [PATCH 2/6] gemalto: support ALS3 in gemalto's plugin Gabriel Lucas
2018-03-15 17:11   ` Denis Kenzior
2018-03-16 10:30     ` Gabriel Lucas
2018-03-16 14:23       ` Denis Kenzior [this message]
2018-03-16 15:53         ` Gabriel Lucas
2018-03-16 15:59           ` Gabriel Lucas
2018-03-16 16:08             ` Gabriel Lucas
2018-03-16 16:08             ` Denis Kenzior
2018-03-19  9:45               ` Gabriel Lucas
2018-03-19 13:50                 ` Denis Kenzior
2018-03-19 15:15                   ` Gabriel Lucas
2018-03-19 15:24                     ` Denis Kenzior
2018-03-15 12:49 ` [PATCH 3/6] gemalto: acquire the network technology Gabriel Lucas
2018-03-15 17:19   ` Denis Kenzior
2018-03-16 12:04     ` Gabriel Lucas
2018-03-16 12:59     ` Gabriel Lucas
2018-03-16 14:27       ` Denis Kenzior
2018-03-16 15:30         ` Gabriel LUCAS
2018-03-15 12:49 ` [PATCH 4/6] gemalto: handle sim is inserted or removed URCs Gabriel Lucas
2018-03-15 17:26   ` Denis Kenzior
2018-03-16 13:28     ` Gabriel Lucas
2018-03-16 14:03       ` Denis Kenzior
2018-03-19 15:57         ` Gabriel Lucas
2018-03-19 16:08           ` Denis Kenzior
2018-03-19 16:26             ` Gabriel Lucas
2018-03-19 17:10               ` Denis Kenzior
2018-03-20  8:37                 ` Gabriel Lucas
2018-03-15 12:49 ` [PATCH 5/6] sim: give access to the driver Gabriel Lucas
2018-03-15 17:27   ` Denis Kenzior
2018-03-15 12:49 ` [PATCH 6/6] gemalto: fix sim reinsertion issue Gabriel Lucas
2018-03-15 17:29   ` Denis Kenzior
2018-03-16 13:30     ` Gabriel Lucas
2018-03-19 16:01     ` Gabriel Lucas
  -- strict thread matches above, loose matches on Subject: below --
2018-03-12 12:57 [PATCH 0/6] gemalto's ALS3 and PHS8P support Gabriel Lucas
2018-03-12 12:57 ` [PATCH 2/6] gemalto: support ALS3 in gemalto's plugin Gabriel Lucas

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=dfdb1740-fa49-61ac-627b-2fe6ba0d3659@gmail.com \
    --to=denkenz@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.