// ------------------------------------------------------------------------- // UartManagerCL::scan // ------------------------------------------------------------------------- // Regarde ce qui est connecte sur les ports non ouverts // ------------------------------------------------------------------------- void UartManagerCL::scan(UartInfo infos[UART_PORT_NBR]) { for(int i=0; i<UART_PORT_NBR; i++) { infos[i].id = UART_NONE; if (uartListByPort_[i] != NULL){ continue; } Uart uart; if (uart.open((UartPort)i)) { uart.ping(); infos[i]=uart.getInfo(); if (infos[i].id != UART_NONE) { LOG_DEBUG("Port %d: %s is connected\n", i, infos[i].name); } else { LOG_DEBUG("Port %d: no device\n", i); } uart.close(); } else { LOG_DEBUG("Port %d: cannot be open... It is probably used by another application\n", i); } } }