Results 1 to 3 of 3

Thread: running linux command on remote machine using tcp/ip in Qt

  1. #1
    Join Date
    Apr 2011
    Location
    Hyderabad
    Posts
    86
    Thanks
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default running linux command on remote machine using tcp/ip in Qt

    Hi,

    I have to build a gui based application in qt.
    In which, I have to run/execute some linux-command(like "ls", "ps" etc) on remote machine(pc or other embedded device)
    connected by ethernet or any communication media(gsm/gprs, wifi etc).
    And after successful execution of these command i have to redirect output of these command to host pc so that i will
    display it on my gui.
    We have to use TCP/IP, and both host and remote system is linux-based.

    I am able to send the command to remote system, but stucking there to run/execute that command.
    for running command i am using "system" call. but not able to get it.

    please anyone gudie me how to run command on remote system and redirect output to host system.

    i am using QTcpSocket and QTcpServer classes, for communicating.
    My first priority is on through ethernet.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: running linux command on remote machine using tcp/ip in Qt

    Assuming your remote program is using Qt (since you are posting into a Qt forum), use QProcess to run the command.

    If you have program that require a controling terminal, then there's a library for that as an addon: http://inqlude.org/libraries/kpty.html

    Cheers,
    _

  3. #3
    Join Date
    Apr 2011
    Location
    Hyderabad
    Posts
    86
    Thanks
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: running linux command on remote machine using tcp/ip in Qt

    hi, anda_skoa

    Thanks for your suggestion, i am able to do with QProcess.

Similar Threads

  1. Replies: 0
    Last Post: 8th August 2012, 17:49
  2. Commnication between two seprate application running on same machine through D-Bus.
    By savaliya_ambani in forum Qt for Embedded and Mobile
    Replies: 7
    Last Post: 1st July 2010, 11:20
  3. installing the Packages in remote machine Simulator
    By Yeshwin in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 21st February 2009, 15:06
  4. Replies: 3
    Last Post: 5th February 2008, 06:32
  5. Mozilla/Firefox remote command
    By larsli in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2007, 08:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.