Question: Hi, I need to create a program as described in the images above. The program needs to be written in c++. No idea where to

 Hi, I need to create a program as described in theimages above. The program needs to be written in c++. No idea

Hi, I need to create a program as described in the images above. The program needs to be written in c++. No idea where to start, would appreciate any sort of help, thanks!

Task 4 - Thread Communication 10 Marks This is NOT a Fitchfork task! In this task you are required to create various threads using the POSIX Pthread API. These threads can receive data from the main thread via a struct For this task you will have to write a C/C++ program that simulates an IoT (Internet of Things) controller. Any number of IoT devices can connect to this controller and report their status. The controller will thus have a complete picture of all the IoT devices that have reported to it, the current status of those devices and when last the status changed/updated To simulate the messages sent by the various IoT devices, a text file called device data.txt is provided (same as for practical 1) that contains a number of device messages sent, with each line representing a distinct message. Each message contains a device name, a status value and a Unix epoch value which are separated by commas. Your C/C++ program will read this file line by line. It will separate the message into device name, status value and epoch value and store it in a suitable struct. For each line, a new thread will be created. The ID of the created thread will be added to the struct which will then be sent to the new thread. The thread will convert the epoch value to a date and time string and print all the elements of the struct. Implementation The following steps show how your program should work 1. Your program should first request the name of a IoT device data input file. 2. It should then open the provided IoT device data input file and read the input file line by line

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 Databases Questions!