Auto pilot mode of application [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Hey Guys I am working on Gateway Simulator.
here gateway simulator is connected with the camera.gateway respond when user sends command.
command can be like streaming video or status of the sensor associated battery information etc.There is data center also which will forward the user request to gateway.
There some information which gateway also send to the user or data center with out any request from the user or data center.like battery status down,sensor remove etc etc.
Since this simulator will be used by the developer/QA team to simulate the gateway.they want it it to run in auto pilot mode/pre-scripted instructions mode as well.
I wanted some input from you guys o this.I wanted to know some the widely used approach to address this issue.
any link/suggestion would be fine.This gateway simulator needs to be written ic++ for both linux and windows paltform.

It depends on how (network, console, GUI, ...) the user is sending commands. If it's network or console, writing a script that will feed the command should not be too hard in any language, but there is a tool called expect, built on top of tcl, that's specifically designed for this task. Alternatively if you know perl or python and don't want to learn tcl, you can use the perl Expect module or python pexpect package (windows version).
If the commands are given through a GUI, there is some tooling to automate even that in LDTP. It should work with Gtk+ GUI and I am not sure how far it is with Qt (or whether KDE has something similar).

Related

Firebase C++ realtime database connection lost on Windows [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I have been using Firebase C++ SDK's Auth and Realtime Database (for Windows) in a simple test application. After a succesful authentication every new message (node) is being arrived from the cloud within just a few millisecs until the following happens:
I leave my computer untouched in idle state.
Due to the energy settings it goes to sleep after 10-15 minutes. (don't want to change the settings!)
After I wake it up again the network connection is re-established for all other background applications (like Skype, Outlook etc)
It seems Firebase's connection is NOT re-established.
Is there any built-in function to get notification from Firebase when it's lost the connection and try to re-login, re-connect to the database either automatically or manually?
I guess it has a background keep-alive connection to check network status but I couldn't get any useful information about it. The documentation says it can keep everything synced even in offline mode.
any built-in function to get notification from Firebase when it's lost the connection[?]
For that you'd attach a listener to the virtual .info/connected node, as shown here: https://firebase.google.com/docs/database/android/offline-capabilities#section-connection-state. Somehow this section is missing from the C++ documentation, which is why I linked you to the Android version.

Can i take the screen capture of a remote machine if knew the IP address? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Is it possible to take the screen capture of the desktop of a remote machine using C++? We were able to take the screen capture of the current machine using window APIs and save to local as bitmap. If the knew the IP address of a remote machine, is this possible ?
[Edit]
Actually ours is a server-client model where the C++ back-end code will be running in the server. The clients will be accessing the server through REST calls and viewing the data. We had a requirement to take the capture of the client screen and save as image. We are facing some technical issues while saving the html content as image. Hence we thought of any other methods to capture the screen. Since C++ has the API to capture the current screen, we thought whether there is any way to capture the client screen from Server side.
Yes, if you install and run software to do this on the remote machine, such that it accepts network packets and send back a copy of the screen content.
No, if you just want to randomly pick a machine without installing software on it [modulo exploitable security bugs in the OS and you also know how to (ab)use them - and even if I knew of such security holes, which I don't, I would certainly not write it as an answer here].

Connect web server to another application [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm interested in how I might send requests from a web server using Python to a constantly running C++ program. Basically users should be able to send "orders" via their browser to the web server. The web server then needs to forward those orders to a constantly running application written in C++. Eventually the C++ program should be able to send order results back to the web server who can forward the results to the user's browser if they're still connected.
I've thought about having the web server record pending orders to a database which the C++ program polls for changes. That doesn't seem very efficient though. I believe it will have issues with to many users. Is there some method/technology that is typically used for this type of situation?
You have a few options;
1. API
This is more the traditional option, you have some form of API built into your website, and your C++ program contacts the API to receive and update orders. You would probably want to use this if your C++ program isn't hosted on the same server. However you will need to ensure you keep the API secure from outside parties accessing it to fake orders etc.
2. Shared file or database
If your application is running on the same server you could have both programs access a database or flat-file.
3. Sockets (TCP)
This method is likely overkill, you have your C++ program act as TCP server and your python program connects to it and sends it the orders as they come in. You should be aware that programming this option would be significantly harder to the previous options, however it provides an instant response that the others don't.
Easy to implement BaseHttpServer on python, use pipe to communicate with c++ process and proxy_pass clients`s requests via web server.

How to test internet application at local computer (windows-7)? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
This application sends data periodically to a server. What I need to do is setup a testing environment on the local developing machine so that I can check the correct packets are being sent in each situation. I thought a good approach would be a server VM set up on the local computer which would receive the packets and respond just like the real thing, but the problem is how do I route the packets of an application running on windows to a VM machine. I don't want to modify my application code. I just want to have windows pass on the packets it receives from the application to the VM or otherwise another application that will do the testing. Is this possible? If not, please let me know about any other solution(s) to this problem.
If you're running a decent VM you should be able to give it an IP address visible from the host, and configure it so that you can run web servers on it, ssh to it, etc.
Look at the networking features of your VM. Or find a tutorial on how to do this, such as this one for VirtualBox:
http://www.tolaris.com/2009/03/05/using-host-networking-and-nat-with-virtualbox/
Well it's some kind of a hack but you can use ARP Poisoning (man in the middle attack) to sniff packets. There is a tool named Cain & Abel which can do this for you. I've used this tool to sniff packets between two non-pc machines. Use at your own risk and if your anti-virus tool alerts, know that the tool has no virus but what it does is detected as one.
Edit: Please note that my approach doesn't require a VM server.

Has anyone used Facebook Scribe? (the tool for logging everything) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How does it work? (Explain it in terms of server, writes, GETs, values, whatever).
DOes it work with Win32 apps?
I'll try to explain:
There is an application, with thrift
class/interface. When event that you
want to log occures, you send
message to the
Server, which collect logs from many
sources (application, server logs,
etc)
And then server decides what do
do with it: generate visualization,
send over tcp/ip, store in a file,
nfs, hdfs, you decide.
Server and client can be the same
app or machine, or this log data can
be sent from client over internet.
Definitely works with win32 apps.
It Works Great.
We're using Scribe to test some message processing.
We're sending Apache logs with Scribe. (Under Ubuntu)