I am more of a hardware person than software so I'm looking for some help. I am modifying the lowenergyscanner example project so I can write to a custom characteristic. The example project is able to find our device (I am currently running this on Mac OS), find the services, and then if I select our custom service it is able to find all of the characteristics.

I've searched and found some posts on the internet but I have not been successful in writing to our device. In device.cpp I have added:

Qt Code:
  1. //GI new Code
  2. // Write to motor
  3. const QLowEnergyCharacteristic link = service->characteristic(QBluetoothUuid(Device_UUID_Motor_Characteristic));
  4. if (service->state() == QLowEnergyService::ServiceDiscovered){
  5. service->QLowEnergyService::writeCharacteristic(link,QByteArray::fromHex("01501000"),QLowEnergyService::WriteWithoutResponse);
  6. }
  7. //End GI Code
To copy to clipboard, switch view to plain text mode 

In device.h I added the following constant. I tried both with and without the {}

Qt Code:
  1. const QString Device_UUID_Motor_Characteristic = "{00010002-0000-1000-8000-00805F9B0421}";
To copy to clipboard, switch view to plain text mode 

I am able to debug the app and depending on where this code is placed it will execute but it does not activate the motor (the code sequence will activate the motor and then stop it after a short period)

For now I just want to write 0x01 0x50 0x10 0x00 to the Motor characteristic which has a UUID of 00010002-0000-1000-8000-00805F9B0421 and is part of our custom service which has a UUID of "00010000-0000-1000-8000-00805F9B0421"

I have been able to use BLE apps on a mobile phone and successfully written this to our board but I have not been successful with this Qt.

Ideally once I have performed this I would like to modify the app to directly connect to our board using our board name and then issue this command so I can verify that the board is working.

Thanks in advance for your help.

George