source: remove build warning about at and db files 58/51358/3
authorSooyoung Ha <yoosah.ha@samsung.com>
Mon, 9 Nov 2015 06:13:45 +0000 (15:13 +0900)
committerSooyoung Ha <yoosah.ha@samsung.com>
Mon, 9 Nov 2015 07:21:29 +0000 (16:21 +0900)
Third. I remove build warnings about at-command and db source files.

There are many problems about code convention like indentations,
whitespaces, tabs, and so on. These should be aligned later, not this
commit.

Change-Id: I803ecc29da6f34664275a77ef4db0cb18e149a46
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
13 files changed:
vmodem/at/at_recv.c
vmodem/at/at_rx_gps.c
vmodem/at/at_rx_sat.c
vmodem/at/at_rx_security.c
vmodem/at/at_rx_sms.c
vmodem/at/at_rx_snd.c
vmodem/at/at_rx_ss.c
vmodem/at/at_send.c
vmodem/at/at_tx_sms.c
vmodem/db/db_security.c
vmodem/db/db_ss.c
vmodem/sat/apdu_tool.c
vmodem/sat/sat_util.c

index 9b64097e6ce4ae54e58f1baf5ce038f274f311be..e4278f6b1c7bd251f40a3d9e8cf9640c49df58bd 100644 (file)
@@ -162,12 +162,14 @@ int at_recv_sms(char* cmd, char* atmsg)
     {
        return at_rx_sms_deliver_report_exec(atmsg);
     }
+    /* XXX: Check why comment out.
     // return at_rx_sms_param_count_get(atmsg);
     // return at_rx_sms_param_set(atmsg);
     // return at_rx_sms_param_get(atmsg);
     // return at_rx_sms_svc_option_set(atmsg);
     // return at_rx_sms_mem_status_set(atmsg);
     // return at_rx_sms_cbconfig(atmsg);
+    */
 
     NOT_SUPPORTED_AT(atmsg);
     return 1;
index a62259dea1eac99e7c43b41d2e0d63d4a2b68f78..19ecfdf07c33f20fb70825e115b52cf1803f1210 100644 (file)
 #include "at_recv.h"
 #include "at_rx_gps.h"
 
+/* XXX
 static unsigned char g_gps_use_ssl;
 static unsigned char g_gps_agps_mode;
+*/
 
 int at_gps_rx_open(char* atmsg)
 {
@@ -70,12 +72,13 @@ int at_gps_xtra_set_xtra_enable(char* atmsg)
     return 1;
 }
 
+/* XXX
 static int at_gps_agps_set_ssl_get(char* atmsg)
 {
     unsigned char data[1];
     int n = 0;
 
-    /* build the response */
+    // build the response
     data[n++] = g_gps_use_ssl;
 
     // return at_msg_send(ACK_SEQ_RESPONSE, data, n);
@@ -84,7 +87,7 @@ static int at_gps_agps_set_ssl_get(char* atmsg)
 
 static int at_gps_agps_set_ssl_set(char* atmsg)
 {
-    /* const unsigned char *p = atmsg;
+       const unsigned char *p = atmsg;
 
        if (strlen(atmsg) < 2)
        TRACE(MSGL_WARN, "doc says this message should have 2 bytes\n");
@@ -94,17 +97,15 @@ static int at_gps_agps_set_ssl_set(char* atmsg)
        TRACE(MSGL_VGSM_INFO, "use_ssl = %d\n", g_gps_use_ssl);
 
        return at_gps_agps_set_ssl_get(atmsg);
-     */        return 1;
+       return 1;
 }
 
 int at_gps_agps_set_ssl(char* atmsg)
 {
-    /*
     // set
     return at_gps_agps_set_ssl_set(atmsg);
-    // get     
+    // get
     return at_gps_agps_set_ssl_get(atmsg);
-     */
     return 0;
 }
 
@@ -113,7 +114,7 @@ static int at_gps_agps_mode_get(char* atmsg)
     unsigned char data[1];
     int n = 0;
 
-    /* build the response */
+    // build the response
     data[n++] = g_gps_agps_mode;
 
     // return at_msg_send(ACK_SEQ_RESPONSE, data, n);
