How can I send commands to camera by usb (the connector) in c++ qt?

Viewed 33

I'm new in that language(C++ QT) and I want to sent command to the camera like: zoom(25) and etc. the camera knows the commands, I just need to send ang get a reply.

my code is:

void SendCommandByUsb(QString fileName, QString line )
{

    QProcess process;
    process.startDetached(fileName);
    process.waitForStarted();
    QProcess *system_command = new QProcess();
    system_command->start(line);
    system_command->waitForFinished(500);
    system_command->write("ls -a\n");
}

its do nothing. line- the command. can someone help me??? maybe all my code wrong... Ill be happy for help. thank

0 Answers
Related