Question: Please complete the following steps to complete the network chat lab: Configure your RPi to use DHCP and get an address automatically. Use the ifconfig

Please complete the following steps to complete the network chat lab:
Configure your RPi to use DHCP and get an address automatically. Use the ifconfig command to get the address that is assigned by the DHCP server located near the lectern at the front of the lab. The IPv4 address should be 192.168.1.x. Please note the value x each time to start up your hardware in the lab. Others will need your full IPv4 address for their chat application to contact your RPi.
Create your application in a file called lastname_netid_chat.c, following the requirements in the General Section. Build the project with the udp3.c and kbhit.c to make sure you are able to proceed.
Add code to open a local listener port so you can receive messages from other users, following the requirements in the Listener Port Startup Section.
In this peer-to-peer application, the program enters a loop that:
a. Calls kbhit() to see if a key has been hit on the local keyboard of the RPi.
b. If a key has been hit, use fgets() to read in a string from file "stdin".
c. After fgets() returns, take the string from fgets and send the string to the remote port using sendUdpData() following the requirements in the Sending UDP Messages Section
d. If "QUIT" was returned at the start of the string returned by fgets(), exit the loop and close the listener port following the requirements in the Shutdown Section
e. Attempt to receive a message from the remote port using receiveUdpData() following the requirements in the Receiving UDP Messages Section
f. If data has been received, print the data in the right column
g. If "QUIT" was received, exit the loop and close the listener port following the requirements in the Shutdown Section
h. Repeat a-g until the program exits
Note that if a message arrives while you are typing, you will need to press ENTER on the keyboard to send that message to the remote device.
Please complete the following steps to complete

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!