EVB-PIC24 WIZnet, EVB-PIC24 Datasheet - Page 52

no-image

EVB-PIC24

Manufacturer Part Number
EVB-PIC24
Description
Development Boards & Kits - PIC / DSPIC W3150A+EVAL BOARD BASED ON PIC24
Manufacturer
WIZnet
Datasheet

Specifications of EVB-PIC24

Rohs
yes
Product
Development Kits
Interface Type
RS-232
Data Bus Width
16 bit
Dimensions
50 mm x 40 mm
Display Loss
bLoop = 0 , RemainTime =0 , IsReceived = 0
Ping Reply
Local Variable Declare & Init
PingRequest . id =
long peerip = inet _ aton ( addr )
PingRequest
PingRequest
PingRequest
PingRequest
setSn_PROTO( s , IPPROTO_ ICMP)
SOCKET s =
PINGMSG PingReply
PINGMSG PingRequest
Fill in PingReqeust
Open s Socket For IP _ RAW Mode
socket(s , Sn_MR_IPRAW
. type = 8
. code = 0
. checksum = 0
. seqnum = Random Integer Number
Verify the Arguments
Unreachable
PingLog .ChecksumErr ++
.
Expired
Display
Send a Ping -Reply to a peer
TTL
ping ()
IsReceived = 1
Error
Random Integer Number
PingLog .Loss ++
addr == received
data with a to w alphabet
_
peer addr
Checksum
Error
Call SendPingReply ()
Display
Y
© Copyright 2006 WIZnet Co., Inc. All rights reserved.
PingLog . TimeExceedMSG++
IsReceived = 1
)
PingLog . UnreachableErr++
IsReceived = 1
N
Y
IsReceived = 0
N
<Fig 3.11: ping()>
Send PingRequest to the specified peer
Calculate Checksum of PingRequest
Calculate Check Sum of PingReply
Receive PingReply from a peer
Update PingRequest
N
Y
Y
PingRequest . seqnum++
Y
PingRequest . checksum = 0
N
RemainTime = time / 2
IsReceived = 0
PingLog.PingRequest++
PingLog .UnkonwMSG++
Successed to Send ?
Check Sum Error ?
PingReply . type == 0
PingReply . type == 3
PingReply . type == 8
RemainTime -- > 0
PingReply . type == 11
Received Size > 0
bLoop == 1
recvfrom ()
Unknown
Message
Display
Wait 2 ms
sendto ()
N
Y
N
N
N
Y
Y
Y
. checksum
Y
N
Y
N
N
PingLog . UnkonwMSG ++
PingRequest .seqnum - 1
PingLog . PingReply++
IsReceived = 1
received peer addr
count > 0
PingReply.Seqnum
count --
PingRequest .id
Ping Reply OK
PingLog . ARPErr ++
PingReply . id
Display
Display
Unknown
s Socket Status ==
addr
Y
SOCK _ CLOSED
Peer
N
==
Y
Y
Y
==
==
setSn_PROTO(s,IPPROTO_ICMP)
Y
N
N
socket (s)
N
Reopen Socket
close (s)
setSn_PROTO(s,0)
N
Close Socket
Is Pressed
CTRL - C?
close (s)
N
Y
END
42

Related parts for EVB-PIC24