Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Closed] Ip address set using Qt application
Forum Update on Monday, May 27th 2025

[Closed] Ip address set using Qt application

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 2.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    prabhuraj
    wrote on 16 Sept 2011, 10:39 last edited by
    #1

    Hi,
    I am working on an embedded project (Linux os running on ARM 9 processor). Qt is used for GUI.
    currently I have to develop an application which can set/reset the Ip address of the device using Qt application. Till now I am able to get the IP address of the device through Qt by using Qprocess and ifconfig etc but I am not been able to change the Ip address.
    Here is the snippet :

    @{
    QString setbuff;
    char* ip_buff = "192.168.2.238";
    setbuff.sprintf("ifconfig eth0 %s netmask 255.255.255.0 up",ip_buff);
    qDebug() << setbuff;

    QProcess *qProc = new QProcess(this);
    

    qProc->start(setbuff);
    qDebug() << setbuff;
    qProc->waitForFinished();
    QString tmp = qProc->readAll();
    }
    @

    The set buff content is showing correctly as : “ifconfig eth0 192.168.2.238 netmask 255.255.255.0 up”
    But when the code is cross compiled and run on the target embedded device, the Ip address is not setting as 192.168.2.238.
    BTW the target device is executing the code in root mode.

    Please help me solve this problem q

    [Edit: added @-tags /Vass]

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on 16 Sept 2011, 11:26 last edited by
      #2

      Closing this topic "too":http://developer.qt.nokia.com/forums/viewthread/9778/. This is the third "topic":http://developer.qt.nokia.com/forums/viewthread/9670/ you opened on this subject. Really, this is not the way to behave here on the forum.

      1 Reply Last reply
      0

      2/2

      16 Sept 2011, 11:26

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved