Total Remake of Communication Protocol

Use generateDataToSend to send data to the connected device. Login
activity updated accordingly.