1// Copyright (C) 2016 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 "qlowenergyserviceprivate_p.h"
5
6#include "qlowenergycontrollerbase_p.h"
7
8QT_BEGIN_NAMESPACE
9
10QT_IMPL_METATYPE_EXTERN_TAGGED(QSharedPointer<QLowEnergyServicePrivate>,
11 QSharedPointer_QLowEnergyServicePrivate)
12
13QLowEnergyServicePrivate::QLowEnergyServicePrivate(QObject *parent) : QObject(parent) { }
14
15QLowEnergyServicePrivate::~QLowEnergyServicePrivate()
16{
17}
18
19void QLowEnergyServicePrivate::setController(QLowEnergyControllerPrivate *control)
20{
21 controller = control;
22
23 if (control)
24 setState(QLowEnergyService::RemoteService);
25 else
26 setState(QLowEnergyService::InvalidService);
27}
28
29void QLowEnergyServicePrivate::setError(QLowEnergyService::ServiceError newError)
30{
31 lastError = newError;
32 emit errorOccurred(error: newError);
33}
34
35void QLowEnergyServicePrivate::setState(QLowEnergyService::ServiceState newState)
36{
37 if (state == newState)
38 return;
39
40 state = newState;
41 emit stateChanged(newState);
42}
43
44QT_END_NAMESPACE
45
46#include "moc_qlowenergyserviceprivate_p.cpp"
47

source code of qtconnectivity/src/bluetooth/qlowenergyserviceprivate.cpp