Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 1/6] radio settings: add FastDormancy property
Date: Mon, 25 Oct 2010 10:19:56 -0500	[thread overview]
Message-ID: <4CC5A01C.9020104@gmail.com> (raw)
In-Reply-To: <C358A26273CF2948B8BCDBA661A581782A7D885430@NOK-EUMSG-03.mgdnok.nokia.com>

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

Hi Mika,

On 10/25/2010 10:05 AM, Mika.Liljeberg(a)nokia.com wrote:
> Hi Marcel,
> 
>>> @@ -103,14 +103,60 @@ static DBusMessage 
>> *radio_get_properties_reply(DBusMessage *msg,
>>>  					
>> OFONO_PROPERTIES_ARRAY_SIGNATURE,
>>>  					&dict);
>>>  
>>> -	ofono_dbus_dict_append(&dict, "TechnologyPreference",
>>> +	if ((int)rs->mode != -1) {
>>> +		const char *mode = 
>> radio_access_mode_to_string(rs->mode);
>>> +		ofono_dbus_dict_append(&dict, "TechnologyPreference",
>>>  					DBUS_TYPE_STRING, &mode);
>>
>> what is up with this (int) rs->mode cast here. That looks highly wrong
>> to me. The mode is an enum so please don't hack around it like this.
>>
>> If mode can be invalid or not present then we need to extend this enum
>> with an initial value of OFONO_RADIO_ACCESS_MODE_UNKNOWN, but not hack
>> some cast magic into it.
> 
> Yes, it's fishy. Denis introduced the enum in commit 81bc8884b414e6c2d511789d2e183cdad55182f0 but left mode initialized as -1. I'm not sure what's up with that but I did not want to start fixing it. I suppose the initializer could be added to the enum, as you say, or the whole patch could be reverted. Not my call, though.

I must have missed the -1 initialization.  In general the preference is
as follows:

- If the property is queried at the network, then set to a value that
means "unknown".  Otherwise set to a default sane value.
- Only set to the new value if the query succeeds
- If the query fails (a bizarre case if querying the modem), don't reset
the sane value and don't set cached.  The next GetProperties will try to
re-query the setting.
- Don't show the attribute if the query_ method is not provided by the
driver.

Regards,
-Denis

  reply	other threads:[~2010-10-25 15:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-25 13:28 [PATCH 0/6] radio settings: fast dormancy support Mika Liljeberg
2010-10-25 13:28 ` [PATCH 1/6] radio settings: add FastDormancy property Mika Liljeberg
2010-10-25 14:30   ` Marcel Holtmann
2010-10-25 15:05     ` Mika.Liljeberg
2010-10-25 15:19       ` Denis Kenzior [this message]
2010-10-25 15:57   ` Denis Kenzior
2010-10-25 13:28 ` [PATCH 2/6] radio settings: document " Mika Liljeberg
2010-10-25 14:32   ` Marcel Holtmann
2010-10-25 13:28 ` [PATCH 3/6] test: add scripts to enable and disable fast dormancy Mika Liljeberg
2010-10-25 14:34   ` Marcel Holtmann
2010-10-25 13:28 ` [PATCH 4/6] isimodem: add support for FastDormancy property Mika Liljeberg
2010-10-25 13:28 ` [PATCH 5/6] TODO: mark fast dormancy as done Mika Liljeberg
2010-10-25 13:28 ` [PATCH 6/6] AUTHORS: add myself Mika Liljeberg
2010-10-25 14:37   ` Marcel Holtmann

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=4CC5A01C.9020104@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