From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 2/5] netmon: handle OFONO_NETMON_INFO_{RSCP|ECN0|RSRQ|RSRP|OPERATOR} in D-Bus
Date: Tue, 29 Nov 2016 10:49:12 -0600 [thread overview]
Message-ID: <583DB188.1020402@gmail.com> (raw)
In-Reply-To: <1480082415-30822-3-git-send-email-djalal@endocode.com>
[-- Attachment #1: Type: text/plain, Size: 2371 bytes --]
Hi Djalal,
On 11/25/2016 08:00 AM, djalal(a)endocode.com wrote:
> From: Djalal Harouni <djalal@endocode.com>
>
> Handle the previously added types in D-Bus.
> ---
> src/netmon.c | 40 +++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 39 insertions(+), 1 deletion(-)
>
> diff --git a/src/netmon.c b/src/netmon.c
> index eb18b9c..c87980a 100644
> --- a/src/netmon.c
> +++ b/src/netmon.c
> @@ -78,7 +78,8 @@ void ofono_netmon_serving_cell_notify(struct ofono_netmon *netmon,
> const char *technology = cell_type_to_tech_name(type);
> char *mcc = NULL;
> char *mnc = NULL;
> - int intval;
> + char *op = NULL;
> + int intval = -1;
Why the initializer? Our rule of thumb is not to initialize in order to
let the compiler (hopefully) or valgrind catch instances of
uninitialized variable use (e.g. bugs).
> netmon->reply = dbus_message_new_method_return(netmon->pending);
>
> if (netmon->reply == NULL)
> @@ -180,6 +181,43 @@ void ofono_netmon_serving_cell_notify(struct ofono_netmon *netmon,
> intval, uint8_t, DBUS_TYPE_BYTE);
> break;
>
> + case OFONO_NETMON_INFO_RSCP:
> + intval = va_arg(arglist, int);
> +
> + CELL_INFO_DICT_APPEND(&dict, "ReceivedSignalCodePower",
> + intval, uint8_t, DBUS_TYPE_BYTE);
> + break;
> +
> + case OFONO_NETMON_INFO_ECN0:
> + intval = va_arg(arglist, int);
> +
> + CELL_INFO_DICT_APPEND(&dict, "ReceivedEnergyRatio",
> + intval, uint8_t, DBUS_TYPE_BYTE);
> + break;
> +
> + case OFONO_NETMON_INFO_RSRQ:
> + intval = va_arg(arglist, int);
> +
> + CELL_INFO_DICT_APPEND(&dict, "ReferenceSignalReceivedQuality",
> + intval, uint8_t, DBUS_TYPE_BYTE);
> + break;
> +
> + case OFONO_NETMON_INFO_RSRP:
> + intval = va_arg(arglist, int);
> +
> + CELL_INFO_DICT_APPEND(&dict, "ReferenceSignalReceivedPower",
> + intval, uint8_t, DBUS_TYPE_BYTE);
> + break;
> +
This looks fine, however there should be a patch documenting these and
their respective value ranges inside doc/netmon-api.txt.
> + case OFONO_NETMON_INFO_OPERATOR:
> + op = va_arg(arglist, char *);
> +
> + if (op && strlen(op))
> + ofono_dbus_dict_append(&dict, "Operator",
> + DBUS_TYPE_STRING, &op);
> +
> + break;
> +
> case OFONO_NETMON_INFO_INVALID:
> break;
> }
>
Regards,
-Denis
next prev parent reply other threads:[~2016-11-29 16:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-25 14:00 [PATCH 0/5] RFC: ubloxmodem add netmon interface djalal
2016-11-25 14:00 ` [PATCH 1/5] netmon: add OFONO_NETMON_INFO_{RSCP|ECN0|RSRQ|RSRP|OPERATOR} djalal
2016-11-29 16:43 ` Denis Kenzior
2016-11-30 11:45 ` Djalal Harouni
2016-11-25 14:00 ` [PATCH 2/5] netmon: handle OFONO_NETMON_INFO_{RSCP|ECN0|RSRQ|RSRP|OPERATOR} in D-Bus djalal
2016-11-29 16:49 ` Denis Kenzior [this message]
2016-11-30 11:48 ` Djalal Harouni
2016-11-25 14:00 ` [PATCH 3/5] ubloxmodem: add the netmon driver djalal
2016-11-29 17:32 ` Denis Kenzior
2016-11-30 12:05 ` Djalal Harouni
2016-11-25 14:00 ` [PATCH 4/5] ubloxmodem: intialize and register " djalal
2016-11-29 16:53 ` Denis Kenzior
2016-11-30 11:49 ` Djalal Harouni
2016-11-25 14:00 ` [PATCH 5/5] test: support OFONO_NETMON_INFO_{RSCP|ECN0|RSRQ|RSRP|OPERATOR} djalal
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=583DB188.1020402@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox