From: Denis Kenzior Date: Thu, 29 Oct 2009 20:54:23 +0000 (-0500) Subject: Add utility to create a list of supported techs X-Git-Tag: 0.9~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=47fa0fb8839aad20efb5883339b42990920a7a7e;p=platform%2Fupstream%2Fofono.git Add utility to create a list of supported techs --- diff --git a/src/network.c b/src/network.c index abdcf6c..4af6d6b 100644 --- a/src/network.c +++ b/src/network.c @@ -120,6 +120,30 @@ static inline const char *network_operator_status_to_string(int status) return "unknown"; } +static char **network_operator_technologies(struct network_operator_data *opd) +{ + unsigned int ntechs = 0; + char **techs; + unsigned int i; + + for (i = 0; i < sizeof(opd->techs); i++) { + if (opd->techs & (1 << i)) + ntechs += 1; + } + + techs = g_new0(char *, ntechs + 1); + ntechs = 0; + + for (i = 0; i < sizeof(opd->techs); i++) { + if (!(opd->techs & (1 << i))) + continue; + + techs[ntechs++] = g_strdup(registration_tech_to_string(i)); + } + + return techs; +} + static void register_callback(const struct ofono_error *error, void *data) { struct ofono_netreg *netreg = data;