How to add options to "command" ?
-
When I use :terminal I can type in this :
bluetoothctl scan onI can also pass a single char array to my function (command) and it works as expected.
I need to pass "options" to the main command.I have done this before but forgot why and how to actually make the command
same as typed on terminal .char command[32] ="bluetoothctl scan on ";
does nor work - the actual "system call "
expects list of parameters / optionsQP->start("/bin/sh", QStringList() << "-c" << command);'
My poor attempt to solve this did not pass by compiler
char command[32] ="bluetoothctl"; char add[32] = " scan "; char more_add[32] = " on"; // command += "scan "; // command += "on"; command += add; command += more_add; //Iterator next result = BTUL->ProcessCommand(command,verify[1]);
PS I did search for "command" , my past post , but it came empty..
-
When I use :terminal I can type in this :
bluetoothctl scan onI can also pass a single char array to my function (command) and it works as expected.
I need to pass "options" to the main command.I have done this before but forgot why and how to actually make the command
same as typed on terminal .char command[32] ="bluetoothctl scan on ";
does nor work - the actual "system call "
expects list of parameters / optionsQP->start("/bin/sh", QStringList() << "-c" << command);'
My poor attempt to solve this did not pass by compiler
char command[32] ="bluetoothctl"; char add[32] = " scan "; char more_add[32] = " on"; // command += "scan "; // command += "on"; command += add; command += more_add; //Iterator next result = BTUL->ProcessCommand(command,verify[1]);
PS I did search for "command" , my past post , but it came empty..
What is BTUL and how does it work?
If you ask about QProcess, then something like this should work:
QProcess process; process.start("bluetoothctl", {"scan", "on"});
Qt will insert spaces between arguments automatically.