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. Implementing bluetooth in program that uses modbus
Forum Updated to NodeBB v4.3 + New Features

Implementing bluetooth in program that uses modbus

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 567 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.
  • E Offline
    E Offline
    Etesravan
    wrote on last edited by
    #1

    Hi,

    I'm fairly new to Qt and I'm currently working on my BSc in automation so I only have about 3 years of beginner experience with programming.

    For my project I need to change a modbus connection in an application with a wireless bluetooth connection. The components are already in place and being set up by someone else, so the only asking for help with the programming part.

    I'm currently trying to copy code from the example "heartrate-game" into my program, but I'm not sure if this is the best solution or if it's even going to work at all. Is there an easy way to implement a bluetooth transfer of a number of normal variables (bools and doubles) in Qt?

    jsulmJ 1 Reply Last reply
    0
    • E Etesravan

      Hi,

      I'm fairly new to Qt and I'm currently working on my BSc in automation so I only have about 3 years of beginner experience with programming.

      For my project I need to change a modbus connection in an application with a wireless bluetooth connection. The components are already in place and being set up by someone else, so the only asking for help with the programming part.

      I'm currently trying to copy code from the example "heartrate-game" into my program, but I'm not sure if this is the best solution or if it's even going to work at all. Is there an easy way to implement a bluetooth transfer of a number of normal variables (bools and doubles) in Qt?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Etesravan Did you read https://doc.qt.io/qt-5/qtbluetooth-index.html?

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

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Etesravan
        wrote on last edited by
        #3

        @jsulm Yes I've read that and the BLE information, but I'm not very familiar with Qt and I'm having trouble getting started with this.

        jsulmJ 1 Reply Last reply
        0
        • E Etesravan

          @jsulm Yes I've read that and the BLE information, but I'm not very familiar with Qt and I'm having trouble getting started with this.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Etesravan You should be more specific with the issue. What exactly do you want to know?
          There are examples in the link I posted - did you check any of them?

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

          1 Reply Last reply
          0
          • E Offline
            E Offline
            Etesravan
            wrote on last edited by
            #5

            @jsulm Thanks for taking the time to answer! Sorry for not being specific, as I said I'm new to Qt and find it difficult to explain.

            I have checked out the "Bluetooth Low Energy Overview" and "Bluetooth Low Energy Heart Rate Game".

            What I'm looking for is a way to implement a variable transfer in an QApplication that is already set up. What do I need to add to the main function to include the BLE, and is there any code that is close to "copy and use" in those examples for a simple transfer?

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kuzulis
              Qt Champions 2020
              wrote on last edited by kuzulis
              #6

              If you want to use modbus over bluetooth, then you can look on 'classic bluetooth' instead of 'low-energy bluetooth'. In that case you can use e.g. QBluetoothSocket or QSerialPort (RFCOMM) to transfer data. But unfortunately you can't use QModbusTcpClient or QModbusRtuSerialMaster (in case of QBluetoothSocket) because it use only QTcpSocket or QSerialPort.

              1 Reply Last reply
              1

              • Login

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