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. Not able to send strings.

Not able to send strings.

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 527 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.
  • V Offline
    V Offline
    VinQtUser
    wrote on last edited by
    #1

    I'm using Qt (Windows platform) C++ "terminal program" to serially communicate with a micro-controller. I'm able to send only one character at a time as I've used keyPressEvent. Now, I want to send a string such that I get the response only after pressing the return(Enter key). Please help me with this.

    1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Your question was already answered here: http://forum.qt.io/topic/63019/not-able-to-read-data-from-qserialport

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        std::string s;
        std::cin >> s; // Enter the string, press Enter when finished
        QByteArray array (s.c_str());
        serial->write(array);

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0

        • Login

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