Good evening, my project is to create a desktop application. This application will allow me to communicate from the PC to an stm32 microcontroller via the usb port.
I use the class: QSerialPort available on Qt
I want to know the number of USB port connected on my PC.
Here is my code:
#include <QCoreApplication>
#include <QDebug>
#include <QSerialPort>
#include <QSerialPortInfo>
Int main (int argc, char * argv [])
{
QCoreApplication a (argc, argv);
QDebug () << "Number of serial ports:" << QSerialPortInfo :: availablePorts (). Count ();
Return 0;
}
So I plugged my microcontroller stm32f4, an external hard drive with a usb cable ... My problem is this: When I run the program under Qt there is no compilation problem but the result of the debug shows me the following line: "Number of serial ports: 0" Usb ports connected.
Following the activation of bluetooth or the insertion of a 3g key there is detection of these ports, but the others remain undetected.
I didn't understand where the mistake comes from !!