[pisa-src] r1139 - trunk/tools/iwlist_parser.c

  • From: Tobias Heer <tobias.heer@xxxxxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Wed, 14 Oct 2009 14:40:26 +0200

Author: heer
Date: Wed Oct 14 14:40:25 2009
New Revision: 1139

Log:
Removed step tracking because the order is different for the tablet

Modified:
   trunk/tools/iwlist_parser.c

Modified: trunk/tools/iwlist_parser.c
==============================================================================
--- trunk/tools/iwlist_parser.c Wed Oct 14 14:11:35 2009        (r1138)
+++ trunk/tools/iwlist_parser.c Wed Oct 14 14:40:25 2009        (r1139)
@@ -24,6 +24,9 @@
 #define FILENAME_LENGTH                64
 #define LINE_BUFFER_LENGTH     999
 
+#define DEBUG 1
+//#define USESTEP 0
+
 bool essidflag;                                //Look for one SSID only
 bool fileflag;                         //Use a file rather than stdin?
 
@@ -134,13 +137,17 @@
 {
        char * pTokens = strtok(strBuffer, " ");
        while (pTokens != 0) {
-
+#ifdef DEBUG
+               printf("Token is: %s\n", pTokens);
+#endif
                //Parse Cell ID
                if (strcmp(pTokens, "Cell") == 0) {
-                       if (step != 1) {
+#ifdef USESTEP                 
+               if (step != 1) {
                                printf("In: Parse Cell, exit, step is %i", 
step);
                                exit(1);
                        }
+#endif /* USESTEP*/
 
                        pTokens     = strtok(NULL, " ");
                        iCellNumber = atoi(pTokens);
@@ -154,10 +161,13 @@
 
                //Parse AP's MAC
                if (strcmp(pTokens, "Address:") == 0) {
+#ifdef USESTEP   
                        if (step != 2) {
                                printf("In: Parse Address, exit, step is %i", 
step);
                                exit(1);
                        }
+#endif /* USESTEP*/
+
                        pTokens = strtok(NULL, " ");
                        strncpy(strMAC[iCellNumber - 1], pTokens, 17);
 #ifdef DEBUG
@@ -176,11 +186,12 @@
                memset(strQPos, 0, ESSID_LENGTH);
                strTmp = strstr(pTokens, "Quality");
                if (strTmp != 0) {
-                       if (step != 4) {
+#ifdef USESTEP         
+               if (step != 4) {
                                printf("In: Parse Quality, exit, step is %i", 
step);
                                exit(1);
                        }
-
+#endif /* USESTEP*/
                        strcpy(strQPos, strTmp);
                        char tmp[2];
 
@@ -206,10 +217,13 @@
                //Parse AP Essid
                strTmp = strstr(pTokens, "ESSID:");
                if (strTmp != 0) {
+#ifdef USESTEP   
                        if (step != 3) {
                                printf("In: Parse ESSID, exit, step is %i", 
step);
                                exit(1);
                        }
+#endif /* USESTEP*/
+
 
                        int j = 0;
                        while (strTmp[7+j] != 34) {

Other related posts:

  • » [pisa-src] r1139 - trunk/tools/iwlist_parser.c - Tobias Heer