#include "uart_communication.h"

/*
* Usage: telnet [ip] [port]
* eg.: telnet 192.158.4.1 8080
* To quit: ctrl + +
*           q
*/

int main(void) {
    printf("Starting the loopback application...\r\n");
    
    LFR_UART uartCommunicator;
    uartCommunicator.sendTelegram(-1.0, -0.99, 0.99, 1.0);
    double buffer[4] = {0.0, 0.0, 0.0, 0.0};
    sleep(1);
    if(uartCommunicator.readTelegram(buffer)){
        for(int i = 0; i < 4; i++) {
            std::cout << buffer[i] << " ";
        }
    }
    else {
        std::cout<<"ne";
    }
    return 0;
}