julioterra/Arduino_Gateway — Issue #7: Requesting data from multiple Arduinos concurrently
Author: julioterra
Created: 2012-01-12 05:46:22+00:00
State: open

The make_request method from the Controller class needs to be updated so that it can concurrently make requests from several different devices at the same time. Here is a brief overview of what needs to happen in this method:
1. initialize a timer object to ensure that connection requests timeout if no response received within a predefined window
2. create a response array where data raw response data from each device can be saved
3. create an array that will hold the threads for each Arduino request
3. iterate through the array, create a new thread for each request and add them to the threads array
4. in each thread make a request from the Arduino and save the results in the responses array
5. once all responses have been received send the responses array to the process_response method
6. if timeout time has been reached, kill all threads and send responses array to the process_response method