Implemented the skeleton of the thread for device communications.