Skip to contentSkip to conversation

Provide Local Information

PATCH In review Yang Gu 4 participants 7 messages Nov 18, 2010 – Nov 19, 2010

lore
Share & tools
lore

Yang Gu

author
#0 lore raw

cover Provide Local Information

Currently only the access technology in proactive command "Provide Local Information" is handled. In order not to bloat the patch, I plan to send the left parts in separate patches. Would you please review this part first? I have some concerns/questions on this command:
1. The definition of access technology got from network is different from the definition in stk, so I did some map here. Please comment if I made something wrong.
2. How about if oFono couldn't provide some information. For example, if oFono couldn't provide the time info, need we ask the application to provide one? Thus we'd need to introduce an agent.

Yang Gu (2):
stk: provide access technology info
network: Use bit as size instead of byte

 src/network.c |   18 +++++-
 src/ofono.h   |    1 +
 src/stk.c     |  179 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 196 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.2.3
author
#1 lore raw

PATCH 1/2 stk: provide access technology info

---
 src/network.c |   14 +++++
 src/ofono.h   |    1 +
 src/stk.c     |  179 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 194 insertions(+), 0 deletions(-)
src/network.c +14 -0
index f1d7724..481ece8 100644
@@ -1852,3 +1852,17 @@ void *ofono_netreg_get_data(struct ofono_netreg *netreg)
 {
 	return netreg->driver_data;
 }
