Results 1 to 5 of 5

Thread: Bluetooth low energy private service support

  1. #1
    Join Date
    Aug 2016
    Posts
    14
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Bluetooth low energy private service support

    As per the examples provided on the Qt website, UUIDs of the adopted services can be used, however, is it possible to search a private service on the basis of UUID?
    Below is the snippet of the code that is used to access the heart rate service:
    void HeartRate::serviceDiscovered(const QBluetoothUuid &gatt)
    {
    if (gatt == QBluetoothUuid(QBluetoothUuid::HeartRate)) {
    setMessage("Heart Rate service discovered. Waiting for service scan to be done...");
    foundHeartRateService = true;
    }
    }

    Is it possible to replace HeartRate with another private service, if yes, then could anyone provide the steps to achieve the same.
    Last edited by user03; 19th August 2016 at 21:17.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Bluetooth low energy private service support

    What kind of information do you have?

    QBluetoothUuid has plenty of constructors, doesn't any of them match what you have?

    Cheers,
    _

  3. #3
    Join Date
    Aug 2016
    Posts
    14
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Bluetooth low energy private service support

    I have the UUID of the service and the characteristic. Could you please illustrate the same using the existing constructor or provide some information about the relevant constructor to be utilised.
    Thank you.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Bluetooth low energy private service support

    If you have the UUID as a string then I guess the obvious place to start would be:
    Qt Code:
    1. namespace {
    2. QString const privateServiceUUID("b3deffdf-5346-4b50-ab23-6cb32cc56bcc");
    3. }
    4.  
    5. void HeartRate::serviceDiscovered(const QBluetoothUuid &gatt)
    6. {
    7. if (gatt == QBluetoothUuid(privateServiceUUID)) {
    8. setMessage("Heart Rate service discovered. Waiting for service scan to be done...");
    9. foundHeartRateService = true;
    10. }
    11. }
    To copy to clipboard, switch view to plain text mode 

  5. The following user says thank you to ChrisW67 for this useful post:

    user03 (21st August 2016)

  6. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Bluetooth low energy private service support

    Quote Originally Posted by user03 View Post
    I have the UUID of the service and the characteristic.
    You already wrote that, but how do you have the UUID, which datatype.
    As a string? As a QUuid?

    Quote Originally Posted by user03 View Post
    Could you please illustrate the same using the existing constructor
    You are not seriously asking on how to pass arugments to constructor, are you?

    Cheers,
    _

Similar Threads

  1. Replies: 7
    Last Post: 22nd August 2016, 17:35
  2. Replies: 2
    Last Post: 17th May 2016, 11:33
  3. Bluetooth Low Energy
    By flemingp in forum Newbie
    Replies: 0
    Last Post: 4th May 2016, 21:01
  4. Bluetooth feature support on Windows 7
    By saraswathi in forum Qt Programming
    Replies: 0
    Last Post: 15th February 2016, 09:33
  5. Bluetooth - support question
    By Talei in forum Qt Programming
    Replies: 0
    Last Post: 16th January 2013, 06:56

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.