Hello!
I'm using qextserialport for sending data. In my program I have no GUI. The progam will automatic start in the background when the PC is started. I need to set RTS low before shutdown the program. The program will be shutdown when the power turn off. In my testprogram I push x-button in Application Output.
Is it possible to catch some shutdownsignal so I can call
CommPort->setRts(0);
CommPort->setRts(0);
To copy to clipboard, switch view to plain text mode
before the PC is shutdown. It is possible to use another connect for a shutdown signal?
My main program is like, I have deleted some code that I think are irrelevant:
int main(int argc, char *argv[])
{
createDatabaseConnection();
// Initiate all modules
FlexiBlinkRX flexiBlinkRx;
FBtoFLTP FBtoFLTP1;
FilterEngine filterEngine;
smsThread SMSThread;
SMSThread.start();
// Connect all signals between modules
FBtoFLTP1.connect (&flexiBlinkRx, SIGNAL(incommingDataSignal()), SLOT(startTask()));
filterEngine.connect (&FBtoFLTP1, SIGNAL(inputToQueueSignal()), SLOT(checkqFilterQueue()));
// Start executing
a.exec();
SMSThread.quit();
SMSThread.wait();
flexiBlinkRx.CommPort->setRts(0);
return 0;
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
createDatabaseConnection();
// Initiate all modules
FlexiBlinkRX flexiBlinkRx;
FBtoFLTP FBtoFLTP1;
FilterEngine filterEngine;
smsThread SMSThread;
SMSThread.start();
// Connect all signals between modules
FBtoFLTP1.connect (&flexiBlinkRx, SIGNAL(incommingDataSignal()), SLOT(startTask()));
filterEngine.connect (&FBtoFLTP1, SIGNAL(inputToQueueSignal()), SLOT(checkqFilterQueue()));
// Start executing
a.exec();
SMSThread.quit();
SMSThread.wait();
flexiBlinkRx.CommPort->setRts(0);
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks