Author: remi
Date: 2009-09-04 13:45:26 +0200 (Fri, 04 Sep 2009)
New Revision: 5331

Added:
   software_suite_v3/smart-core/smart-server/trunk/util/wifi/
   software_suite_v3/smart-core/smart-server/trunk/util/wifi/TuxWifiChannel.py
   software_suite_v3/smart-core/smart-server/trunk/util/wifi/__init__.py
   
software_suite_v3/smart-core/smart-server/trunk/util/wifi/libtuxwifichannel.dll
Log:
* Added wrapper to libtuxwifichannel library

Added: 
software_suite_v3/smart-core/smart-server/trunk/util/wifi/TuxWifiChannel.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/wifi/TuxWifiChannel.py 
                        (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/util/wifi/TuxWifiChannel.py 
2009-09-04 11:45:26 UTC (rev 5331)
@@ -0,0 +1,56 @@
+#    Copyright (C) 2009 KYSOH Sa
+#    Remi Jocaille <[email protected]>
+#    Distributed under the terms of the GNU General Public License
+#    http://www.gnu.org/copyleft/gpl.html
+
+from ctypes import *
+import os
+
+# 
==============================================================================
+# Public class
+# 
==============================================================================
+
+# 
------------------------------------------------------------------------------
+# libtuxwifichannel wrapper class.
+# 
------------------------------------------------------------------------------
+class TuxWifiChannel(object):
+    """libtuxwifichannel wrapper class.
+    """
+
+    # 
--------------------------------------------------------------------------
+    # Constructor.
+    # 
--------------------------------------------------------------------------
+    def __init__(self, library_path = None):
+        """Constructor.
+        @param library_path: Path of libtuxwifichannel library. (Default None)
+        """
+        if library_path == None:
+            mPath, mFile = os.path.split(__file__)
+            if os.name == 'nt':
+                library_path = os.path.join(mPath, "libtuxwifichannel.dll")
+            else:
+                library_path = os.path.join(mPath, "libtuxwifichannel.so")
+        self.tux_wifi_channel_lib = None
+        if os.path.isfile(library_path):
+            try:
+                self.tux_wifi_channel_lib = CDLL(library_path)
+            except:
+                self.tux_wifi_channel_lib = None
+
+    # 
--------------------------------------------------------------------------
+    # Get the currently used wifi channel.
+    # 
--------------------------------------------------------------------------
+    def getCurrent(self, priorSSID = ""):
+        """Get the currently used wifi channel.
+        @param priorSSID: Network SSID to search in prior.
+        @return: An integer or None.
+        """
+        if self.tux_wifi_channel_lib == None:
+            return None
+        try:
+            channel = 
self.tux_wifi_channel_lib.get_wifi_channel(c_char_p(priorSSID))
+            if channel == -1:
+                channel = None
+        except:
+            channel = None
+        return channel

Added: software_suite_v3/smart-core/smart-server/trunk/util/wifi/__init__.py
===================================================================

Added: 
software_suite_v3/smart-core/smart-server/trunk/util/wifi/libtuxwifichannel.dll
===================================================================
(Binary files differ)


Property changes on: 
software_suite_v3/smart-core/smart-server/trunk/util/wifi/libtuxwifichannel.dll
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to