Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (3) </ [1] 2 3 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Making a usb wireless device config utility, for prism2_usb devices< Next Oldest | Next Newest >
SaidinUnleashed Offline





Group: Members
Posts: 1428
Joined: Mar. 2004
Posted: Oct. 17 2004,06:28 QUOTE

Quote (Aiku @ Sep. 20 2004,01:19 (in the "Verified Wireless Cards" Thread))
Here is what I use for basic connection for my Netgear USB MA111

#!/bin/bash
wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable
wlanctl-ng wlan0 lnxreq_autojoin ssid=YOUR_SSID authtype=opensystem
pump -i wlan0
kill `pidof wmnet`
wmnet -w -W wlan0 &

I mainly use it a public access points



I'm getting in the spirit of a real linux user and writing an app to do this easily.

It'll be in C++ as source, and I'll post the source here as well as emailing the binary to ke4nt1.

I'd write it in C, but I don't know how to use variables as a part of a system call in C, although I'm not 100% sure how to in C++, that's what I've been using lately. So deal.

Here's the incomplete source for what I have so far. far from finished, so it won't compile, but I wanted to share.

Code Sample
#include <iostream.h>
#include <string>
#include <stdlib.h>

int main()
{
// This program will configure your prism2_usb.o based USB wireless device for use in Damn Small Linux v.0.8.2
// This was thrown together by J.P. Nimmo, a.k.a. SaidinUnleased late at night, and as such may be buggy, crappy, ed up, or may not work all together. If you experience problems, fix it yourself.

 system ("clear");

 cout << "This program will configure and enable your prism2 based USB wireless device and restarts wmnet to monitor it.\n";

 short int menuchoice = 0;

 string devname = wlan0;

 string authtype = opensystem;

 string sid;

 while (menuchoice != 6)
  {
   cout << "--------MAKE SURE YOU DO 3--------\n";
   cout << "1 - run iwconfig \(so you can see the name of your USB wireless device, usually wlan0\)\n";
   cout << "2 - set your USB wireless device's name \(default wlan0\)\n";
   cout << "3 - set your SSID \(the name of the network, usually\)\n";
   cout << "4 - set your authtype \(default is opensystem\)\n";
   cout << "5 - execute the setup, according to your settings and exit\n";
   cout << "6 - Exit without doing anything\n"
   cout << "--------MAKE SURE YOU DO 3--------\n";
   cout << endl;
   cout << Enter your choice: ";

   cin >> menuchoice;

   if (menuchoice<1 || menuchoice>5)
    {
     cout << "THAT CHOICE IS NOT VALID!!!\n";
     cout << endl;
    }

   if (menuchoice == 1)
    {
     system ("sudo iwconfig");
     cout << endl;
    }

   if (menuchoice == 2)
    {
     cout << "Enter the name of the wireless device: ";
     cin >> devname;
     cout << endl;
    }

   if (menuchoice == 3)
    {
     cout << "Enter your SSID: ";
     cin ssid;
     cout << endl;
    }

   if (menuchoice == 5)
    {
     cout << "Executing config with Device name \"" << devname << "\" with SSID \" << ssid << "\" and authtype \"" << authtype << "\".\n";
     cout << "Is this correct? \(y or n\) ";

     char confirm;


Like I said, it's not finished, but it's a start. And it should work on all prism2_usb.o based devices, when it's done.

-J.P.
SaidinUnleashed


--------------
They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, cause if you play it forwards, it installs Windows.

Unleash the power of the TILDE~~~
Back to top
Profile PM AOL MSN YIM 
Aiku Offline





Group: Members
Posts: 21
Joined: May 2004
Posted: Oct. 17 2004,06:49 QUOTE

It appears that 0.8.2 has a GUI for prims2 devices.
System->Net Setup->prism2
Back to top
Profile PM 
SaidinUnleashed Offline





Group: Members
Posts: 1428
Joined: Mar. 2004
Posted: Oct. 17 2004,19:52 QUOTE

Yes, but it doesn't work with usb devices. Or, at least, I can't get it to work...

-J.P.
SaidinUnleashed


--------------
They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, cause if you play it forwards, it installs Windows.

Unleash the power of the TILDE~~~
Back to top
Profile PM AOL MSN YIM 
SaidinUnleashed Offline





Group: Members
Posts: 1428
Joined: Mar. 2004
Posted: Oct. 17 2004,22:20 QUOTE

okay, it app is mostly done. Only thing is, I can't figure out how to use a variable's value in a system call, which is required to set the ssid.

so, this is my little attempt at getting some help.

the source code can be downloaded here/

In it's current form, the source won't compile, so unless you want to help me figure this out, please don't download it. very limited bandwidth there.

okay, here are the problems.

Lines 66 - 71: trying to make a confirm input that would accept Y and y as true, and N and n as false. Simple for someone with a lot of experience, which I don't have.

Lines 73 - 77: can't figure out how to use the value of a variable inside a system call.


anyways, I will continue to tinker with it next week untill someone fixes it here, or I figure it out.

Have fun.

-J.P.
SaidinUnleashed


--------------
They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, cause if you play it forwards, it installs Windows.

Unleash the power of the TILDE~~~
Back to top
Profile PM AOL MSN YIM 
somerville32@hotmail.com Offline





Group: Members
Posts: 117
Joined: Oct. 2004
Posted: Oct. 18 2004,00:55 QUOTE

Good job. Keep up the good work :)

--------------
And then there was linux...
Back to top
Profile PM AOL MSN YIM 
12 replies since Oct. 17 2004,06:28 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (3) </ [1] 2 3 >/
reply to topic new topic new poll
Quick Reply: Making a usb wireless device config utility

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code