<div dir="ltr">The Telit modem supports <span style="font-size:12.8000001907349px">AT+CTZU=1 but doesn't seem to require it. When I start up the system, the modem has CTZU=0 by default, but queries to AT+CCLK? yield the correct time and time zone.</span><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">I'll try moving the </span><span style="font-size:12.8000001907349px">MMIfaceModemTime implementation from this patch up to src/mm-broadband-modem.c</span></div><div><br></div><div><span style="font-size:12.8000001907349px">Also, I don't have an environment for testing with anything besides the Telit modem, so I might need some help verifying that a generic implementation does not cause problems for other modems.</span></div><div><br></div><div><div><span style="font-size:12.8000001907349px"><br></span><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 12, 2015 at 12:44 AM, Aleksander Morgado <span dir="ltr"><<a href="mailto:aleksander@aleksander.es" target="_blank">aleksander@aleksander.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>On Wed, Mar 11, 2015 at 9:17 PM, Bjørn Mork <<a href="mailto:bjorn@mork.no" target="_blank">bjorn@mork.no</a>> wrote:<br>
> Aleksander Morgado <<a href="mailto:aleksander@aleksander.es" target="_blank">aleksander@aleksander.es</a>> writes:<br>
><br>
>> Hey,<br>
>><br>
>> On Wed, Mar 11, 2015 at 6:49 PM, Jason Simmons <<a href="mailto:jsimmons@chromium.org" target="_blank">jsimmons@chromium.org</a>> wrote:<br>
>>> Add support for querying the real-time clock to the Telit plugin.<br>
>>> Tested with a Telit HE910 modem.<br>
>>> ---<br>
>>> plugins/telit/mm-broadband-modem-telit.c | 174<br>
>>> ++++++++++++++++++++++++++++++-<br>
>>> 1 file changed, 173 insertions(+), 1 deletion(-)<br>
>>><br>
>>> diff --git a/plugins/telit/mm-broadband-modem-telit.c<br>
>>> b/plugins/telit/mm-broadband-modem-telit.c<br>
>>> index 5e1dbff..429a735 100644<br>
>>> --- a/plugins/telit/mm-broadband-modem-telit.c<br>
>>> +++ b/plugins/telit/mm-broadband-modem-telit.c<br>
>>> @@ -29,12 +29,15 @@<br>
>>> #include "mm-modem-helpers.h"<br>
>>> #include "mm-base-modem-at.h"<br>
>>> #include "mm-iface-modem.h"<br>
>>> +#include "mm-iface-modem-time.h"<br>
>>> #include "mm-broadband-modem-telit.h"<br>
>>><br>
>>> static void iface_modem_init (MMIfaceModem *iface);<br>
>>> +static void iface_modem_time_init (MMIfaceModemTime *iface);<br>
>>><br>
>>> G_DEFINE_TYPE_EXTENDED (MMBroadbandModemTelit, mm_broadband_modem_telit,<br>
>>> MM_TYPE_BROADBAND_MODEM, 0,<br>
>>> - G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM,<br>
>>> iface_modem_init));<br>
>>> + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM,<br>
>>> iface_modem_init)<br>
>>> + G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_TIME,<br>
>>> iface_modem_time_init));<br>
>>><br>
>>><br>
>>> /*****************************************************************************/<br>
>>> /* Load access technologies (Modem interface) */<br>
>>> @@ -175,6 +178,164 @@ load_access_technologies (MMIfaceModem *self,<br>
>>> }<br>
>>><br>
>>><br>
>>> /*****************************************************************************/<br>
>>> +/* Load network time (Time interface) */<br>
>>> +<br>
>>> +static gboolean<br>
>>> +parse_cclk_reply (const char *response,<br>
>>> + gchar **iso8601p,<br>
>>> + MMNetworkTimezone **tzp,<br>
>>> + GError **error)<br>
>><br>
>> Could you put this in a mm-modem-helpers-telit.c|h set of files in the<br>
>> telit plugin, and add unit tests? You can check e.g. how that is done<br>
>> in the Huawei plugin for the ^TIME response parsers.<br>
><br>
> Why make this telit-specific? It will likely work with other modules<br>
> supporting AT+CCLK. Just tested on my Sierra Wireless EM7345 and it<br>
> works fine after first setting AT+CTZU=1 :<br>
><br>
> bjorn@nemi:~$ mmcli -m 5 --command="AT+CTZU?"<br>
> response: '+CTZU: 1'<br>
> bjorn@nemi:~$ mmcli -m 5 --command="AT+CCLK?"<br>
> response: '+CCLK: "15/03/11,21:15:18+4"'<br>
><br>
<br>
</div></div>That is actually a good idea...<br>
<br>
Jason, does the Telit modem require AT+CTZU=1? If it doesn't, does it<br>
anyway support it?<br>
<br>
I'm thinking that a generic check_support() method in the<br>
MMBroadbandModem object could do AT+CTZU=1 and then AT+CCLK? (i.e.<br>
moving all this to the generic modem as Bjørn suggested).<br>
<div><div><br>
><br>
> bjorn@nemi:~$ mmcli -m 5<br>
><br>
> /org/freedesktop/ModemManager1/Modem/5 (device id '387cb41c2728a4dae8488ffd480c36ad8081139b')<br>
> -------------------------<br>
> Hardware | manufacturer: 'Generic'<br>
> | model: 'MBIM [1199:A001]'<br>
> | revision: 'FIH7160_V1.2_WW_01.1415.07'<br>
> | supported: 'gsm-umts, lte'<br>
> | current: 'gsm-umts, lte'<br>
> | equipment id: '013937000536191'<br>
> -------------------------<br>
> System | device: '/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-4'<br>
> | drivers: 'cdc_mbim, cdc_acm'<br>
> | plugin: 'Generic'<br>
> | primary port: 'cdc-wdm0'<br>
> | ports: 'ttyACM3 (at), cdc-wdm0 (mbim), wwan0 (net)'<br>
> -------------------------<br>
> Numbers | own : 'unknown'<br>
> -------------------------<br>
> Status | lock: 'none'<br>
> | unlock retries: 'sim-pin2 (3)'<br>
> | state: 'registered'<br>
> | power state: 'on'<br>
> | access tech: 'lte'<br>
> | signal quality: '16' (cached)<br>
> -------------------------<br>
> Modes | supported: 'allowed: 2g, 3g, 4g; preferred: none'<br>
> | current: 'allowed: 2g, 3g, 4g; preferred: none'<br>
> -------------------------<br>
> Bands | supported: 'unknown'<br>
> | current: 'unknown'<br>
> -------------------------<br>
> IP | supported: 'ipv4, ipv6, ipv4v6'<br>
> -------------------------<br>
> 3GPP | imei: '013937000536191'<br>
> | enabled locks: 'sim, fixed-dialing'<br>
> | operator id: '24201'<br>
> | operator name: 'N Telenor'<br>
> | subscription: 'unknown'<br>
> | registration: 'home'<br>
> -------------------------<br>
> SIM | path: '/org/freedesktop/ModemManager1/SIM/5'<br>
><br>
> -------------------------<br>
> Bearers | paths: 'none'<br>
><br>
><br>
><br>
> Bjørn<br>
<br>
<br>
<br>
</div></div><span><font color="#888888">--<br>
Aleksander<br>
<a href="https://aleksander.es" target="_blank">https://aleksander.es</a><br>
</font></span></blockquote></div><br></div></div></div></div>