---
 drivers/atmodem/atutil.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/atmodem/atutil.h b/drivers/atmodem/atutil.h
index 7113a4c..57573cb 100644
--- a/drivers/atmodem/atutil.h
+++ b/drivers/atmodem/atutil.h
@@ -115,6 +115,20 @@ static inline int at_util_convert_signal_strength(int 
strength)
        return result;
 }
 
+static inline int at_util_convert_signal_strength_cesq(int strength_GSM, int 
strength_UTRAN, int strength_EUTRAN)
+{
+       int result = -1;
+
+       if (strength_GSM != 99)
+               result = (strength_GSM * 100) / 63;
+       else if (strength_UTRAN != 255)
+               result = (strength_UTRAN * 100) / 96;
+       else if (strength_EUTRAN != 255)
+               result = (strength_EUTRAN * 100) / 97;
+
+       return result;
+}
+
 #define CALLBACK_WITH_FAILURE(cb, args...)             \
        do {                                            \
                struct ofono_error cb_e;                \
-- 
1.9.1

_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to