@@ -132,11 +133,10 @@ static int at_gps_agps_mode_set(char* atmsg)
 
 int at_gps_agps_mode(char* atmsg)
 {
-    /*
     // set
     return at_gps_agps_mode_set(atmsg);
     // get
     return at_gps_agps_mode_get(atmsg);
-     */        
     return 0;
 }
+*/
index b2dd84461eb9b07e2a073d55fecc3f28114e0bc5..c5a59ac73c80e9759a1ec2738d080d046b08ec8f 100644 (file)
@@ -86,13 +86,8 @@ int at_RxSAT_DefaultSAT(char* atmsg)
 
 int at_RxSAT_TerminalResponse(char* atmsg)
 {
-    unsigned char *p_rcv= 0;
-    unsigned char *tmp = 0;
     LXT_MESSAGE packet;
     TAPIMessageInit(&packet);
-    char CmdId;
-    int data_size;
-    unsigned char *pdata = 0;
     TRACE(MSGL_VGSM_INFO, "unimplemented!\n");
     return 1;
 }
@@ -101,12 +96,9 @@ int at_RxSAT_TerminalResponse(char* atmsg)
 //RxSAT_TerminalResponse
 int at_RxSAT_EnvelopeResponse(char* atmsg)
 {
-    unsigned char *p_rcv_term = 0;
-    unsigned char *tmp = 0;
     LXT_MESSAGE packet;
     TAPIMessageInit(&packet);
 
-    unsigned char CmdId;
     TRACE(MSGL_VGSM_INFO, "unimplemented!\n");
     return 1;
 }
index e8055ba3726717de29b92cf5741eea516c9afbf7..09dd51b1e2bd87036d9774612a48b6858f125f98 100644 (file)
@@ -37,6 +37,7 @@
 #include "vgsm_sim.h"
 #include "at_func.h"
 #include "server_common.h"
+#include "at_rx_sms.h"
 
 int at_rx_sim_sec_imsi(char* atmsg)
 {
@@ -74,6 +75,8 @@ int at_rx_sim_sec_change_password(char* atmsg)
     return oem_rx_sim_sec_change_password_req(atmsg, strlen(atmsg));
 }
 
+/* XXX: These functions are not used, now.
+ *      But should check why.
 static int at_rx_sim_sec_set_phone_lock_req(void* ptr_data, int data_len)
 {
     unsigned char *p = ptr_data;
@@ -103,14 +106,13 @@ static int at_rx_sim_sec_set_phone_lock_req(void* ptr_data, int data_len)
 int at_rx_sim_sec_phone_lock(char* atmsg)
 {
     TRACE(MSGL_VGSM_SIM, "\n");
-    /*
     // get
     oem_rx_sim_sec_get_phone_lock_req(atmsg, strlen(atmsg));
     // set
     at_rx_sim_sec_set_phone_lock_req(atmsg, strlen(atmsg));
-     */
     return -1;
 }
