Results 1 to 14 of 14

Thread: Error: QBluetoothUuid::mine not found in Qt Android

  1. #1
    Join Date
    Aug 2016
    Posts
    4
    Qt products
    Qt/Embedded
    Platforms
    Windows Android

    Default Error: QBluetoothUuid::mine not found in Qt Android

    Hello
    I am using Qt for Android 5.7 and Qt Bluetooth lib
    I try to compile source code but I met an error as below:

    device.cpp:158: error: 'mine' is not a member of 'QBluetoothUuid'
    const QLowEnergyCharacteristic link = service->characteristic(QBluetoothUuid::mine);


    Please help me. Thanks

  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: Error: QBluetoothUuid::mine not found in Qt Android

    What makes you think that "mine" is a member of QBluetoothUuid=
    Do you have any documentation that says so?

    Cheers,
    _

  3. #3
    Join Date
    Aug 2016
    Posts
    4
    Qt products
    Qt/Embedded
    Platforms
    Windows Android

    Default Re: Error: QBluetoothUuid::mine not found in Qt Android

    Thanks for your reply.
    I read at here:
    https://www.youtube.com/watch?v=E8_5UZWDgMo
    Google Drive Folder: https://goo.gl/3vZBc5


    Added after 5 minutes:


    In WriteCharacteristic examples, open device.cpp, I found "mime" at here:

    const QLowEnergyCharacteristic link = service->characteristic(QBluetoothUuid::mine);
    if(service->state() == QLowEnergyService::ServiceDiscovered) {
    service->QLowEnergyService::writeCharacteristic(link,QByte Array::fromHex("03"),QLowEnergyService::WriteWithR esponse);
    readData(QString("0x03"));
    }
    Last edited by robotden; 23rd August 2016 at 14:29.

  4. #4
    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: Error: QBluetoothUuid::mine not found in Qt Android

    There is no content there as far as I can see.

    Just post the code here?

    Cheers,
    _

  5. #5
    Join Date
    Aug 2016
    Posts
    4
    Qt products
    Qt/Embedded
    Platforms
    Windows Android

    Default Re: Error: QBluetoothUuid::mine not found in Qt Android

    Yes, of course.

    Line 6 from bottom to top in device.cpp:
    Qt Code:
    1. #include "device.h"
    2. #include <qbluetoothaddress.h>
    3. #include <qbluetoothdevicediscoveryagent.h>
    4. #include <qbluetoothlocaldevice.h>
    5. #include <qbluetoothdeviceinfo.h>
    6. #include <qbluetoothservicediscoveryagent.h>
    7. #include <QDebug>
    8. #include <QList>
    9. #include <QString>
    10. #include "service.h"
    11. #include <QLowEnergyService>
    12.  
    13.  
    14.  
    15. Device::Device(QObject *parent) : QObject(parent)
    16. {
    17. discoveryAgent = new QBluetoothDeviceDiscoveryAgent();
    18. connect(discoveryAgent, SIGNAL(deviceDiscovered(const QBluetoothDeviceInfo&)), this, SLOT(addDevice(const QBluetoothDeviceInfo&)));
    19.  
    20. }
    21.  
    22. Device::~Device() {
    23. delete discoveryAgent;
    24. delete m_control;
    25. qDeleteAll(devices);
    26. qDeleteAll(m_services);
    27. qDeleteAll(m_characteristics);
    28. devices.clear();
    29. m_services.clear();
    30. m_characteristics.clear();
    31.  
    32. }
    33.  
    34. void Device::addDevice(const QBluetoothDeviceInfo &info) {
    35. if(info.coreConfigurations() & QBluetoothDeviceInfo::LowEnergyCoreConfiguration) {
    36. DeviceInfo *d = new DeviceInfo(info);
    37. devices.append(d);
    38. qWarning() << "Discovered BLE Device " + d->getName() << "Address: " + d->getAddress();
    39. if(d->getName() == "EX BLE") {
    40. address(QString(d->getAddress()));
    41. }
    42. }
    43. }
    44.  
    45. void Device::startDeviceDiscovery() {
    46. qDeleteAll(devices);
    47. devices.clear();
    48. discoveryAgent->start();
    49. qWarning() << "Starting to Scan.";
    50. //address(QString("Starting to Scan."));
    51. }
    52.  
    53. void Device::connectDevice(const QString &address) {
    54. for(int i = 0; i < devices.size(); i++) {
    55. if(((DeviceInfo*)devices.at(i)) -> getAddress() == address) {
    56. m_currentDevice.setDevice(((DeviceInfo*)devices.at(i))->getDevice());
    57. qWarning() << "Connecting to Device.";
    58. break;
    59. }
    60.  
    61. }
    62.  
    63. qDeleteAll(m_characteristics);
    64. m_characteristics.clear();
    65. qDeleteAll(m_services);
    66. m_services.clear();
    67.  
    68. m_control = new QLowEnergyController(m_currentDevice.getDevice(), this);
    69.  
    70. connect(m_control, SIGNAL(serviceDiscovered(QBluetoothUuid)), this, SLOT(addLowEnergyService(QBluetoothUuid)));
    71. connect(m_control, SIGNAL(discoveryFinished()), this, SLOT(serviceScanDone()));
    72. connect(m_control, SIGNAL(error(QLowEnergyController::Error)), this, SLOT(controllerError(QLowEnergyController::Error)));
    73. connect(m_control, SIGNAL(connected()), this, SLOT(deviceConnected()));
    74. connect(m_control, SIGNAL(disconnected()), this, SLOT(deviceDisconnected()));
    75.  
    76. m_control->connectToDevice();
    77. }
    78.  
    79. void Device::deviceConnected() {
    80. m_control->discoverServices();
    81. }
    82.  
    83. void Device::deviceDisconnected() {
    84. qWarning() << "Remote Device Disconnected.";
    85. }
    86.  
    87. void Device::controllerError(QLowEnergyController::Error error) {
    88. qWarning() << "Controller Error: " << error << "Cannot connect to remote device.";
    89. serviceUuid(QString("Controller Error."));
    90. }
    91.  
    92. QVariant Device::name() {
    93. return QVariant::fromValue(devices);
    94. }
    95.  
    96. void Device::serviceScanDone() {
    97. qWarning() << "Service Scan Done.";
    98. }
    99.  
    100. void Device::addLowEnergyService(const QBluetoothUuid &gatt) {
    101.  
    102. QLowEnergyService *service = m_control->createServiceObject(gatt);
    103. if(!service) {
    104. qWarning() << "Cannot Create Service for UUID." ;
    105. serviceUuid(QString("Cannot Create Service For UUID."));
    106. return;
    107. }
    108.  
    109. Service *serv = new Service(service);
    110. m_services.append(serv);
    111. qWarning() << "Service Found: " + serv->getName() << "UUID: " << serv->getUuid();
    112. if(serv->getUuid() == "0xb73a") {
    113. serviceUuid(QString(serv->getUuid()));
    114. qWarning() << "Service Found";
    115. }
    116.  
    117. }
    118.  
    119. void Device::disconFromDevice() {
    120. if(m_control->state() != QLowEnergyController::UnconnectedState)
    121. m_control->disconnectFromDevice();
    122. else
    123. deviceDisconnected();
    124. }
    125.  
    126. void Device::connectToService(const QString &uuid)
    127. {
    128. QLowEnergyService *service = 0;
    129. for(int i = 0; i<m_services.size(); i++) {
    130. Service *serviceInfo = (Service*)m_services.at(i);
    131. if(serviceInfo->getUuid() == uuid) {
    132. service = serviceInfo->service();
    133. break;
    134. }
    135. }
    136.  
    137. if(!service)
    138. return;
    139.  
    140. qDeleteAll(m_characteristics);
    141. m_characteristics.clear();
    142.  
    143. if(service->state() == QLowEnergyService::DiscoveryRequired) {
    144. service->discoverDetails();
    145. qWarning() << "Discovering Service Details";
    146. serviceUuid(QString("Service Details Discovered"));
    147. return;
    148. }
    149.  
    150. const QList<QLowEnergyCharacteristic> chars = service->characteristics();
    151. foreach(const QLowEnergyCharacteristic &ch, chars) {
    152. Characteristics *cInfo = new Characteristics(ch);
    153. m_characteristics.append(cInfo);
    154. //readData(QString(cInfo->getValue()));
    155.  
    156. }
    157. const QLowEnergyCharacteristic link = service->characteristic(QBluetoothUuid::mine);
    158. if(service->state() == QLowEnergyService::ServiceDiscovered) {
    159. service->QLowEnergyService::writeCharacteristic(link,QByteArray::fromHex("03"),QLowEnergyService::WriteWithResponse);
    160. readData(QString("0x03"));
    161. }
    162. }
    To copy to clipboard, switch view to plain text mode 

    Added after 10 minutes:


    You can download zip file at below link:
    http://www.mediafire.com/download/s4...acteristic.zip

    Thanks for your interested.
    Last edited by anda_skoa; 23rd August 2016 at 19:48. Reason: missing [code] tags

  6. #6
    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: Error: QBluetoothUuid::mine not found in Qt Android

    I had a look at the video and it turns out that the creator is a moron.

    He added a new value to a Qt header, which of course makes this compile for his modified Qt but not anyone else.

    Just pass the UUID of the characteristic by using one of the QBluetoothUuid constructors.

    Cheers,
    _

  7. #7
    Join Date
    Aug 2016
    Posts
    4
    Qt products
    Qt/Embedded
    Platforms
    Windows Android

    Default Re: Error: QBluetoothUuid::mine not found in Qt Android

    Thank you so much. I fixed the error. Sorry because I spent your time

  8. #8
    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: Error: QBluetoothUuid::mine not found in Qt Android

    No problem, that's what the forum is for.

    The person who created the video should be apologizing to everyone he's misled

    Cheers,
    _

  9. #9
    Join Date
    Aug 2016
    Posts
    2
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Error: QBluetoothUuid::mine not found in Qt Android

    hello sir ,
    i have the same error ,could you tell me how you solve this error. thank you

  10. #10
    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: Error: QBluetoothUuid::mine not found in Qt Android

    Quote Originally Posted by optimus View Post
    i have the same error ,could you tell me how you solve this error
    If it is the same error then the same solution applies, no?

    Cheers,
    _

  11. #11
    Join Date
    Aug 2016
    Posts
    2
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Error: QBluetoothUuid::mine not found in Qt Android

    Quote Originally Posted by anda_skoa View Post
    If it is the same error then the same solution applies, no?

    Cheers,
    _
    I would run the application on linux so it is possible no ?

  12. #12
    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: Error: QBluetoothUuid::mine not found in Qt Android

    Yes, Qt supports Bluetooth on Linux.

    Cheers,
    _

  13. #13
    Join Date
    Oct 2016
    Posts
    8
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Android

    Default Re: Error: QBluetoothUuid::mine not found in Qt Android

    No problem, that's what the forum is for.

    The person who created the video should be apologizing to everyone he's misled

  14. #14
    Join Date
    May 2019
    Posts
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Android

    Default Re: Error: QBluetoothUuid::mine not found in Qt Android

    Quote Originally Posted by robotden View Post
    Thank you so much. I fixed the error. Sorry because I spent your time
    Can you show your code solution ?

Similar Threads

  1. QML Not Found Error
    By Mathan in forum Qt Tools
    Replies: 1
    Last Post: 25th July 2016, 15:57
  2. Replies: 14
    Last Post: 2nd August 2015, 23:07
  3. Android & Qt Creator - compiler not found
    By tarod in forum Installation and Deployment
    Replies: 1
    Last Post: 19th August 2014, 16:34
  4. -llua not found error
    By MarkoSan in forum Qt Programming
    Replies: 1
    Last Post: 14th February 2011, 00:36
  5. internal error: no project could be found for
    By alphazero in forum Newbie
    Replies: 1
    Last Post: 16th November 2010, 13:16

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.