Unsolved Signal Handling
-
Hi all,
I want to know is it possible to catch a signal emitted from Linux terminal, through our Qt or qml application.? if yes, how can i do that ?
For ex, there is a simple code running in the background in linux terminal which will be passing a simple string through signal, i want to catch that and print the signal through my qt or qml application.
Thanks -
No, it is not. Signal/slot mechanism is really just a wrapper for a method call inside a process. You could use QProcess to capture the terminal application's standard output, if you start it from your application. (Or alternatively, use any standard Linux C++ code for that -- you should be able to find many examples of that.)
-
Hi,
What exact signal do you have in mind ?
-
@SGaist
Hi,
I want to create an api which can connect to the embedded board's lower layer through which i want to get the output of the lower level code to my application UI.For ex, i have a c code which will be running continuously at the board level and giving output, i want to create an api which will connect to this code and whenever i want i can take the output and display it in my application UI or make some changes based on that output in my UI.
-
@Naveen_D hi , do you want to communicate between process or within threads.
-
@yuvaram Hi
Actually i want to know which will be better, I am new to it, Can you elaborate and tell how does it work. -
@Naveen_D
Signal & Slots is applicable within a process.
Inorder to communicate between processes, use IPC mechanism.I suggest, use your C code in worker thread and signal to main thread to update in UI.
-
What kind of board is that ?
What will you extract from it that you want to make available to other application(s) ?
How are you getting the data from that "lower level" ?
-
What kind of board is that ?
iMX-6 board.
What will you extract from it that you want to make available to other application(s) ?
I have an code running continuously in the backend, from which i want to read the output and based on that make some changes in my application UI.
How are you getting the data from that "lower level" ?
it will be giving the output in the terminal, from which i want to read.
Thanks
-
What is that backend ?
What are you reading from the board ?
-
What are you reading from the board ?
I have an c code for IoT(Internet of things) which will be continuously running in that board and which gives output in the terminal, that i want to read through my program and make changes in my UI
-
Then, why not integrate that C code directly in your application ?
-
@SGaist Ya i can do that, in fact at present i hav integrated with my HMI, but i have a requirement that HMI layer should only have the UI part and should have API call for functions like ioT, music play etc.
-
Do you mean contact a REST service to get the data ?
-
@SGaist Yes sir, like that only.
-
Then why do you need to catch signal from the terminal if you have to contact a web service ?
-
@SGaist No actually i don't want to call a web service, i just want to get output from the code running within the iMX-6 board. so that i can call it through one of the API's from my HMI. So that i do not need to integrate the same with my HMI.
-
Hi...i am a new user here. As per my knowledge you could use QProcess to capture the terminal application's standard output, if you start it from your application. Signal & Slots is applicable within a process.Inorder to communicate between processes, use IPC mechanism.