+
+unsigned int __ofono_netreg_get_tech(struct ofono_netreg *netreg)
+{
+	GSList *o;
+	unsigned int techs = 0;
+	struct network_operator_data *opd;
+
+	for (o = netreg->operator_list; o; o = o->next) {
+		opd = o->data;
+		techs |= opd->techs;
+	}
+
+	return techs;
+}
src/ofono.h +1 -0
index 4d76d20..c9d25ab 100644
@@ -363,6 +363,7 @@ gboolean __ofono_netreg_remove_status_watch(struct ofono_netreg *netreg,
 
 void __ofono_netreg_set_base_station_name(struct ofono_netreg *netreg,
 						const char *name);
+unsigned int __ofono_netreg_get_tech(struct ofono_netreg *netreg);
 
 #include <ofono/history.h>
 
src/stk.c +179 -0

191 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#2 lore raw

RE: [PATCH 1/2] stk: provide access technology info

Hi Yang,

src/network.c void *ofono_netreg_get_data(struct ofono_netreg *netreg) · line 1868

Quoted 13 lines
src/network.c +13 -0
+
+unsigned int __ofono_netreg_get_tech(struct ofono_netreg *netreg) {
+	GSList *o;
+	unsigned int techs = 0;
+	struct network_operator_data *opd;
+
+	for (o = netreg->operator_list; o; o = o->next) {
+		opd = o->data;
+		techs |= opd->techs;
+	}
+
+	return techs;
+}

Is this function intended to get the current access technology?

As per the ETSI TS 102 223 specification 4.12 section, when the SAT issues Provide Local Information proactive command with Access Technology(0x06) as the command qualifier, we should provide the current access technology . So, as per my understanding we need to use netreg->technology.

Quoted 3 lines

void __ofono_netreg_set_base_station_name(struct ofono_netreg *netreg,

						const char *name);

+unsigned int __ofono_netreg_get_tech(struct ofono_netreg *netreg);

Empty line needed between __ofono_netreg_set_base_station_name and __ofono_netreg_get_tech

Regards,
Jeevaka

#3 lore raw

RE: [PATCH 1/2] stk: provide access technology info

Hi Jeevaka,

Quoted 7 lines

As per the ETSI TS 102 223 specification 4.12 section, when the SAT issues Provide Local Information proactive command with Access Technology(0x06) as the command qualifier, we should provide the current access technology . So, as per my understanding we need to use netreg->technology.

Quoted 6 lines
Quoted 3 lines

void __ofono_netreg_set_base_station_name(struct ofono_netreg *netreg,

						const char *name);

+unsigned int __ofono_netreg_get_tech(struct ofono_netreg *netreg);

Empty line needed between __ofono_netreg_set_base_station_name and __ofono_netreg_get_tech

I think you're right. I'm not quite clear about the difference. Could you help me clarify several questions?
Does it mean COPS only returns current available access technology, while CREG returns current connected access technology?
And if netreg->technology is used, what should be returned once the multiple access technologies are requested? It seems oFono only supports one connected technology. In which situation we can connect to multiple access technologies simultaneously?

Regards,
-Yang

#4 lore raw

RE: [PATCH 1/2] stk: provide access technology info

Hi Yang,

Quoted 4 lines

I think you're right. I'm not quite clear about the difference. Could you help me clarify several questions? Does it mean COPS only returns current available access technology, while CREG returns current connected access technology?

COPS returns the currently available operators and its corresponding access technologies. CREG returns the currently registered operator's access techonology. In provide local information as Jeeva mentioned we have to include only the current registered access technology.

So the logic used in
+static gboolean get_tech(struct ofono_stk *stk, struct stk_response *rsp,
+ gboolean
singleton)
should also be changed apart from the
+unsigned int __ofono_netreg_get_tech(struct ofono_netreg *netreg) change.

Quoted 2 lines

And if netreg->technology is used, what should be returned once the multiple access technologies are requested?

As said above, in this case only the current registered access technology should be returned and so irrespective of a platform supporting multiple technologies, the currently registered access technology will be only one type in a Single mode active case.

Quoted 1 line

It seems oFono only supports one connected technology.

Yes, currently only Single mode active case is supported.

Quoted 2 lines

In which situation we can connect to multiple access technologies simultaneously?

In Dual Mode Dual standby case.

BR,
Rajesh

#5 lore raw

RE: [PATCH 1/2] stk: provide access technology info

Hi Rajesh & Jeevaka

Quoted 28 lines
Quoted 4 lines

I think you're right. I'm not quite clear about the difference. Could you help me clarify several questions? Does it mean COPS only returns current available access technology, while CREG returns current connected access technology?

COPS returns the currently available operators and its corresponding access technologies. CREG returns the currently registered operator's access techonology. In provide local information as Jeeva mentioned we have to include only the current registered access technology.

So the logic used in
+static gboolean get_tech(struct ofono_stk *stk, struct stk_response *rsp,

(quoted diff) +1 -0
+							gboolean

singleton)
should also be changed apart from the
+unsigned int __ofono_netreg_get_tech(struct ofono_netreg *netreg) change.

Quoted 2 lines

And if netreg->technology is used, what should be returned once the multiple access technologies are requested?

As said above, in this case only the current registered access technology should be returned and so irrespective of a platform supporting multiple technologies, the currently registered access technology will be only one type in a Single mode active case.

Quoted 8 lines
Quoted 1 line

It seems oFono only supports one connected technology.

Yes, currently only Single mode active case is supported.

Quoted 2 lines

In which situation we can connect to multiple access technologies simultaneously?

In Dual Mode Dual standby case.

Thank you both for the comments and answers to help me clarify the problems, also make the code simpler than what I thought ;)

Regards,
-Yang

author
#6 lore raw

PATCH 2/2 network: Use bit as size instead of byte

In reply to Yang Gu
---
 src/network.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
src/network.c +2 -2
index 481ece8..5320f8d 100644
@@ -129,7 +129,7 @@ static char **network_operator_technologies(struct network_operator_data *opd)
 	char **techs;
 	unsigned int i;
 
-	for (i = 0; i < sizeof(opd->techs); i++) {
+	for (i = 0; i < sizeof(opd->techs) * 8; i++) {
 		if (opd->techs & (1 << i))
 			ntechs += 1;
 	}
@@ -137,7 +137,7 @@ static char **network_operator_technologies(struct network_operator_data *opd)
 	techs = g_new0(char *, ntechs + 1);
 	ntechs = 0;
 
-	for (i = 0; i < sizeof(opd->techs); i++) {
+	for (i = 0; i < sizeof(opd->techs) * 8; i++) {
 		if (!(opd->techs & (1 << i)))
 			continue;
 
Signature · 1 line
1.7.2.3