diff --git a/README.rst b/README.md similarity index 57% rename from README.rst rename to README.md index b5d1546..b4331f3 100644 --- a/README.rst +++ b/README.md @@ -1,5 +1,4 @@ -iwlib - interface with wireless tools in Linux -============================================== +# iwlib - interface with wireless tools in Linux iwlib is a package for interfacing with iwlib, providing an implementation to the wireless tools in Linux. @@ -15,16 +14,20 @@ back from a device. http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html -Installation +## Installation ------------ Installation requires the Python developer tools, and wireless_tools package for compilation. If Python.h and iwlib.h exist on your system, you should be good to go. - $ pip install iwlib +`$ pip install iwlib` -Change History +Depending on your linux distro, the package name may change. But this is tested on Ubuntu 17 +`$ sudo apt-get install libiw-dev` + + +## Change History -------------- 1.5 (1st October 2014) @@ -46,3 +49,24 @@ Change History 1.2.1 (21st March 2013) - Initial release of code, as it was when I inherited it. + +## Quick Guide +-------------- +Run following command in a bash shell to see the available wireless interfaces +`$ iwconfig ` + +('wlan0' is very common, so that is what we will use for this quick guide) + +Now in the python interactive Shell, +`>> import iwlib` +`>> interface = 'wlan0'` +`>> iwlib.get_iwconfig(interface)` +` {'BitRate': b'72.2 Mb/s', 'ESSID': b'AP_SSID', 'Access Point': b'AP_MAC', 'stats': {'quality': 45, 'noise': 0, 'updated': 75, 'level': 191}, 'Frequency': b'2.422 GHz', 'Mode': b'Managed'}` + +The dict's values are byte strings. You can use `b'xyz'.decode('utf-8')` to decode them into python strings. + +Finally, here's the docstring for the function +`>> print(iwlib.get_iwconfig.__doc__)` +` Retrieve the current configuration of an interface. ` +` Arguments:` +` - device to work on (e.g. eth1, wlan0). `