Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Implementing bluetooth in program that uses modbus
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?
@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.
@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?
@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?
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.