Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH_v2 2/3] cdmamodem: Create network registration atom.
Date: Sat, 23 Jul 2011 10:11:05 -0500	[thread overview]
Message-ID: <4E2AE489.2070103@gmail.com> (raw)
In-Reply-To: <1311433175.21109.346.camel@aeonflux>

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

Hi Marcel,

<snip>

>> +#include "gatchat.h"
>> +#include "gatresult.h"
>> +
>> +#include "common.h"
> 
> I know that you are re-using the GSM network registration constants here
> and thus need common.h.
> 
> Denis, is this acceptable for you?
> 

No, not really.  Since CDMA has no defined standard API these should
probably be an enum inside cdma-netreg.h

<snip>

>> +static void sysinfo_cb(gboolean ok, GAtResult *result, gpointer user_data)
>> +{
>> +	struct ofono_cdma_netreg *netreg = user_data;
>> +	gint service_state;
>> +	gint service_domain;
>> +	gint roaming_state;
>> +	int status;
>> +	GAtResultIter iter;
>> +
>> +	if (!ok)
>> +		return;
>> +
>> +	g_at_result_iter_init(&iter, result);
>> +
>> +	if (!g_at_result_iter_next(&iter, "^SYSINFO:"))
>> +		return;
>> +
>> +	if (!g_at_result_iter_next_number(&iter, &service_state))
>> +		return;
>> +
>> +	if (!g_at_result_iter_next_number(&iter, &service_domain))
>> +		return;
>> +
>> +	if (!g_at_result_iter_next_number(&iter, &roaming_state))
>> +		return;
>> +
>> +	switch (service_state) {
>> +	case 0:
>> +	case 4:
> 
> Please put at least comments behind every case label so that we know
> what it does mean.
> 
>> +		status = NETWORK_REGISTRATION_STATUS_NOT_REGISTERED;
>> +		break;
>> +	case 2:
>> +		if (roaming_state)
>> +			status = NETWORK_REGISTRATION_STATUS_ROAMING;
>> +		else
>> +			status = NETWORK_REGISTRATION_STATUS_REGISTERED;
>> +		break;
>> +	default:
>> +		status = NETWORK_REGISTRATION_STATUS_UNKNOWN;
>> +		break;
>> +	}
>> +
>> +	ofono_cdma_netreg_register(netreg);
>> +
>> +	ofono_cdma_netreg_status_notify(netreg, status);
>> +}
> 
> How do we get unsolicited notification when the status changes?
> 

And why are we using a Huawei specific command inside the generic
cdmamodem driver without at least a vendor if/switch somewhere?

Regards,
-Denis

  reply	other threads:[~2011-07-23 15:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-23  4:09 [PATCH_v2 0/3] Create CDMA Network Registration atom Bertrand Aygon
2011-07-23  4:09 ` [PATCH_v2 1/3] cdmamodem: Create org.ofono.cdma.NetworkRegistration interface Bertrand Aygon
2011-07-23 14:52   ` Marcel Holtmann
2011-07-23  4:09 ` [PATCH_v2 2/3] cdmamodem: Create network registration atom Bertrand Aygon
2011-07-23 14:59   ` Marcel Holtmann
2011-07-23 15:11     ` Denis Kenzior [this message]
2011-07-23 15:15       ` Aygon, Bertrand
2011-07-23 15:23         ` Denis Kenzior
2011-07-23  4:09 ` [PATCH_v2 3/3] speedupcdma: register to cdma " Bertrand Aygon
2011-07-23 15:00   ` 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=4E2AE489.2070103@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