+*/
 
 int at_rx_sim_sec_phone_lock_get(char* atmsg)
 {
@@ -124,7 +126,6 @@ int at_rx_sim_sec_phone_lock_get(char* atmsg)
 
     ret = strtok(data+1, TOKEN);
 
-    char token[] = "\"";
     ret = strtok(NULL, TOKEN);
     ret = strtok(NULL, TOKEN);
     TRACE(MSGL_VGSM_SIM, "input pw:%s, orig pw:%s\n", ret, origPwd);
@@ -570,7 +571,7 @@ static int at_rx_sim_sec_get_rsim_access_req(char* atmsg)
        data[n++] = 0x90;
        data[n++] = 0;
 
-       int hexaStringSize = (len * 2) + 1;     
+       int hexaStringSize = (len * 2) + 1;
        char* hexaStringP = malloc(hexaStringSize);
        if(!hexaStringP)
            return -1;
@@ -579,7 +580,7 @@ static int at_rx_sim_sec_get_rsim_access_req(char* atmsg)
 
        memset(hexaStringP, '\0', hexaStringSize);
 
-       prv_bytes_to_hexadecimal_string(ptr, len, hexaStringP, &hexaStringSize);
+       prv_bytes_to_hexadecimal_string((unsigned char*)ptr, len, hexaStringP, &hexaStringSize);
 
        strcat((char*)&data[n], hexaStringP);
 
index b49d58722f5a7461470a9a793496fdbd585c9c50..29996b50660d0d716eb25c95c08243ce3689ca11 100644 (file)
@@ -52,12 +52,15 @@ int sms_param_set_vconf();
 static unsigned char g_record_len = 0;
 static unsigned char g_record[PARAM_RECORD_LEN_MAX];
 
+/* XXX: These variables are not used, now.
+ *      But should check why.
 #define CB_MAX_SELECTED_IDS 0xff
-static unsigned char g_cb_enabled = 1;      /* enabled */
-static unsigned char g_cb_selected_id = 1;  /* all selected */
-static unsigned char g_cb_selected_count = 0;  /* number of selected ids */
+static unsigned char g_cb_enabled = 1; // enabled
+static unsigned char g_cb_selected_id = 1; // all selected
+static unsigned char g_cb_selected_count = 0; // number of selected ids
 static const unsigned char g_cb_max_selected_ids = CB_MAX_SELECTED_IDS;
-static unsigned short g_cb_selected_list[CB_MAX_SELECTED_IDS];  /* number of selected ids */
+static unsigned short g_cb_selected_list[CB_MAX_SELECTED_IDS]; // number of selected ids
+*/
 
 int at_rx_sms_SendMsg(char* atmsg)
 {
@@ -129,6 +132,8 @@ int at_rx_sms_DefaultSms(char* atmsg)
     return -1;
 }
 
+/* XXX: These functions are not used, now.
+ *      But should check why.
 static int at_rx_sms_cbconfig_get(char* atmsg)
 {
     return at_tx_sms_cbconfig_resp(g_cb_enabled, g_cb_selected_id
@@ -143,15 +148,14 @@ static int at_rx_sms_cbconfig_set(char* atmsg)
 
 int at_rx_sms_cbconfig(char* atmsg)
 {
-    /*
     // set
     at_rx_sms_cbconfig_set(atmsg);
 
     // get
     at_rx_sms_cbconfig_get(atmsg);
-     */
     return -1;
 }
+*/
 
 unsigned char at_g_sms_service_option= 0x02; // CS_ONLY
 
@@ -170,7 +174,7 @@ int at_rx_sms_mem_status_set(char* atmsg)
     return 1;
 }
 
-static void at_rx_sms_param_init()
+static void at_rx_sms_param_init(void)
 {
     int i, n = 0;
 
index 29855f5398b1736b43f516a36a3d7e5d5b0dc528..7a04015526e2d212b349ffc86035c247f09badc6 100644 (file)
 
 
 static unsigned char g_bmute;
+/* XXX
 static unsigned char g_audio_path = 1;
 static unsigned char g_clock_status; //0:Clock End, 1:Clock Start
+*/
 
 int at_rx_snd_mute_control_get(char* atmsg)
 {
index 7a4add5be23c2936aaa02ca6732d14b5b7fd071b..8f4d7de8adb94ead79d664539ac7f95f6d9f4698 100644 (file)
@@ -115,7 +115,7 @@ int at_rx_ss_cf_get(char* atmsg)
     ret = strtok(NULL, TOKEN);
     TRACE(MSGL_VGSM_INFO, "%s\n", ret);
     if(ret)
-       tel_class = atoi(ret);  
+        tel_class = atoi(ret);
 
     TRACE(MSGL_VGSM_INFO, "CCFC tel_class:%d\n", tel_class);
     oem_rx_ss_cf_get(tel_class, cf_type);
@@ -124,7 +124,7 @@ int at_rx_ss_cf_get(char* atmsg)
 
 int at_rx_ss_cf_set(char* atmsg)
 {
-    int        ss_mode, tel_class, type, replyTime, num_len, num_type, satype;
+    int        ss_mode, tel_class, type, replyTime, num_len, num_type;
     char number[MAX_GSM_DIALED_DIGITS_NUMBER], subaddr[MAX_GSM_DIALED_DIGITS_NUMBER];
     memset(subaddr, '\0', MAX_GSM_DIALED_DIGITS_NUMBER);
     char* tdata = strchr(atmsg, '=');
@@ -192,6 +192,7 @@ int at_rx_ss_cf_set(char* atmsg)
     }
 
     ret = strtok(NULL, TOKEN);
+    /* XXX: This doesn't be used now.
     if(ret)
     {
        TRACE(MSGL_VGSM_INFO, "%s\n", ret);
@@ -199,6 +200,7 @@ int at_rx_ss_cf_set(char* atmsg)
     }
     else
        satype = 128;   // default
+    */
 
     ret = strtok(NULL, TOKEN);
     if(ret)
index 72b3d4c8c8ff6a6e23b48ebc974eace665ddd761..fbb21bac9748b2ff4504fe62e89bf397671e013e 100644 (file)
@@ -55,6 +55,7 @@ static unsigned char get_control_infoid(void)
     return s_infoid;
 }
 
+/* XXX
 static unsigned char get_msg_sequence(void)
 {
     TRACE(MSGL_VGSM_INFO, "\n");
@@ -66,14 +67,15 @@ static unsigned char get_msg_sequence(void)
        s_msg_seq = 0;
     else
        s_msg_seq++;
-    /***
+    / ***
       static unsigned char s_msg_seq = 0;
       if (s_msg_seq >= 255)
       s_msg_seq = 0;
       ++s_msg_seq;
-     ***/
+     *** /
     return s_msg_seq;
 }
