EE458 – Embedded Systems Programming Project 7: Network Programming

advertisement
EE458 – Embedded Systems Programming
Project 7: Network Programming
Part I
Write a TCP server that returns the current time and date. The server should monitor
TCP port 100. The server will accept two commands from a network client. The gt
command will return the current time to the client and the st command will set the time.
you can connect to the client using SimpleClient or telnet (in PASSIVE mode). An
example session might look something like this (user entered text is shown in bold):
SimpleClient 192.168.100.2
st 4/20/2015 14:30:45
gt
4/20/2015 2:31:10 PM
gt
4/20/2015 2:45:24 PM
100
In this session a connection is made to the Netburner board and the user sets the time on
the board. (This only needs to be done once, but must be done after every reboot of the
board. Subsequent connections should not need to issue the st command.) Note that
military time notation is used to set the time while regular notation (AM/PM designation)
is used when reporting the time. The server needs to handle only one connection at a
time. Note: The Netburner has an on-board real-time clock, I suggest using the RTC
library functions (see chapter 19 of the Runtime Library reference) to interface with the
real-time clock.
Part II
Create a new project that extends the time server in the previous part to handle multiple
simultaneous connections via the select() function.
You will receive a maximum grade of 85% if you complete only Part I. If you complete
both Parts I and II your maximum grade is 100%.
Submit your source code and your *_APP.s19 file in a zip or tar archive by email to
richardson.tony@gmail.com. In the email subject line use “EE458 Project 7 – Your
Name”.
Download