summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.cpp
blob: 8e6f3009e9a05717e3412b4a8f2b1165feffb5d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "modules/bluetooth/BluetoothCharacteristicProperties.h"

namespace blink {

BluetoothCharacteristicProperties* BluetoothCharacteristicProperties::create(uint32_t properties)
{
    return new BluetoothCharacteristicProperties(properties);
}

bool BluetoothCharacteristicProperties::broadcast() const
{
    return properties & Property::Broadcast;
}

bool BluetoothCharacteristicProperties::read() const
{
    return properties & Property::Read;
}

bool BluetoothCharacteristicProperties::writeWithoutResponse() const
{
    return properties & Property::WriteWithoutResponse;
}

bool BluetoothCharacteristicProperties::write() const
{
    return properties & Property::Write;
}

bool BluetoothCharacteristicProperties::notify() const
{
    return properties & Property::Notify;
}

bool BluetoothCharacteristicProperties::indicate() const
{
    return properties & Property::Indicate;
}

bool BluetoothCharacteristicProperties::authenticatedSignedWrites() const
{
    return properties & Property::AuthenticatedSignedWrites;
}

bool BluetoothCharacteristicProperties::reliableWrite() const
{
    return properties & Property::ReliableWrite;
}

bool BluetoothCharacteristicProperties::writableAuxiliaries() const
{
    return properties & Property::WritableAuxiliaries;
}

BluetoothCharacteristicProperties::BluetoothCharacteristicProperties(uint32_t device_properties)
{
    ASSERT(device_properties != Property::None);
    properties = device_properties;
}

} // namespace blink