Pixels Plugin for Unity
Enable communications with Pixels dice using Bluetooth Low Energy.
Loading...
Searching...
No Matches
bletypes.h
Go to the documentation of this file.
1
6#pragma once
7
12
36{
38 enum class BleAdapterState
39 {
42
45
48
51 };
52
54 using bluetooth_address_t = std::uint64_t;
55
58 {
60 Success,
61
63 Error,
64
67
70
72 Disconnected, //TODO
73
76
79
82
85
88
91
93 AdapterOff, //TODO
94
96 Timeout,
97 };
98
101 {
104
106 Connected,
107
110
112 Ready,
113
116
119 };
120
123 {
125 Unknown = -1,
126
128 Success = 0,
129
131 Canceled,
132
135
137 Timeout,
138
140 LinkLoss,
141
144
147 };
148
151 {
152 None = 0,
153
155 Broadcast = 0x001,
156
158 Read = 0x002,
159
162
164 Write = 0x008,
165
167 Notify = 0x010,
168
170 Indicate = 0x020,
171
173 SignedWrite = 0x040,
174
177
180
183 };
184
185 // GATT errors
186 //GattProtocolError.InvalidHandle = 1
187 //GattProtocolError.ReadNotPermitted = 2
188 //GattProtocolError.WriteNotPermitted = 3
189 //GattProtocolError.InvalidPdu = 4
190 //GattProtocolError.InsufficientAuthentication = 5
191 //GattProtocolError.RequestNotSupported = 6
192 //GattProtocolError.InvalidOffset = 7
193 //GattProtocolError.InsufficientAuthorization = 8
194 //GattProtocolError.PrepareQueueFull = 9
195 //GattProtocolError.AttributeNotFound = 10
196 //GattProtocolError.AttributeNotLong = 11
197 //GattProtocolError.InsufficientEncryptionKeySize = 12
198 //GattProtocolError.InvalidAttributeValueLength = 13
199 //GattProtocolError.UnlikelyError = 14
200 //GattProtocolError.InsufficientEncryption = 15
201 //GattProtocolError.UnsupportedGroupType = 16
202 //GattProtocolError.InsufficientResources = 17
203}
Represents a Bluetooth Low Energy (BLE) peripheral.
Definition Peripheral.h:33
A collection of C++ classes that provides a simplified access to Bluetooth Low Energy peripherals.
Definition bletypes.h:36
BleAdapterState
Bluetooth adapter states.
Definition bletypes.h:39
@ Enabled
The radio of the default Bluetooth adapter is enabled and ready for use..
@ Unavailable
The radio of the default Bluetooth adapter is in a uncontrollable state.
@ Unsupported
The system doesn't have a compatible Bluetooth adapter.
@ Disabled
The radio of the default Bluetooth adapter is disabled or powered off.
std::uint64_t bluetooth_address_t
Type for a Bluetooth address.
Definition bletypes.h:54
BleRequestStatus
Peripheral requests statuses.
Definition bletypes.h:58
@ Canceled
The request was canceled.
@ InProgress
The request is still in progress.
@ InvalidParameters
The request did not run because some of its parameters are invalid.
@ Success
The request completed successfully.
@ Error
The request completed with a non-specific error.
@ NotSupported
The request failed because of the operation is not supported by the peripheral.
@ AdapterOff
The request failed because the Bluetooth radio is off.
@ InvalidCall
The request did not run because the operation is not valid or permitted.
@ Timeout
The request did not succeed after the timeout period.
@ ProtocolError
The request failed because of BLE protocol error.
@ InvalidPeripheral
The request did not run because the given peripheral is not valid.
@ AccessDenied
The request failed because it was denied access.
@ Disconnected
The request was aborted because the peripheral got disconnected.
CharacteristicProperties
Standard BLE values for characteristic properties, those are flags that can be combined.
Definition bletypes.h:151
@ SignedWrite
Characteristic supports write with signature.
Definition bletypes.h:173
@ Write
Characteristic can be written.
Definition bletypes.h:164
@ WriteWithoutResponse
Characteristic can be written without response.
Definition bletypes.h:161
@ Indicate
Characteristic supports indication.
Definition bletypes.h:170
@ NotifyEncryptionRequired
Characteristic notification uses encryption.
Definition bletypes.h:179
@ ExtendedProperties
Characteristic has extended properties.
Definition bletypes.h:176
@ Notify
Characteristic supports notification.
Definition bletypes.h:167
@ IndicateEncryptionRequired
Characteristic indication uses encryption.
Definition bletypes.h:182
@ Broadcast
Characteristic is broadcastable.
Definition bletypes.h:155
@ Read
Characteristic is readable.
Definition bletypes.h:158
ConnectionEvent
Peripheral connection events.
Definition bletypes.h:101
@ Disconnecting
Raised at the beginning of a user initiated disconnect.
@ Connected
Raised once the peripheral is connected, just before services are being discovered.
@ Connecting
Raised at the beginning of the connect sequence and is followed either by Connected or FailedToConnec...
@ Ready
Raised after a Connected event, once the required services have been discovered.
@ FailedToConnect
Raised when the peripheral fails to connect, the reason of failure is also given.
ConnectionEventReason
Peripheral connection event reasons.
Definition bletypes.h:123
@ LinkLoss
Peripheral was disconnected while in "auto connect" mode.
@ Unknown
The disconnect happened for an unknown reason.
@ AdpaterOff
The local device Bluetooth adapter is off.