Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qbluetoothuuid_darwin.mm
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "darwin/btutility_p.h"
5
7
8QT_BEGIN_NAMESPACE
9
10/*!
11 \brief Constructs a new QBluetoothUuid, containing a copy of the \a cbUuid CBUUID.
12
13 \note this function is only available on Apple platforms.
14
15 \since 6.6
16 \ingroup platform-type-conversions
17*/
18QBluetoothUuid QBluetoothUuid::fromCBUUID(CBUUID *cbUuid)
19{
20 if (!cbUuid)
21 return {};
22
23 return DarwinBluetooth::qt_uuid(cbUuid);
24}
25
26/*!
27 \brief Creates a CBUUID from a QBluetoothUuid.
28
29 The resulting CBUUID is autoreleased.
30
31 \note this function is only available on Apple platforms.
32
33 \since 6.6
34 \ingroup platform-type-conversions
35*/
36
37CBUUID *QBluetoothUuid::toCBUUID() const
38{
39 const auto cbUuidGuard = DarwinBluetooth::cb_uuid(*this);
40 // cb_uuid returns a strong reference (RAII object). Let
41 // it do its job and release, but we return auto-released
42 // CBUUID, as documented.
43 return [[cbUuidGuard.data() retain] autorelease];
44}
45
46QT_END_NAMESPACE