Attempt ot change the size of the buffers used by the OS
| 456 | |
| 457 | // Attempt ot change the size of the buffers used by the OS |
| 458 | void SerialIO::setBufferSizes(const unsigned int rxSize, const unsigned int txSize) { |
| 459 | if (!isPortOpen()) return; |
| 460 | |
| 461 | #ifdef FTDI_D2XX_AVAILABLE |
| 462 | if (m_ftdi.isOpen()) { |
| 463 | // Larger than this size actually causes slowdowns. This doesn't work the same as below. Below is a buffer in Windows. This is on the USB device I think |
| 464 | m_ftdi.FT_SetUSBParameters(rxSize < 256 ? rxSize : 256, txSize); |
| 465 | return; |
| 466 | } |
| 467 | #endif |
| 468 | |
| 469 | #ifdef _WIN32 |
| 470 | SetupComm(m_portHandle, rxSize, txSize); |
| 471 | #endif |
| 472 | } |
| 473 | |
| 474 | // Open a port by name |
| 475 | SerialIO::Response SerialIO::openPort(const std::wstring& portName) { |
no test coverage detected