
details
This project introduces a self-written library that implements POSIX sockets, also called Berkeley sockets, for ST Nucleo + Ethernet Shield Setup. So far, it allows for TCP client/server connections and UDP client/server communication using WIZnet W5100 chip resources. The interface is taken from POSIX.1-2008 standard that can be compiled and run on both Nucleo board and Linux PC without changing a line of code.
Parts: Nucleo board, Ethernet Shield
More detailed information on the library functionalities are written below:
- Generic socket management:
socket()
andclose()
for socket creation and destruction - Generic socket communication:
send()/sendto()/write()
to transmit andrecv()/recvfrom()/read()
to receive using TCP and UDP sockets. - TCP client functions:
connect()
to initiate a connection with a server. - TCP server functions:
bind()/listen()/accept()
to manage server-side connections on a chosen port. - UDP client functions:
connect()
andrecvfrom()/sendto()
for connectionless communication. - UDP server:
bind()
andrecvfrom()/sendto()
for connectionless communication. - Miscellaneous:
stdin
,stdout
andstderr
are directed to the serial port seamlessly.
4 connections at the same time can be made with W5100 because of its internal resources.
The next POSIX functionalities are non-blocking option and select()/poll()
functions.
COMMENTS