Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to echo directly from dynamic input
Forum Updated to NodeBB v4.3 + New Features

how to echo directly from dynamic input

Scheduled Pinned Locked Moved Solved General and Desktop
22 Posts 4 Posters 3.1k Views 2 Watching
  • 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.
  • J jsulm
    24 Oct 2019, 06:19

    @Mijaz OK, that means you want to write to /sys/bus/iio/devices/iio:device1/out_altvoltage1_TX_LO_frequency file, because

    cd /sys/bus/iio/devices/iio:device1/
    echo 111111 > out_altvoltage1_TX_LO_frequency
    

    does exactly that.
    Then simply use QFile to write:

    QFile f("/sys/bus/iio/devices/iio:device1/out_altvoltage1_TX_LO_frequency");
    if (f.open(QIODevice::WriteOnly | QIODevice::Text)) {
        f.write(ui->lineEdit_2->text().toLatin1());
        f.close();
    }
    
    M Offline
    M Offline
    Mijaz
    wrote on 24 Oct 2019, 12:30 last edited by Mijaz
    #21

    @jsulm
    Now, If I want to update two different register (out_altvoltage0_TX_LO_frequency and out_altvoltage1_TX_LO_frequency ) with same value.
    The how can execute code using single QFile .
    I tried like follows but not worked:

    QFile f("/sys/bus/iio/devices/iio:device1/out_altvoltage0_TX_LO_frequency | out_altvoltage1_TX_LO_frequency");
    if (f.open(QIODevice::WriteOnly | QIODevice::Text)) {
    f.write(ui->lineEdit_2->text().toLatin1());
    f.close();
    }

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 24 Oct 2019, 14:38 last edited by
      #22

      Hi,

      You can't open two files at the same time like that. You can use a loop and open one after the other.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      21/22

      24 Oct 2019, 12:30

      • Login

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