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.

Glen

Member Since 22 Jul 2011
Offline Last Active Jun 06 2013 02:51 PM
-----

#16281 PING a host on the network

Posted by Glen on 04 August 2011 - 12:28 AM

I downloaded the 4.2 RC today and am using the Netduino 4.2 beta 1 firmware. Still have it throw an exception when it hits this line
new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Icmp);



#15985 PING a host on the network

Posted by Glen on 28 July 2011 - 01:20 AM

Well.....here is this. I started looking into this thinking it wouldn't be that hard, and it was harder than I thought it would be. I don't actually have my netduino yet as I'm waiting for it to arrive still. I did test this in the emulator and it does seem to work as far as I can tell. I'm sure it could work better, but this seems to do ok. I'll actually try it out when my netduino plus arrives this weekend(hopefully). I used a bunch of the code from here and cut a lot out and changed it a bit to work with the micro framework, but it was my basis: http://www.winsocket...nication8i.html You can download the original full framework C# completed solution that goes with that tutorial here: http://www.winsocket...ocketPingCS.zip I also used the code for the BitConverter by Ravenheart that he posted here: http://forums.netdui...ch__1#entry2082 I took out the unsafe methods as they weren't being used. I created the NetworkHostConverter.cs since the micro framework doesn't have those conversions. I just loaded the original dll in dotpeek and did it the same way microsoft does. All that being said, there is probably some super easy way to do it, but sometimes you learn more doing it the hard way.

Attached Files

  • Attached File  ping.zip   12.05KB   120 downloads



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.