Skip to content

FTDI usb serial open failed #302

@mnswwz

Description

@mnswwz

I used the serial library of version 1.0.1 to open the FTDI USB Serial Device, but it failed. The error prompt shows garbled code.
I use the library like this:

try{
    serial::Serial* m_Serial = new serial::Serial(port, baudrate, serial::Timeout::simpleTimeout(1), serial::eightbits, serial::parity_none, serial::stopbits_one);
    if(m_Serial->isOpen())
    {
          std::cout << "serial open success" << std::endl;
    }
    else
    {
         std::cout << "serial open failed" << std::endl;
    }
}
catch(std::exception& e)
{
    std::cout << "serial open failed of exception: " << e.what();
}
``I gived the parameters like this:
port : /dev/ttyUSB1
baudrate: 2500000
When I debug the code, the prompt showed in the terminal like this: 
"serial open failed of exception: oo/o"
When I used the serial port debugging assistant to connect the serial with the same parameters, it succeed. During the above test, I was clear the assistant was closed.
Before this test, I also tried to use the same library to open the CH341 usb serial device, and it succeeded. I was confused why? Thank you for any help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions