For your (possibly) future network's course, you will have to detect and analyse the data that are exchanged between two computers through the network (for example using the WiFi). In this exercise, we give you a function modem_read
, to read the data exchanged thanks to the network, with the following prototype :
void modem_read(void *buffer, int *buf_len);
This function fills the supplied buffer with the data captured (an array of char
), and writes the number of bytes written to this buffer in the variable pointed by buf_len
. It can catch up to maximum 256 bytes in a single call. This function is guaranteed to return.