+*/
 
 #define HDLC_FRAME_HEADER_SIZE 3
 #define MAX_HDLC_FRAME_SIZE 2048
index fa2ca01d0eb2345620fa815d1dc5463eee51aec3..ffd9d09cabab1615dfa5a8a7ccc6e5b0bc63204d 100644 (file)
@@ -26,6 +26,7 @@
  *
  */
 
+#include <stdio.h>
 #include <assert.h>
 
 #include "at_send.h"
@@ -34,7 +35,7 @@
 #include "at_tx_sms.h"
 #include "at_func.h"
 #include "phoneserver.h"
-#include <stdio.h>
+#include "misc.h"
 
 int at_tx_sms_deviceReady(void *data, int len)
 {
@@ -145,6 +146,8 @@ int at_tx_sms_deliver_report_noti(int result_status)
     return rc;
 }
 
+/* XXX: These functions are not used, now.
+ *      But should check why.
 int at_tx_sms_param_count_resp(unsigned char mem_store, unsigned char record_count)
 {
     unsigned char data[2];
@@ -159,6 +162,7 @@ int at_tx_sms_param_count_resp(unsigned char mem_store, unsigned char record_cou
     return 0;
     // return at_msg_send(ACK_SEQ_RESPONSE, data, n);
 }
+*/
 
 int at_tx_sms_param_resp(unsigned char mem_store, unsigned char record_index, unsigned char record_len, unsigned char *record)
 {
index ace0a9f3738d84e803cf24b45a01401459b762da..e336e029769429175494b725eb0ce01c9c19d98e 100644 (file)
@@ -460,7 +460,7 @@ int db_sim_info_add(int index, _SIMD_t *simd_t)
     char * mesg;
     char str[1000];
     char str1[1000];
-    int count, i;
+    int count = 0, i;
 
     unsigned char usim_li[33]=
     {   0x90, 0x00, 0x1e, 0x62, 0x1c, 0x82, 0x02, 0x41, 0x21, 0x83,
@@ -540,7 +540,7 @@ int db_sim_info_add(int index, _SIMD_t *simd_t)
        }
     }
 
-    SIM_DEBUG("\n");
+    SIM_DEBUG("count = %d\n", count);
 
     char dbname[256];
     char *bin_path = get_bin_path();
@@ -663,6 +663,7 @@ int db_sim_info_add(int index, _SIMD_t *simd_t)
      */
 
     SIM_DEBUG("SQL statement : %s\n", str);
+    SIM_DEBUG("        count : %d\n", count);
 
     // add a row
     err = sqlite3_exec(db,str1,0,0,&mesg);
