Project Embedded Systems E-ict Denayer
Dependencies: BSP_DISCO_F746NG F7_Ethernet LCD_DISCO_F746NG TS_DISCO_F746NG mbed-rtos mbed
ping.h@1:a2f7adf6db3d, 2017-01-24 (annotated)
- Committer:
- Ayrton_L
- Date:
- Tue Jan 24 00:23:30 2017 +0000
- Revision:
- 1:a2f7adf6db3d
- Parent:
- 0:16bcf70d262e
Latest stable
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Ayrton_L | 0:16bcf70d262e | 1 | #ifndef _PING_H_ |
Ayrton_L | 0:16bcf70d262e | 2 | #define _PING_H_ |
Ayrton_L | 0:16bcf70d262e | 3 | |
Ayrton_L | 0:16bcf70d262e | 4 | #include "lwip/opt.h" |
Ayrton_L | 0:16bcf70d262e | 5 | #include "lwip/mem.h" |
Ayrton_L | 0:16bcf70d262e | 6 | #include "lwip/raw.h" |
Ayrton_L | 0:16bcf70d262e | 7 | #include "lwip/icmp.h" |
Ayrton_L | 0:16bcf70d262e | 8 | #include "lwip/netif.h" |
Ayrton_L | 0:16bcf70d262e | 9 | #include "lwip/sys.h" |
Ayrton_L | 0:16bcf70d262e | 10 | #include "lwip/timers.h" |
Ayrton_L | 0:16bcf70d262e | 11 | #include "lwip/inet_chksum.h" |
Ayrton_L | 0:16bcf70d262e | 12 | #include "lwip/sockets.h" |
Ayrton_L | 0:16bcf70d262e | 13 | #include "lwip/inet.h" |
Ayrton_L | 0:16bcf70d262e | 14 | |
Ayrton_L | 0:16bcf70d262e | 15 | #ifndef PING_RCV_TIMEO //ping timeout... geen antwoord binnen deze tijd => timeout request |
Ayrton_L | 0:16bcf70d262e | 16 | #define PING_RCV_TIMEO 1000 |
Ayrton_L | 0:16bcf70d262e | 17 | #endif |
Ayrton_L | 0:16bcf70d262e | 18 | |
Ayrton_L | 0:16bcf70d262e | 19 | #ifndef PING_ID |
Ayrton_L | 0:16bcf70d262e | 20 | #define PING_ID 0x2601 //identifier om te matchen (antwoord matched hiermee. Linux => uniek, Windows => vast, maar wel verschillend per vesrie), subtiele hint 2601 voor beter resultaat? :) |
Ayrton_L | 0:16bcf70d262e | 21 | #endif |
Ayrton_L | 0:16bcf70d262e | 22 | |
Ayrton_L | 0:16bcf70d262e | 23 | #ifndef PING_DATA_SIZE //grootte payload: "random" data die ook gematched moet worden in het antwoord |
Ayrton_L | 0:16bcf70d262e | 24 | #define PING_DATA_SIZE 32 |
Ayrton_L | 0:16bcf70d262e | 25 | #endif |
Ayrton_L | 0:16bcf70d262e | 26 | |
Ayrton_L | 0:16bcf70d262e | 27 | #ifndef PING_DELAY |
Ayrton_L | 0:16bcf70d262e | 28 | #define PING_DELAY 500 |
Ayrton_L | 0:16bcf70d262e | 29 | #endif |
Ayrton_L | 0:16bcf70d262e | 30 | |
Ayrton_L | 0:16bcf70d262e | 31 | #ifndef PING_RESULT |
Ayrton_L | 0:16bcf70d262e | 32 | #define PING_RESULT(ping_ok) |
Ayrton_L | 0:16bcf70d262e | 33 | #endif |
Ayrton_L | 0:16bcf70d262e | 34 | |
Ayrton_L | 1:a2f7adf6db3d | 35 | /*-----------------------------------------------------------*/ |
Ayrton_L | 1:a2f7adf6db3d | 36 | |
Ayrton_L | 1:a2f7adf6db3d | 37 | uint32_t ul_Ping( ip_addr_t *x_PingTarget ); |
Ayrton_L | 1:a2f7adf6db3d | 38 | void v_MaakPingRequest( struct icmp_echo_hdr *x_ICMPEchoHdr, uint16_t us_Lenght ); |
Ayrton_L | 1:a2f7adf6db3d | 39 | void v_PingOntvang( int32_t l_SocketReturn ); |
Ayrton_L | 1:a2f7adf6db3d | 40 | err_t ux_Ping( int32_t l_SocketReturn, ip_addr_t *x_IPAddr ); |
Ayrton_L | 1:a2f7adf6db3d | 41 | |
Ayrton_L | 0:16bcf70d262e | 42 | static uint16_t us_PingSequenceNummer; |
Ayrton_L | 0:16bcf70d262e | 43 | |
Ayrton_L | 1:a2f7adf6db3d | 44 | /*-----------------------------------------------------------*/ |
Ayrton_L | 0:16bcf70d262e | 45 | |
Ayrton_L | 0:16bcf70d262e | 46 | #endif |