SDL2 keypresses over SSH - c++

I have an SDL2 application that I launch over SSH and I would like to have it process text input over the SSH connection. Is it possible to have the SSH connection show up as SDL_TEXTINPUT?
Additional Details / Requirements:
I'm open to alternate solutions. This just seemed like it could be an easier option than trying to create a multi-threaded application to monitor stdin (I'm kind of a beginner with c++...)
The idea is to use the text input to issue commands to cycle through states and interact with hardware (UART) connected to the remote system.
The remote system is essentially a headless raspberry pi (SDL renderer pixels are memory mapped to /dev/fb1 for display)
A keyboard can be directly connected to the remote system for input, but there is no console display which makes launching the application and printing debug messages problematic.
I'm writing this in c++

Related

Need to duplicate/fork or redirect entire system console output for all apps and the system/kernel messages

I am developing the test suit in C++ for the PDA-like device running Linux.
While working with development kit I have access to a serial console with system output. Eventually my software should be used on closed box with no console output and Ethernet connection available. I would like to be able to duplicate the entire console output (not only my code output, that would be easy). Any suggestions?
The SSH to the device is working, but apparently it only echoes the commands and responses I send from the remote console. I would like to sniff in on all system output from previously started applications and kernel.

Difference between starting the process directly on machine and from remote desktop connection

I want to know the difference between application started directly on the machine and the application started using remote desktop connection.
Whether both the application are same or will have different privileges.
For example, i had an opengl based application which take higher version of opengl 3 or 4 when started directly on the machine. But when i start the same application from remote desktop connection, it takes only base opengl version 1.1.
One more observation is:
We have a service application which will launch a graphics (OGRE based) application based on request. Request is set from client using web-socket communication.
When we start this service directly in a server, it works fine. But when this service is started from a RDP connection, the graphics application is crashing when user sends request after RDP connection is closed.
IT works if I keep the RDP connection on.
It may loose the graphics driver when you are logged in through RDP.
If you look in the launch the Ogre 'setup' dialog when RDP is enabled it will not list the graphics card - but a different 'RDP driver'.
Also - when you log on\off it might 'reset' the device (since the RDP graphics driver is enabled\disabled) causing your window get loose the device, and then crash.
One way to get around all this - is to use a VNC (for example tightvnc), this does not cause the issues that standard RDP does, since it does not use the RDP graphics drivers and such.

How do I send commands from a Windows GUI to a Linux machine over the network?

Some Background -
I have written a C program on the TS-7800 (running Debian Linux) which I access through Putty. The program is essentially in charge of controlling DAC/ADC's in order to modify the state of a memory element.
My next task is to develop a GUI for that program. The GUI is built using Microsoft Visual Studio 2010 in C++. I've made most of the GUI and simply need a way to send the data which I collect to the Linux machine.
My first attempt was to invoke a connection with Putty through command line from the GUI, and then try to send various commands through that Putty connection. The drawback here is that once I invoke a connection with Putty using the command putty username#192.168.1.50, it is done in the foreground, rather then hidden in the background, and I don't know how to continue entering text/commands from the GUI into Putty once it has been launched.
My Question -
How should I go about connecting my GUI on Windows to the program on the Linux machine? Is my attempt with Putty a step in the right direction, or should I be taking a different approach - possibly Cygwin?
Thank you in advance for any help - this is my first post on stackoverflow so please forgive me if I've mistakenly overlooked some detail or if I did not abide by proper etiquette.
You have to follow some protocol to interact with the server. Then your GUI needs to follow that protocol to send commands to the server.
Probably, you are talking about SSH connection with server. There are a lots of SSH Client library available in windows. You can use one in your GUI to interact.
Try taking a look at Boost ASIO. It's a very solid asynchronous IO library included in boost. (You will need to build it however).

libssh2 remote ncurses application

I'm in the initial stages of designing an app that will connect to a remote server via ssh using the libssh2 library. One of the features I would like to have is the ability to be able to interact with a remote ncurses application. I understand that when connecting with libssh2 and executing a command, I will be returned a string that represents the output of the command on the remote system. But what if that command launches an ncurses (graphical) application. What output would I get back?
So long as you're requesting a pty on the other end, your ncurses programs will be sending you lots of control sequences dictating cursor positions, colors, etc... What you're going to end up doing is writing a terminal emulator in order to interact with ncurses applications, so you might do some searching for vt100 terminal emulation or something of the sort.

Qt::How to identify/detect if the system is Remotely access by other system in Linux

I am developing an application in ubuntu to access the other system remotely through QT. Both system are running some Qt applications.I want to check / make changes to the other system remotely using Qt programming.
I want to add a pushbutton (as a quit screen) at remote system that should be "Enable only if the system is remotely accessed", so that i can use it to close the remote access screen.
Is there any way through programming we can get the status whenvever it is remotely accessed???
I got through some solutions on forum but they are particularly for Windows. I am looking for some solution in Linux.
Please provide suggestion/links so that i can overcome this issue.
Thanks in Advance
If you are using the remote display abilities of the X11 protocol, you could check the value of the DISPLAY variable. For a local connection, it usually starts with :0; for a distant connection, it contains the hostname of the displaying server. For a connection thru ssh -X it could be localhost:10 and ssh is also setting SSH_CLIENT and SSH_CONNECTION environment variables.
Otherwise, you should define better what is a remote access for you (i.e. explain more your application). Your Qt application may also be e.g. some TCP/IP server. Perhaps the getpeername(2) syscall might be relevant.
If you just are interested in what remote connections flow into your box (independently of a particular application) you could read (e.g. using popen) the output of command netstat -a -n or use some /proc/net/ directory.