TASS Belgium / Mbed 2 deprecated UDP_Receive_Test

Dependencies:   PicoTCP lpc1768-picotcp-eth mbed-rtos mbed

You are viewing an older revision! See the latest version

Homepage

This is an example project used to test the UDP Receiver from the PicoTCP Stack.
The test has the following components :
- A python script that sends 1000 packets (each of 1024 bytes) every second
- The receiver (the mbed board running PicoTCP).
At each 20 seconds the receiver measures how many packets were received

The python script used

import socket
import fcntl, os
import errno
import random, string
from time import time, sleep

ECHO_SERVER_ADDRESS = "192.168.100.12"
NUMBER_OF_SECONDS = 20
LOCAL_SERVER_PORT = 2327
MEGA = 1024*1024.
LEN_PACKET = 1024
data = ''.join('\0' for _ in range(LEN_PACKET))

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM,socket.IPPROTO_UDP)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(('', LOCAL_SERVER_PORT))

print "Started sending data...."
print "Time : %d " % time()

while True:
	start = time()
	s.sendto(data, (ECHO_SERVER_ADDRESS, LOCAL_SERVER_PORT))
	sleep(0.001);

This test is based on the following libraries :

Import librarylpc1768-picotcp-eth

A PicoTCP driver for the lpc1768 mbed board

Import libraryPicoTCP

Free (GPLv2) TCP/IP stack developed by TASS Belgium

Import librarymbed-rtos

Official mbed Real Time Operating System based on the RTX implementation of the CMSIS-RTOS API open standard.


All wikipages