diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2012-11-18 14:57:21 +0100 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2012-11-18 14:57:21 +0100 |
commit | 12fdf180e5653fe242b512ff08448e47eb43b9af (patch) | |
tree | bb331ec1a809ceb2e72da2ecd08bad1f82922150 | |
parent | 7525de225943f65ba2ebb10143c769a52d0d8df6 (diff) | |
download | hardware_ril_samsung-ril-12fdf180e5653fe242b512ff08448e47eb43b9af.zip hardware_ril_samsung-ril-12fdf180e5653fe242b512ff08448e47eb43b9af.tar.gz hardware_ril_samsung-ril-12fdf180e5653fe242b512ff08448e47eb43b9af.tar.bz2 |
Disp: Report RSSI properly with newer version
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r-- | compat.h | 1 | ||||
-rw-r--r-- | disp.c | 30 |
2 files changed, 20 insertions, 11 deletions
@@ -41,7 +41,6 @@ #if RIL_VERSION >= 6 #define RIL_REQUEST_REGISTRATION_STATE RIL_REQUEST_VOICE_REGISTRATION_STATE #define RIL_REQUEST_GPRS_REGISTRATION_STATE RIL_REQUEST_DATA_REGISTRATION_STATE - #define RIL_SignalStrength RIL_SignalStrength_v6 #define RIL_CardStatus RIL_CardStatus_v6 #define RIL_SIM_IO RIL_SIM_IO_v6 #define RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED @@ -28,11 +28,13 @@ /** * Converts IPC RSSI to Android RIL format */ +#if RIL_VERSION >= 6 +void ipc2ril_rssi(unsigned char rssi, RIL_SignalStrength_v6 *ss) +#else void ipc2ril_rssi(unsigned char rssi, RIL_SignalStrength *ss) +#endif { - int ril_rssi; - - memset(ss, 0, sizeof(ss)); + int ril_rssi = 0; if(rssi > 0x6f) { ril_rssi = 0; @@ -44,15 +46,15 @@ void ipc2ril_rssi(unsigned char rssi, RIL_SignalStrength *ss) LOGD("Signal Strength is %d\n", ril_rssi); +#if RIL_VERSION >= 6 + memset(ss, 0, sizeof(RIL_SignalStrength_v6)); + memset(&ss->LTE_SignalStrength, -1, sizeof(ss->LTE_SignalStrength)); +#else + memset(ss, 0, sizeof(RIL_SignalStrength)); +#endif + ss->GW_SignalStrength.signalStrength = ril_rssi; ss->GW_SignalStrength.bitErrorRate = 99; - - /* Send CDMA and EVDO levels even in GSM mode */ - ss->CDMA_SignalStrength.dbm = ril_rssi; - ss->CDMA_SignalStrength.ecio = 200; - - ss->EVDO_SignalStrength.dbm = ril_rssi; - ss->EVDO_SignalStrength.ecio = 200; } void ril_request_signal_strength(RIL_Token t) @@ -65,7 +67,11 @@ void ril_request_signal_strength(RIL_Token t) void ipc_disp_icon_info(struct ipc_message_info *info) { struct ipc_disp_icon_info *icon_info = (struct ipc_disp_icon_info *) info->data; +#if RIL_VERSION >= 6 + RIL_SignalStrength_v6 ss; +#else RIL_SignalStrength ss; +#endif /* Don't consider this if modem isn't in normal power mode. */ if(ril_data.state.power_state != IPC_PWR_PHONE_STATE_NORMAL) @@ -88,7 +94,11 @@ void ipc_disp_icon_info(struct ipc_message_info *info) void ipc_disp_rssi_info(struct ipc_message_info *info) { struct ipc_disp_rssi_info *rssi_info = (struct ipc_disp_rssi_info *) info->data; +#if RIL_VERSION >= 6 + RIL_SignalStrength_v6 ss; +#else RIL_SignalStrength ss; +#endif int rssi; /* Don't consider this if modem isn't in normal power mode. */ |