Author: remi
Date: 2008-12-19 18:29:29 +0100 (Fri, 19 Dec 2008)
New Revision: 3266

Modified:
   software_suite_v2/software/tux_wifi_channel/trunk/wifi_channel_win32.c
Log:
* removed Windows Vista support.

Modified: software_suite_v2/software/tux_wifi_channel/trunk/wifi_channel_win32.c
===================================================================
--- software_suite_v2/software/tux_wifi_channel/trunk/wifi_channel_win32.c      
2008-12-19 15:05:28 UTC (rev 3265)
+++ software_suite_v2/software/tux_wifi_channel/trunk/wifi_channel_win32.c      
2008-12-19 17:29:29 UTC (rev 3266)
@@ -506,103 +506,6 @@
 
         printf("[XP] Channel found : %d\n", channel);
     }
-    /* Version is vista or more recently */
-    else
-    {
-        FILE *pcmd;
-        char buff[80];
-        char connected_SSID[32];
-        int tc;
-        char *ssid_name;
-        int ssid_index;
-        int best_signal;
-        int signal;
-        int tmp_channel;
 
-        /* If no SSID specified then attempt to retrieve the current
-         * used SSID */
-        if (strcmp("", requested_SSID) == 0)
-        {
-            pcmd = popen("netsh wlan show interface", "r");
-
-            if (pcmd != NULL)
-            {
-                while(fgets(buff, 80, pcmd))
-                {
-                    if ((strstr(buff, "SSID") != NULL) &&
-                        (strstr(buff, "BSSID") == NULL))
-                    {
-                        sscanf(strrchr(buff, ':'), ": %s", &connected_SSID[0]);
-                        requested_SSID = connected_SSID;
-                        break;
-                    }
-                }
-
-                fclose(pcmd);
-            }
-        }
-
-        /* Get the channel */
-        while (1)
-        {
-            ssid_index = 0;
-            best_signal = 0;
-            signal = 0;
-            tmp_channel = 0;
-
-            pcmd = popen("netsh wlan show network mode=BSSID", "r");
-
-            if (pcmd != NULL)
-            {
-                while(fgets(buff, 80, pcmd))
-                {
-                    /* Get SSID */
-                    tc = sscanf(buff, "SSID %d : %s", &ssid_index, ssid_name);
-                    if (tc == 2)
-                    {
-                        continue;
-                    }
-                    /* Get Signal */
-                    tc = sscanf(buff, "         Signal             : %d",
-                        &signal);
-                    if (tc == 1)
-                    {
-                        continue;
-                    }
-                    /* Get Channel */
-                    tc = sscanf(buff, "         Channel            : %d",
-                        &tmp_channel);
-                    if (tc == 1)
-                    {
-                        if (strcmp(requested_SSID, ssid_name) == 0)
-                        {
-                            channel = tmp_channel;
-                            break;
-                        }
-
-                        if (signal > best_signal)
-                        {
-                           best_signal = signal;
-                           channel = tmp_channel;
-                        }
-                        continue;
-                    }
-                }
-
-                fclose(pcmd);
-            }
-
-            /* If the command "netsh wlan show network mode=BSSID" have
-             * normally worked then quit the while loop.
-             */
-            if ((ssid_index == 0) || (tmp_channel > 0))
-            {
-                break;
-            }
-        }
-
-        printf("[VISTA] Channel found : %d\n", channel);
-    }
-
     return channel;
 }


------------------------------------------------------------------------------
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to