From bf5b31e8a847697d84d556146e47502c658a7baf Mon Sep 17 00:00:00 2001 From: Kalle Valo Date: Thu, 20 May 2010 13:53:21 +0300 Subject: Move report_signal_strength to atutil The function is needed in two different places, better to move it to atutil.h. --- drivers/atmodem/atutil.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/atmodem/atutil.h') 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; \ -- cgit v1.2.3