Ayrton Leyssens / ProjectES

My project

Dependencies:   BSP_DISCO_F746NG F7_Ethernet LCD_DISCO_F746NG TS_DISCO_F746NG mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
Ayrton_L
Date:
Mon Jul 17 01:00:39 2017 +0000
Parent:
2:1a5565ee8219
Commit message:
first remote

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
main.h Show annotated file Show diff for this revision Revisions of this file
ping.cpp Show diff for this revision Revisions of this file
ping.h Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Jan 26 10:40:35 2017 +0000
+++ b/main.cpp	Mon Jul 17 01:00:39 2017 +0000
@@ -1,6 +1,6 @@
 #include "main.h"
 
-uint32_t ul_ResetDisplay( void )
+int32_t l_ResetDisplay( void )
 {
     display.Clear( LCD_COLOR_WHITE );
     display.SetBackColor( LCD_COLOR_WHITE );
@@ -10,11 +10,12 @@
 
 /*-----------------------------------------------------------*/
 
-uint32_t ul_CheckDHCP( void )                                     
+int32_t l_CheckDHCP( void )                                     
 {
     uint32_t ul_MyReturn = 2;
     Network *x_DynNetwork = mpool.alloc();                                      //waarschijnlijk loopt het hier mis met een memory pool
-     
+    //Network *x_DynNetwork;
+    
     if( Eth.init( ) == 0 )
     {
         char c_NewIP[16];
@@ -23,6 +24,8 @@
         if( strcmp( x_DynNetwork->c_IPAddress, c_NewIP ) == false )
         {
             strncpy( x_DynNetwork->c_IPAddress, c_NewIP, 16 );
+            //display.DisplayStringAt( 270, 10, ( uint8_t * )x_DynNetwork->c_IPAddress, LEFT_MODE );
+            //display.DisplayStringAt( 270, 50, ( uint8_t * )Eth.getIPAddress( ), LEFT_MODE ); 
             strncpy( x_DynNetwork->c_MACAddress, Eth.getMACAddress( ), 16 );
             strncpy( x_DynNetwork->c_Netmask, Eth.getNetworkMask( ), 16 );
             strncpy( x_DynNetwork->c_Gateway, Eth.getGateway( ), 16 );
@@ -39,176 +42,125 @@
 
 /*-----------------------------------------------------------*/
 
-uint32_t ul_CheckInternet( void )
+int32_t l_CreateMenu( void )
 {
-    uint32_t ul_Counter = 0;
-    uint32_t ul_PingCounter = 0;
-    ip_addr_t x_PingTarget = { 0x08080808 }; 
-    for( ul_Counter = 0; ul_Counter < 4; ul_Counter++)
-    {    
-        if( ul_Ping( &x_PingTarget ) == 0 )
-        {
-            ul_PingCounter++;
-        }
-    }
-    if( ul_PingCounter >= 3 )
-    {
-        return 0; 
-    }
-    else
-    {
-        return 1;
-    }
-      
+    //480x272
+    display.DrawRect( 0, 0, 105, 68);
+    display.DisplayStringAt( 2, 34, ( uint8_t * )"DHCP", LEFT_MODE );
+    display.DrawRect( 0, 68, 105, 68);
+    display.DisplayStringAt( 2, 102, ( uint8_t * )"STATIC", LEFT_MODE );
+    return 0;
 }
 
 /*-----------------------------------------------------------*/
 
-uint32_t ul_ShowDevices( void )
+int32_t l_ShowSettings( void )
 {
-    uint32_t ul_GenIP = 0;
-    uint32_t ul_MyIP = 0;
-    uint32_t ul_Counter =0;
-    uint32_t ul_DevCounter = 0;
-    
-    ip_addr_t x_ActDev[255];                     //max 255 adressen binnen sub, beter is malloc gebruik en redefine van array/vector => max IP adressen haalbaar: 4228250625
-    
-    osEvent x_Evt = queue.get();
-    if (x_Evt.status == osEventMessage) 
+    l_ResetDisplay( );
+    display.SetFont( &Font16 );
+    display.DisplayStringAt( 10, 10, ( uint8_t * )"Starting application", LEFT_MODE ); 
+    display.DisplayStringAt( 10, 30, ( uint8_t * )"Initiating EthernetInterface", LEFT_MODE ); 
+    if( Eth.init( ) == 0 )
     {
-        Network *x_DynNetwork = (Network*)x_Evt.value.p;
-        ul_MyIP = ( uint32_t ) x_DynNetwork->c_IPAddress ;
-        mpool.free(x_DynNetwork);
+        display.DisplayStringAt( 10, 50, ( uint8_t * )"Initiating EthernetInterface: done", LEFT_MODE );
+        display.DisplayStringAt( 10, 70, ( uint8_t * )"Connecting to EthernetInterface", LEFT_MODE );
         
-        ul_GenIP = ul_MyIP & 0xFFFFFF00;
-       
-        for( ul_Counter = 1; ul_Counter < 255; ul_Counter++)
-        {
-            ul_GenIP++;
-            if( ul_Ping( ( ip_addr_t * ) ul_GenIP ) == 0 )
-            {
-                ip_addr_t x_ConIP = { ul_GenIP };
-                x_ActDev[ul_DevCounter] = x_ConIP;                          //voor een of andere reden is dit de enige manier dat werkt
-                ul_DevCounter++;
-            }
-        }  
+        char c_NewIP[16];
+        Eth.connect( );
+        display.DisplayStringAt( 10, 90, ( uint8_t * )"Initiating EthernetInterface: done", LEFT_MODE );
+        display.DisplayStringAt( 10, 110, ( uint8_t * )"Receiving network information", LEFT_MODE );        
+        
+        strncpy( c_NewIP, Eth.getIPAddress( ), 16 );
+        l_ResetDisplay( );
+        l_CreateMenu( );
+        
+        display.DisplayStringAt( 130, 10, ( uint8_t * )"IP address: ", LEFT_MODE ); 
+        display.DisplayStringAt( 270, 10, ( uint8_t * )c_NewIP, LEFT_MODE );  
+        display.DisplayStringAt( 130, 30, ( uint8_t * )"Netmask: ", LEFT_MODE ); 
+        display.DisplayStringAt( 270, 30, ( uint8_t * )Eth.getNetworkMask( ), LEFT_MODE ); 
+        display.DisplayStringAt( 130, 50, ( uint8_t * )"Gateway: ", LEFT_MODE ); 
+        display.DisplayStringAt( 270, 50, ( uint8_t * )Eth.getGateway( ), LEFT_MODE );
+        display.DisplayStringAt( 130, 70, ( uint8_t * )"Internet: ", LEFT_MODE ); 
+        l_sendNTPpacket();
     }
     
     return 0;
 }
 
-uint32_t ul_CreateMenu( void )
-{
-    //480x272
-    display.DrawRect( 0, 0, 125, 68);
-    display.DisplayStringAt( 2, 34, ( uint8_t * )"Settings", LEFT_MODE );
-    display.DrawRect( 0, 68, 125, 68);
-    display.DisplayStringAt( 2, 102, ( uint8_t * )"PING", LEFT_MODE );
-    return 0;
-}
-
 /*-----------------------------------------------------------*/
 
-uint32_t ul_ShowSettings( void )
+Serial pc(USBTX, USBRX); // tx, rx
+
+int32_t l_sendNTPpacket(void)
 {
-    osEvent x_Evt = queue.get();
-    if (x_Evt.status == osEventMessage) 
+    UDPSocket x_Sock;
+    int32_t l_ErrorCatch;
+    uint32_t ul_Epoch;  
+    uint16_t us_LowWord;
+    uint16_t us_HighWord; 
+    uint8_t uc_PacketBuffer[NTP_PACKET_SIZE];
+    
+    uc_PacketBuffer[0] = 0b11100011;
+    uc_PacketBuffer[1] = 0;
+    uc_PacketBuffer[2] = 6;
+    uc_PacketBuffer[3] = 0xEC;
+    uc_PacketBuffer[12] = 49;
+    uc_PacketBuffer[13] = 0x4E;
+    uc_PacketBuffer[14] = 49;
+    uc_PacketBuffer[15] = 52;
+    
+    l_ErrorCatch = x_Sock.init();
+    
+    if( l_ErrorCatch == -1 )
     {
-        Network *x_DynNetwork = (Network*)x_Evt.value.p;
-        ul_ResetDisplay( );
-        ul_CreateMenu( );
-        display.SetFont( &Font16 );
-        display.DisplayStringAt( 130, 10, ( uint8_t * )"IP address: ", LEFT_MODE ); 
-        display.DisplayStringAt( 270, 10, ( uint8_t * )x_DynNetwork->c_IPAddress, LEFT_MODE );
-        display.DisplayStringAt( 130, 30, ( uint8_t * )"MAC Address: ", LEFT_MODE ); 
-        display.DisplayStringAt( 270, 30, ( uint8_t * )x_DynNetwork->c_MACAddress, LEFT_MODE );  
-        display.DisplayStringAt( 130, 50, ( uint8_t * )"Netmask: ", LEFT_MODE ); 
-        display.DisplayStringAt( 270, 50, ( uint8_t * )x_DynNetwork->c_Netmask, LEFT_MODE ); 
-        display.DisplayStringAt( 130, 70, ( uint8_t * )"Gateway: ", LEFT_MODE ); 
-        display.DisplayStringAt( 270, 70, ( uint8_t * )x_DynNetwork->c_Gateway, LEFT_MODE );
-        display.DisplayStringAt( 130, 90, ( uint8_t * )"Internet: ", LEFT_MODE ); 
-        if( ul_CheckInternet == 0 )
+        display.DisplayStringAt( 270, 70, ( uint8_t * )"Not Connected" , LEFT_MODE );
+        return -1;
+    }
+    
+    Endpoint x_NTPServer;
+    l_ErrorCatch = x_NTPServer.set_address(NTP_SERVER_ADDRESS, NTP_SERVER_PORT);
+    if( l_ErrorCatch == -1 )
+    {
+        l_ErrorCatch = x_NTPServer.set_address(NTP_SERVER_ADDRESS_IP, NTP_SERVER_PORT);
+        if( l_ErrorCatch == -1 )
         {
-            display.DisplayStringAt( 270, 90, ( uint8_t * )"connected", LEFT_MODE );
-        }
-        else
-        {
-            display.DisplayStringAt( 270, 90, ( uint8_t * )"not connected", LEFT_MODE );
-        }
-        mpool.free(x_DynNetwork);
-    }
-    return 0;
-}
-
-/*-----------------------------------------------------------*/
-
-void v_TouchThread( )
-{
-     Timer x_Timer1;
-    uint32_t ul_Time =0;
-    uint32_t ul_Counter =0;
-    TS_StateTypeDef Touch_State; 
-    ip_addr_t x_PingTarget = { 0x08080808 }; 
-    
-    Touch.Init( 420, 272 ); 
-    
-    while( 1 ) 
-    {
-        Touch.GetState( &Touch_State );
-        if( ( Touch_State.touchDetected )&& ( Touch_State.touchX[0] < 125 )&& ( Touch_State.touchY[0] < 69 ) ) 
-        {
-            ul_ResetDisplay( );
-            ul_CreateMenu( );
-            ul_ShowSettings( );
-        } 
-        else if( ( Touch_State.touchDetected )&& ( Touch_State.touchX[0] < 125 )&& ( Touch_State.touchY[0] > 68 )&& ( Touch_State.touchY[0] < 137 ) ) 
-        { 
-            for( ul_Counter = 0; ul_Counter < 4; ul_Counter++)
-            {
-                x_Timer1.start( );
-                ul_Ping( &x_PingTarget );
-                x_Timer1.stop( );
-                ul_Time = ul_Time + x_Timer1;
-            }
-            ul_ResetDisplay( );
-            ul_CreateMenu( );
-            ul_Time = ul_Time/4;
-            display.DisplayStringAt( 130, 10, ( uint8_t * )"Internet: ", LEFT_MODE );
-            if( ul_CheckInternet == 0 )
-            {
-                display.DisplayStringAt( 270, 90, ( uint8_t * )"connected", LEFT_MODE );
-            }
-            else
-            {
-                display.DisplayStringAt( 270, 90, ( uint8_t * )"not connected", LEFT_MODE );
-            }
-            display.DisplayStringAt( 130, 30, ( uint8_t * )"PING: ", LEFT_MODE ); 
-            display.DisplayStringAt( 270, 30, ( uint8_t * )ul_Time, LEFT_MODE );
-        }
-        else
-        {
-            //niks doen
+            display.DisplayStringAt( 270, 70, ( uint8_t * )"Not Connected" , LEFT_MODE );
+            return -2;
         }
     }
+    
+    l_ErrorCatch= x_Sock.sendTo(x_NTPServer, ( char* )uc_PacketBuffer, NTP_PACKET_SIZE);
+    
+    if( l_ErrorCatch == -1 )
+    {
+        display.DisplayStringAt( 270, 70, ( uint8_t * )"Not Connected" , LEFT_MODE );
+        return -1;
+    }
+    
+    l_ErrorCatch = x_Sock.receiveFrom(x_NTPServer, ( char* ) uc_PacketBuffer, NTP_PACKET_SIZE);
+
+    if( l_ErrorCatch == -1 )
+    {
+        display.DisplayStringAt( 270, 70, ( uint8_t * )"Not Connected" , LEFT_MODE );
+        return -1;
+    }
+    
+    us_HighWord = (uc_PacketBuffer[40] << 8 ) | uc_PacketBuffer[41];
+    us_LowWord = (uc_PacketBuffer[42] << 8 ) | uc_PacketBuffer[43];
+    ul_Epoch = ((us_HighWord << 16) | us_LowWord );
+    ul_Epoch = ul_Epoch - 2208988800;
+    
+    display.SetFont( &Font16 );
+    display.DisplayStringAt( 270, 70, ( uint8_t * )"Connected" , LEFT_MODE );
+    
+    x_Sock.close();
+    return 0;
 }
 
 /*-----------------------------------------------------------*/
 
 int main( void )
 {   
-    Thread x_T1(osPriorityNormal, (DEFAULT_STACK_SIZE * 2.25), NULL);
-    x_T1.start( v_TouchThread );
-    while( ul_CheckDHCP( ) != 0 )
-    {
-        ul_ResetDisplay( );
-        ul_CreateMenu( );
-        //Thread x_T1(osPriorityNormal, (DEFAULT_STACK_SIZE * 2.25), NULL);
-        //x_T1.start( v_TouchThread );
-
-        ul_ShowSettings( );
-        ul_CheckInternet( );
-        
-        wait_ms(1000);                                           //kleinde delay => geen 1000 keer uitvoeren van checkdhcp => efficienter maar misschien iets trager
-    }
-    return 0;
-}
+    l_ShowSettings( );
+    Eth.disconnect();
+}
\ No newline at end of file
--- a/main.h	Thu Jan 26 10:40:35 2017 +0000
+++ b/main.h	Mon Jul 17 01:00:39 2017 +0000
@@ -7,11 +7,29 @@
 
 #include "rtos.h"
 #include "EthernetInterface.h"
-#include "Socket/TCPSocketConnection.h"
+
 #include "TS_DISCO_F746NG.h"
 #include "LCD_DISCO_F746NG.h"
 
-#include "ping.h"
+
+
+#ifndef NTP_SERVER_ADDRESS                                  
+#define NTP_SERVER_ADDRESS          "1.be.pool.ntp.org"
+#endif
+
+#ifndef NTP_SERVER_ADDRESS_IP
+#define NTP_SERVER_ADDRESS_IP       "185.77.199.1"
+#endif
+
+#ifndef NTP_SERVER_PORT                                  
+#define NTP_SERVER_PORT             123                     
+#endif
+
+
+#ifndef NTP_PACKET_SIZE
+#define NTP_PACKET_SIZE     48
+#endif
+
 
 /*-----------------------------------------------------------*/
 
@@ -27,7 +45,9 @@
 EthernetInterface Eth;
 LCD_DISCO_F746NG display;
 TS_DISCO_F746NG Touch;
-TCPSocketConnection myTCP;
+
+
+
 
 MemoryPool<Network, 64> mpool;
 Queue<Network, 64> queue;
@@ -35,13 +55,10 @@
 
 /*-----------------------------------------------------------*/
 
-uint32_t ul_ResetDisplay( void );
-uint32_t ul_CheckDHCP( void );
-uint32_t ul_CheckInternet( void );
-uint32_t ul_CreateMenu( void );
-uint32_t ul_ShowSettings( void );
-uint32_t ul_ShowDevices( void );
-void v_TouchThread( void const *args );
+int32_t l_ResetDisplay( void );
+int32_t l_CreateMenu( void );
+int32_t l_ShowSettings( void );
+int32_t l_sendNTPpacket(void);
 
 /*-----------------------------------------------------------*/
 
--- a/ping.cpp	Thu Jan 26 10:40:35 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-#include "ping.h"
-
-void v_MaakPingRequest( struct icmp_echo_hdr *x_ICMPEchoHdr, uint16_t us_Lenght )
-{
-    int32_t ul_I = 0;
-    int32_t ul_DataLenght = 0;
-    ul_DataLenght = us_Lenght - sizeof( struct icmp_echo_hdr );
-
-    ICMPH_TYPE_SET( x_ICMPEchoHdr, ICMP_ECHO );
-    ICMPH_CODE_SET( x_ICMPEchoHdr, 0 );
-    x_ICMPEchoHdr->chksum = 0;
-    x_ICMPEchoHdr->id = PING_ID;
-    x_ICMPEchoHdr->seqno = htons( ++us_PingSequenceNummer );                                   //byte order to netwerk byte order
-
-    for( ul_I = 0; ul_I < ul_DataLenght; ul_I++ )                                             //beetje "random" data erin gooien
-    {
-        ( ( char* ) x_ICMPEchoHdr )[sizeof( struct icmp_echo_hdr ) + ul_I] = ( char )ul_I;
-    }
-
-    x_ICMPEchoHdr->chksum = inet_chksum( x_ICMPEchoHdr, us_Lenght );
-}
-
-/*-----------------------------------------------------------*/
-
-err_t ux_Ping( int32_t l_SocketReturn, ip_addr_t *x_IPAddr )                                 //pingske leggen
-{
-    int32_t l_Err = 0;
-    int32_t l_PingGrootte = 0;
-    struct icmp_echo_hdr *x_ICMPEchoHdr;
-    struct sockaddr_in x_VerzendAddr;
-    
-    /* NOTE
-    Ik doe ne malloc omdat:
-Ik voor mijn fucntie om een ping request samen te stellen een pointer nodig heb, 
-doordat een pointer geen grootte heeft en slechts enkel een geheugenplaats kan aanduiden 
-gebruik ik dus malloc om deze pointer zijn geheugenplaats toe te wijzen waar nadien 
-al mijn data van mijn ICMP-struct inkom*/
-
-    l_PingGrootte = sizeof( struct icmp_echo_hdr ) + PING_DATA_SIZE;
-    x_ICMPEchoHdr = ( struct icmp_echo_hdr * ) mem_malloc( ( mem_size_t ) l_PingGrootte );          //mallocske doen, is helaas niet toegelaten volgens mistra C :(
-                                                                                                    //mem_size_t afhankelijk van hoe groot, uint16_t of uint32_t is van type size_t => malloc heeft verwacht size_t => unsigned type
-    if( !x_ICMPEchoHdr )                                                                            //heeft ni veel nut dat functie verdergaat en error gooit als Echo failed
-    {
-        return ERR_MEM;                                                                             //Out Of memory errorke geven
-    }
-
-    v_MaakPingRequest( x_ICMPEchoHdr, ( uint16_t ) l_PingGrootte ); 
-
-    x_VerzendAddr.sin_len = sizeof( x_VerzendAddr );
-    x_VerzendAddr.sin_family = AF_INET;
-    inet_addr_from_ipaddr( &x_VerzendAddr.sin_addr, x_IPAddr );
-    l_Err = lwip_sendto( l_SocketReturn, x_ICMPEchoHdr, l_PingGrootte, 0, ( struct sockaddr* ) &x_VerzendAddr, sizeof( x_VerzendAddr ) );
-
-    mem_free( x_ICMPEchoHdr );
-
-    return ( l_Err ? ERR_OK : ERR_VAL );                                        //geen error = 0 => ERR_OK anders ERR_VAL   zelfs als if(l_Err =0) {return ERR_OK;} else {return ERR_VAL;}
-}
-
-/*-----------------------------------------------------------*/
-
-void v_PingOntvang( int32_t l_SocketReturn )
-{
-    char c_Buffer[64];
-    uint32_t ul_FromLen = 0;
-    uint32_t ul_RecvLen = 0;
-    struct sockaddr_in x_OntvangAdres;
-    struct ip_hdr *px_IPHdr;
-    struct icmp_echo_hdr *pux_Echo;
-    ip_addr_t x_RecvAddr;
-    
-    ul_RecvLen = lwip_recvfrom( l_SocketReturn, c_Buffer, sizeof( c_Buffer ), 0, ( struct sockaddr* ) &x_OntvangAdres, ( socklen_t* ) &ul_FromLen);                 //word gebruikt om te kijken vanwaar de data komt, na oproep heeft deze dus een waarde
-    
-    while( ul_RecvLen > 0 ) 
-    {
-        if( ul_RecvLen >=  sizeof( struct ip_hdr ) + sizeof( struct icmp_echo_hdr ) );
-        {        
-            inet_addr_to_ipaddr(&x_RecvAddr, &x_OntvangAdres.sin_addr);
-            
-            px_IPHdr = ( struct ip_hdr * ) c_Buffer;
-            pux_Echo = ( struct icmp_echo_hdr * ) ( c_Buffer + ( IPH_HL( px_IPHdr ) * 4));
-            
-            if( ( pux_Echo->id == PING_ID ) && ( pux_Echo->seqno == htons( us_PingSequenceNummer ) ) )                  //matchen van data, byte order naar netwerk byte order
-            {
-                PING_RESULT( ( ICMPH_TYPE( iecho ) == ICMP_ER ) );                                                      //ping resultaat processen
-                return;
-            } 
-        }
-        
-        ul_RecvLen = lwip_recvfrom( l_SocketReturn, c_Buffer, sizeof( c_Buffer ), 0, ( struct sockaddr* ) &x_OntvangAdres, ( socklen_t* ) &ul_FromLen );
-    }
-    
-    PING_RESULT( 0 );                                                                        //ping resultaat processen
-}
-
-/*-----------------------------------------------------------*/
-
-uint32_t ul_Ping( ip_addr_t *x_PingTarget )
-{
-    int32_t l_SocketReturn = 0;                                                                //vooral om te kunnen debuggen binnen LWIP, sockets.c ... -1 on fail
-    uint32_t ul_TimeOut = 0;
-    
-    l_SocketReturn = lwip_socket( AF_INET, SOCK_RAW, IP_PROTO_ICMP );
-    ul_TimeOut = PING_RCV_TIMEO;
-
-    if( l_SocketReturn  > -1 ) 
-    {
-        lwip_setsockopt( l_SocketReturn, SOL_SOCKET, SO_RCVTIMEO, &ul_TimeOut, sizeof( ul_TimeOut ) );
-
-        //ip_addr_t x_PingTarget = { 0x08080808 };                                              //Google DNS server, uptime 99.9% => vrij betrouwbaar om naar heen te pingen. Behalve in landen zoals DPRK
-           
-        if ( ux_Ping( l_SocketReturn, x_PingTarget ) == ERR_OK ) 
-        {
-            v_PingOntvang( l_SocketReturn );
-        } 
-        sys_msleep( PING_DELAY );
-        return 0;
-    }
-    else
-    {
-        return 1;
-    }
-}
--- a/ping.h	Thu Jan 26 10:40:35 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-#ifndef _PING_H_
-#define _PING_H_
-
-#include "lwip/opt.h"
-#include "lwip/mem.h"
-#include "lwip/raw.h"
-#include "lwip/icmp.h"
-#include "lwip/netif.h"
-#include "lwip/sys.h"
-#include "lwip/timers.h"
-#include "lwip/inet_chksum.h"
-#include "lwip/sockets.h"
-#include "lwip/inet.h"
-
-#ifndef PING_RCV_TIMEO                              //ping timeout... geen antwoord binnen deze tijd => timeout request
-#define PING_RCV_TIMEO 1000
-#endif
-
-#ifndef PING_ID
-#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? :)
-#endif
-
-#ifndef PING_DATA_SIZE                              //grootte payload: "random" data die ook gematched moet worden in het antwoord
-#define PING_DATA_SIZE 32
-#endif
-
-#ifndef PING_DELAY                                  
-#define PING_DELAY     500
-#endif
-
-#ifndef PING_RESULT
-#define PING_RESULT(ping_ok)
-#endif
-
-/*-----------------------------------------------------------*/
-
-uint32_t ul_Ping( ip_addr_t *x_PingTarget );
-void v_MaakPingRequest( struct icmp_echo_hdr *x_ICMPEchoHdr, uint16_t us_Lenght );
-void v_PingOntvang( int32_t l_SocketReturn );
-err_t ux_Ping( int32_t l_SocketReturn, ip_addr_t *x_IPAddr );
-
-static uint16_t us_PingSequenceNummer;
-
-/*-----------------------------------------------------------*/
-
-#endif