Solved

c++ manage wireless connection

Posted on 2011-03-07
5
961 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
recursion example 16 124
FMX TCameraComponent Problem 2 69
simplest php form 3 77
VB.net and sql server 4 34
A short article about a problem I had getting the GPS LocationListener working.
A short article about problems I had with the new location API and permissions in Marshmallow
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

776 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