[Closed] Ip address setting using Qt application



  • 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



  • You already "started a topic":http://developer.qt.nokia.com/forums/viewthread/9670/ on this recently. Please continue the discussion there. I am closing this topic.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.