From 2d82e25a55e3c80081c603ef0cc36569a3157570 Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Tue, 26 Mar 2013 16:57:58 +0900 Subject: [PATCH] block the incoming calls when the RSSI is zero. --- packaging/vmodemd-emul.spec | 2 +- vmodem/server/client.c | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/packaging/vmodemd-emul.spec b/packaging/vmodemd-emul.spec index b69b4d8..973dd36 100644 --- a/packaging/vmodemd-emul.spec +++ b/packaging/vmodemd-emul.spec @@ -1,6 +1,6 @@ #git:slp/pkgs/v/vmodem-daemon-emulator Name: vmodemd-emul -Version: 0.2.41 +Version: 0.2.42 Release: 1 Summary: Modem Emulator Group: System/ModemEmulator diff --git a/vmodem/server/client.c b/vmodem/server/client.c index ea2c73d..bb24987 100644 --- a/vmodem/server/client.c +++ b/vmodem/server/client.c @@ -79,6 +79,8 @@ #include "at_msg.h" #include "vgsm_phone.h" /* end */ +#include +#include #define MAX_RESULT_LENGTH 1024 @@ -1457,6 +1459,7 @@ static int client_callback(PhoneServer * ps, int fd, EloopCondition cond, void * int length; //int klass = ci->klass; int clientfd = ci->fd; + int rssi = 5; //unsigned char * p = 0; @@ -1487,6 +1490,11 @@ static int client_callback(PhoneServer * ps, int fd, EloopCondition cond, void * length = packet.length; TRACE(MSGL_VGSM_INFO, "in client_callback, group : %x\n", group); + + if(vconf_get_int(VCONFKEY_TELEPHONY_RSSI, &rssi)) { + TRACE(MSGL_WARN, "vconf_get_int(%s) fail\n", VCONFKEY_TELEPHONY_RSSI); + } + switch (group) { case GSM_CALL: @@ -1494,9 +1502,11 @@ static int client_callback(PhoneServer * ps, int fd, EloopCondition cond, void * if( is_flight_mode() ){ TRACE(MSGL_VGSM_INFO, "Flight mode on \n"); callback_callist(); - /* not call */ - }else{ - TRACE(MSGL_VGSM_INFO, "Flight mode off \n"); + } else if(rssi == 0) { + TRACE(MSGL_VGSM_INFO, "RSSI is zero \n"); + callback_callist(); + } else { + TRACE(MSGL_VGSM_INFO, "Call ok \n"); do_call(ps, ci, &packet); } break; @@ -1510,9 +1520,11 @@ static int client_callback(PhoneServer * ps, int fd, EloopCondition cond, void * if( is_flight_mode() ){ TRACE(MSGL_VGSM_INFO, "Flight mode on \n"); sms_response_for_eventinjector(); - /* not sms */ - }else{ - TRACE(MSGL_VGSM_INFO, "Flight mode off \n"); + } else if(rssi == 0) { + TRACE(MSGL_VGSM_INFO, "RSSI is zero \n"); + sms_response_for_eventinjector(); + } else { + TRACE(MSGL_VGSM_INFO, "SMS ok \n"); do_sms(ps, ci, &packet); } break; -- 2.7.4