summaryrefslogtreecommitdiffstats
path: root/drivers/atmodem/atutil.h
diff options
context:
space:
mode:
authorKalle Valo <kalle.valo@canonical.com>2010-05-20 13:53:21 +0300
committerDenis Kenzior <denkenz@gmail.com>2010-05-19 23:08:36 -0500
commitbf5b31e8a847697d84d556146e47502c658a7baf (patch)
treea61ae528cc55a16828f7822f453107d09dffb60a /drivers/atmodem/atutil.h
parent6f4b3c31fdcf6a9991062d232f435310e5f3155e (diff)
downloadofono-bf5b31e8a847697d84d556146e47502c658a7baf.tar.bz2
Move report_signal_strength to atutil
The function is needed in two different places, better to move it to atutil.h.
Diffstat (limited to 'drivers/atmodem/atutil.h')
-rw-r--r--drivers/atmodem/atutil.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/atmodem/atutil.h b/drivers/atmodem/atutil.h
index 9303ed4a..265a5ad4 100644
--- a/drivers/atmodem/atutil.h
+++ b/drivers/atmodem/atutil.h
@@ -55,6 +55,18 @@ static inline struct cb_data *cb_data_new(void *cb, void *data)
return ret;
}
+static inline int at_util_convert_signal_strength(int strength)
+{
+ int result;
+
+ if (strength == 99)
+ result = -1;
+ else
+ result = (strength * 100) / 31;
+
+ return result;
+}
+
#define DECLARE_FAILURE(e) \
struct ofono_error e; \
e.type = OFONO_ERROR_TYPE_FAILURE; \