From 47fa0fb8839aad20efb5883339b42990920a7a7e Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 29 Oct 2009 15:54:23 -0500 Subject: Add utility to create a list of supported techs --- src/network.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/network.c') diff --git a/src/network.c b/src/network.c index abdcf6c0..4af6d6b8 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; -- cgit v1.2.3