@@ -709,7 +710,7 @@ int db_sim_data_add(int index, _SIMD_t *simd_t)
     char * mesg;
     char str[1000];
     char str1[1000];
-    int count,i;
+    int count = 0,i;
 
     unsigned char iccid[13]  =
     { 0x90, 0x00, 0x0a, 0x98, 0x94, 0x22, 0x06, 0x45, 0x61, 0x53,
@@ -777,7 +778,7 @@ int db_sim_data_add(int index, _SIMD_t *simd_t)
 
     }
 
-    SIM_DEBUG("\n");
+    SIM_DEBUG("count = %d\n", count);
 
     char dbname[256];
 
index 60297e7c455634630ca89837b1d133b66f1e197c..70db55cad9244af8e7d85e3b26ec0096821327c4 100644 (file)
@@ -41,6 +41,7 @@
 #include "fileio.h"
 //#include "state.h"
 #include "at_func.h"
+#include "oem_tx_ss.h"
 
 #define ALP_NOTIFY_DATABASE_DIR  "./db"
 #define ALP_NOTIFY_DATABASE_FILE "ss.db"
@@ -1139,6 +1140,9 @@ int send_call_barring_entry(call_barring_entry_t* entry)
     log_msg(MSGL_VGSM_INFO,"data[0] : %x\ndata[1] : %x\ndata[2] : %x\ndata[3] : %x\nss_mode : %x\n", data[0], data[1], data[2], data[3], entry->ss_mode);
 
     ret = oem_tx_ss_cb_resp(data, data_len);
+    if (ret < 0) {
+        log_msg(MSGL_WARN, "oem_tx_ss_cb_resp() failed.\n");
+    }
     free(data);
 
     return 0;
index bb459dd1ce93835088d57cf5cfd72075cf29c83a..c8c370b5675a92634c0849407789fd4f22384583 100644 (file)
@@ -320,13 +320,13 @@ static void prv_gsm_encode_dcs7(unsigned char* bufferP, int* bufferSize)
 static int prv_convert_utf8_text(VGSMApduEncoder* encoderP, VGSMApduFragment* fragmentP)
 {
     char*                      dcsP = fragmentP->buffer.dataP;
-    unsigned char      destEncoding = VGSM_CHARSET_UTF8;
-    int                        packed = 1;
     // int                     bufferSize=0;
     // char*                   bufferP=0;
     int                err = 0;
 
     /*
+    int                        packed = 1;
+    unsigned char      destEncoding = VGSM_CHARSET_UTF8;
        switch(*dcsP)
        {
        case SAT_RESP_TYPE_YES_NO_OPTION:
@@ -384,12 +384,12 @@ static int prv_convert_utf8_text(VGSMApduEncoder* encoderP, VGSMApduFragment* fr
     if (packed)
     prv_gsm_encode_dcs7((unsigned char*)bufferP, &fragmentP->length);
     }
+    destEncoding = VGSM_CHARSET_UTF8;
+    packed = 0;
      */
 
     //temp..  only use UCS2BIT....
     *dcsP = VGSM_SMS_DCS_MODE_8BIT;
-    destEncoding = VGSM_CHARSET_UTF8;
-    packed = 0;
 
     //finalize:
     return err;
index 48733a4ba1f180c130e20ebeae8d1042fb74eabd..1892071edecda608aa96da282ebb3889c09e5e41 100644 (file)
@@ -827,7 +827,7 @@ static int cmd_select_item_callback(int request, char* bufferP, int* bufferSize,
            break;
 
        case SAT_ALPHA_IDENTIFIER:
-           *bufferSize = 4;
+           *bufferSize = 12; // origin code has 4
 
            dataPP = (char**) bufferP;
            dataP = *dataPP = malloc(*bufferSize);
@@ -835,7 +835,7 @@ static int cmd_select_item_callback(int request, char* bufferP, int* bufferSize,
            TRACE(MSGL_VGSM_INFO, "alpha_id is <%s>",alpha_id);
 
            if (dataP)
-               memcpy(dataP, alpha_id,strlen(alpha_id));
+               memcpy(dataP, alpha_id, strlen(alpha_id));
 
            TRACE(MSGL_VGSM_INFO, "dataP is <%s>",dataP);