DonationCoder.com Software > Post New Requests Here
IDEA: Wireless sensor
techidave:
I have searched some online trying to find something already made up but have come up empty. So I have an idea for a coding snack but I do not know if it is possible or not. But here goes. :)
In a school setting with laptops, students sometimes get anxious to log into the network but find they cannot because the wireless card hasn't fully come online, etc, etc.
So what I have envisioned is this: To have a green dot (large one) say in the upper right corner if it senses a wireless connection or a red dot in the upper left corner if their isn't. It would also have to check, say every 5 seconds to see if the connection status has changed. Or it could change the whole desktop a different color for that matter.
It would have to become active before the user logged in. I haven't found a way to see if their is a active connection without being at the desktop.
Is it possible to do something like this???
skwire:
1) Is the wireless NIC its only connection to the network?
2) If so, is there a network address on the network that is always pingable (gateway, etc.)?
techidave:
Yes to both questions.
Stoic Joker:
Pinging might get blocked by an over zealous firewall. But if the adapters were scanned for a DGW, the DGW could then be ARP'ed. If the ARP call came back with a valid result connected = true.
Firewalls won't affect ARP, and nothing needs to be hardcodded so it'll work anywhere.
Here's a ARP call/test in C++ It took me weeks to figure this out (because everything I Googled said it couldn't be done):
--- Code: C++ ---//======================================================================================================//======================================================================== Hay MAC, WTFs Your Address...?bool GetMACAddress(char *szIPAddr, char *szMAC) { //===================================================== ULONG DestMAC[2],ulLen = 6; LPBYTE lpBuff; memset(DestMAC, 0xff, sizeof (DestMAC)); if(SendARP(inet_addr(szIPAddr), 0, DestMAC, &ulLen) == NO_ERROR) { lpBuff = (LPBYTE)DestMAC; // Now Convert - Address to a String. StringCbPrintf(szMAC, GEN_BUFF, "%02X:%02X:%02X:%02X:%02X:%02X", lpBuff[0], lpBuff[1], lpBuff[2], lpBuff[3], lpBuff[4], lpBuff[5]); return TRUE; } // <-- IF False, Then the Target is on a Different Subnet and is therefore out of (ARP Required) StringCbCopy(szMAC, GEN_BUFF, "Not in ARP Table"); // <------------- Broadcast Range ... Say So! // <------------------------- Note: This Was Added as Part of Build 88 to v1.0.0 <--++++---<<<<< return FALSE;}
techidave:
not sure what your little program means but one school has about 60 laptops that this would need to be done with.
Navigation
[0] Message Index
[#] Next page
Go to full version