Re: [RFC PATCH 0/2] gemalto: netmon driver

2021-01-11 Thread Sergey Matyukevich
Hello Denis,

> > This patch series implements netmon driver for gemalto modems that are
> > able to provide basic measurements using AT+CQS and AT^SMONI commands.
> > 
> > This patch series is intendedly marked as RFC. In addition to general
> 
> I guess you mean intentionally here...
> 
> > feedback for this v1 I would like to clarify the right way to handle
> > negative values that can be returned by modem. For instance, this
> 
> So the short answer is: You're not supposed to even have negative numbers in
> AT commands.  And since oFono follows 27.007, which is itself based on AT
> commands, negative numbers do not really exist at the API level.
> 
> Refer to ITU v.250 Section 5.4.2.1 "Numeric constants".  Strings are also
> supposed to be formatted in a certain way, which the firmware isn't doing
> properly either...  The fact that you have to resort to using
> next_unquoted_string is kind of telling.
> 
> > is the case for the values measured in dBm including EC/n0 and RSCP.
> > Currently such values are discarded by CELL_INFO_DICT_APPEND macro.
> 
> I would guess your best bet would be to re-scale from what Gemalto firmware
> reports into something that 27.007 recommends.  You may have to refer to
> 27.007, Section 8.69 to see what the scale is according to 3GPP.

Thanks a lot for pointing me in the right direction. I will get back
with v2 once I introduce the suggested changes.

Regards,
Sergey
___
ofono mailing list -- ofono@ofono.org
To unsubscribe send an email to ofono-le...@ofono.org


Re: [RFC PATCH 0/2] gemalto: netmon driver

2021-01-11 Thread Denis Kenzior

Hi Sergey,

On 1/10/21 1:44 PM, Sergey Matyukevich wrote:

Hello Denis and all,

This patch series implements netmon driver for gemalto modems that are
able to provide basic measurements using AT+CQS and AT^SMONI commands.

This patch series is intendedly marked as RFC. In addition to general


I guess you mean intentionally here...


feedback for this v1 I would like to clarify the right way to handle
negative values that can be returned by modem. For instance, this


So the short answer is: You're not supposed to even have negative numbers in AT 
commands.  And since oFono follows 27.007, which is itself based on AT commands, 
negative numbers do not really exist at the API level.


Refer to ITU v.250 Section 5.4.2.1 "Numeric constants".  Strings are also 
supposed to be formatted in a certain way, which the firmware isn't doing 
properly either...  The fact that you have to resort to using 
next_unquoted_string is kind of telling.



is the case for the values measured in dBm including EC/n0 and RSCP.
Currently such values are discarded by CELL_INFO_DICT_APPEND macro.


I would guess your best bet would be to re-scale from what Gemalto firmware 
reports into something that 27.007 recommends.  You may have to refer to 27.007, 
Section 8.69 to see what the scale is according to 3GPP.


Regards,
-Denis
___
ofono mailing list -- ofono@ofono.org
To unsubscribe send an email to ofono-le...@ofono.org


Re: [RFC PATCH 1/2] gemalto: add netmon driver

2021-01-11 Thread Denis Kenzior

Hi Sergey,

On 1/10/21 1:44 PM, Sergey Matyukevich wrote:

Implement network monitoring driver for gemalto modems that
are able to provide serving cell information and basic
measurements using AT+CQS and AT^SMONI commands.
---
  Makefile.am |   3 +-
  drivers/gemaltomodem/gemaltomodem.c |   2 +
  drivers/gemaltomodem/gemaltomodem.h |   3 +
  drivers/gemaltomodem/netmon.c   | 609 
  4 files changed, 616 insertions(+), 1 deletion(-)
  create mode 100644 drivers/gemaltomodem/netmon.c






+static int gemalto_netmon_probe(struct ofono_netmon *netmon,
+   unsigned int vendor, void *user)
+{
+   GAtChat *chat = user;
+   struct netmon_driver_data *nmd;
+
+   DBG("gemalto netmon probe");
+
+   nmd = g_try_new0(struct netmon_driver_data, 1);
+   if (nmd == NULL)
+   return -ENOMEM;


Feel free to use g_new0.  We have given up using g_try_new0 since these errors 
don't really occur on Linux.



+
+   nmd->chat = g_at_chat_clone(chat);
+
+   ofono_netmon_set_data(netmon, nmd);
+
+   g_idle_add(gemalto_delayed_register, netmon);
+
+   return 0;
+}


Other than this, LGTM.

Regards,
-Denis
___
ofono mailing list -- ofono@ofono.org
To unsubscribe send an email to ofono-le...@ofono.org