Solved

c++ manage wireless connection

Posted on 2011-03-07
5
950 Views
Last Modified: 2012-05-11
I'm writing a small app for an XP notebook.  The app needs to connect to the Internet and send and receive a few files VIA FTP.  The notebook will not be used for any other Internet activity and the connection process must be as simple and seemless as possible.

What I would like to do is be able to, by default, have the wireless connection disabled so there's no chance of someone harming the notebook while it's roaming around (they will be moving from one place to the other a good bit).

When the user begins the app, it should enable the wireless connection, automatically connect to any unprotected network within range - even if it's not in the network list, send and receive the files, then disable the wireless connection again.

I've tried the "Automatically connect to non-preferred networks" setting in the advanced wireless network connections window, but after a reboot, it still doesn't automatically connect to my local unsecured network.  The user would have to go in and manually connect.  This is what I'd like to avoid if possible.

I'm sure all this is possible with C++, but I need a little guidance.

Thanks
0
Comment
Question by:theclay
  • 2
  • 2
5 Comments
 
LVL 11

Expert Comment

by:DeepuAbrahamK
ID: 35055715
Configuring the wireless may help. Have a look at the attachment.
wireless.JPG
0
 
LVL 6

Accepted Solution

by:
t-max earned 500 total points
ID: 35056388
There's a Microsoft utility to turn on/off wifi cards.
You can run that from a batch (or c++ if you want) on Windows start up, to disable the card, and then turn it on when your app runs.
More info here: http://wlanbook.com/enable-disable-wireless-card-command-line/
0
 

Author Comment

by:theclay
ID: 35058502
I have the notebook connecting fine on networks that were previously used - as per the first suggestion here.  What I'd like to do is have the notebook connect to new connections (like, if the user took it into a coffee shop) automatically without them having to open the connection window and tell it to connect.

The devcon app works great except that it takes it too long to start up the connection.  My program enables the connection, then tries to connect, but gives an error because it takes a little while to get the connection up and running once it's activated.  I could build a pause into the program, but the amount of time is probably going to vary based on how fast the notebook is, how many other programs are running, how the stars are aligned, etc.

I could probably make devcon work, but if in the mean time there are other remedies or suggestions I would love to hear them.
0
 
LVL 6

Expert Comment

by:t-max
ID: 35059508
I'm sure the delay is caused both by enabling the wifi interface again, and by the setup time it takes to connect to a known network. I'm not sure those delays are unavoidable, but perhaps they are.
About connecting automatically, I guess it's possible, but not so secure to my taste.
0
 

Author Comment

by:theclay
ID: 35060646
Yeah the delay makes sense.  Probably not avoidable.  I'll just have to set a timer if I want to use that method.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is about my first experience with programming Arduino.
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now