Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Wifi State query?


  • Please log in to reply
3 replies to this topic

#1 dx9s

dx9s

    Member

  • Members
  • PipPip
  • 12 posts

Posted 11 June 2015 - 09:33 PM

(I am sure there are several ways)

 

What is the way to read the state of the Wifi connection? In a sense, a way to derive my own "Yellow/Green" (referring to the LED by the Wifi antenna) state of the link.

 

I can see using this in a way where they would reasonably constantly going in and out of Wifi range and knowing the "wireless" link state would be helpful.

 

I hope the simplest way is also the "correct" way, in case there are several.

 

--Doug (dx9s)



#2 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 12 June 2015 - 07:29 AM

Chris wrote a post about how to detect if the network connection was present.  This included an event driven method for determining if the network connection was made / lost.

 

http://forums.netdui...ork-connection/

 

Not sure if there is a way of determining if a connection is in the process of being made though.

 

Hope this helps,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#3 dx9s

dx9s

    Member

  • Members
  • PipPip
  • 12 posts

Posted 12 June 2015 - 08:23 PM

I did read that and I know that options 1,2,3 not correct for my scenario. option #4 is a little confusing but is probably the closest to what I am thinking.

 

In networking terms, checking the networking link state (regardless if the IP layer is good or not). I keep on seeing in #4 reference to Network Address / Network Available and other things "network" layer 3 related or what I believe to be layer 3 related code.  One can derive / approximate the 'wireless' layer 1/2 link state from that, but it isn't exactly the same thing. (Darn my background in 'link state routing' -- I am sure it is making me seem problematic). It be also cool to get things like RSSI/RCPI readings from the wireless adapter.

 

A complete reference (working program) using option #4 would help clarify some things for me.

 

--Doug



#4 dx9s

dx9s

    Member

  • Members
  • PipPip
  • 12 posts

Posted 12 June 2015 - 08:44 PM

I read up on AutoResetEvent class: https://msdn.microso...v=vs.100).aspx (I've never used them before). My question is basically answered.

 

I think I would setup a different handler:

Microsoft.SPOT.Net.NetworkInformation.NetworkChange.NetworkAvailabilityChanged += (...);
Microsoft.SPOT.Net.NetworkInformation.NetworkChange.NetworkAddressChanged += (...);

that would setup and destroy the network code in it's own thread instead of using the AutoResetEvent to effectively cause a pause via WaitOne(). As in my case I would need to respond to the NF3Wifi going in and out of range multiple times instead of just once.

 

Just my thinking.

 

--Doug






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.