Pixels Plugin for Unity
Enable communications with Pixels dice using Bluetooth Low Energy.
Loading...
Searching...
No Matches
SGBleTypes.h
Go to the documentation of this file.
1
6#ifndef SGBleTypes_h
7#define SGBleTypes_h
8
9// Forward declaration
11
45#import <Foundation/Foundation.h>
46#import <CoreBluetooth/CoreBluetooth.h>
47
52typedef NS_ENUM(NSInteger, SGBleConnectionEvent)
53{
56
59
62
65
68
71};
72
77typedef NS_ENUM(NSInteger, SGBleConnectionEventReason)
78{
81
84
87
90
93
96
99};
100
105typedef NS_ENUM(NSInteger, SGBleError)
106{
109
112
115
118
121
124};
125
130typedef void (^SGBlePeripheralDiscoveryHandler)(CBPeripheral * _Nonnull peripheral, NSDictionary<NSString *, id> * _Nonnull advertisementData, NSNumber * _Nonnull rssi);
131
136typedef void (^SGBleConnectionEventHandler)(CBPeripheral * _Nonnull peripheral, SGBleConnectionEvent connectionEvent, NSError * _Nullable error);
137
142typedef void (^SGBleCharacteristicValueEventHandler)(SGBlePeripheralQueue * _Nonnull peripheralQueue, CBCharacteristic * _Nonnull characteristic, NSError * _Nullable error);
143
144#endif /* SGBleTypes_h */
void(^ SGBleCharacteristicValueEventHandler)(SGBlePeripheralQueue *_Nonnull peripheralQueue, CBCharacteristic *_Nonnull characteristic, NSError *_Nullable error)
Peripheral connection event handler.
Definition SGBleTypes.h:142
void(^ SGBleConnectionEventHandler)(CBPeripheral *_Nonnull peripheral, SGBleConnectionEvent connectionEvent, NSError *_Nullable error)
Peripheral connection event handler.
Definition SGBleTypes.h:136
void(^ SGBlePeripheralDiscoveryHandler)(CBPeripheral *_Nonnull peripheral, NSDictionary< NSString *, id > *_Nonnull advertisementData, NSNumber *_Nonnull rssi)
Peripheral discovery handler.
Definition SGBleTypes.h:130
@ SGBleConnectionEventReasonAdapterOff
The local device Bluetooth adapter is off.
Definition SGBleTypes.h:98
@ SGBleConnectionEventReasonLinkLoss
Peripheral was disconnected while in "auto connect" mode.
Definition SGBleTypes.h:95
@ SGBleConnectionEventReasonSuccess
The disconnect was initiated by user.
Definition SGBleTypes.h:83
@ SGBleConnectionEventReasonNotSupported
Peripheral doesn't have all required services.
Definition SGBleTypes.h:89
@ SGBleConnectionEventReasonUnknown
The disconnect happened for an unknown reason.
Definition SGBleTypes.h:80
@ SGBleConnectionEventReasonTimeout
Peripheral didn't responded in time.
Definition SGBleTypes.h:92
@ SGBleConnectionEventReasonCanceled
Connection attempt canceled by user.
Definition SGBleTypes.h:86
@ SGBleErrorInvalidParameter
Peripheral request has one or more invalid parameters.
Definition SGBleTypes.h:114
@ SGBleErrorRequestCanceled
Peripheral request got canceled.
Definition SGBleTypes.h:120
@ SGBleErrorPeripheralDisconnected
Peripheral got disconnected while executing request.
Definition SGBleTypes.h:123
@ SGBleErrorInvalidState
Bluetooth or peripheral not in proper state to execute request.
Definition SGBleTypes.h:117
@ SGBleErrorOutOfMemory
Application out of memory.
Definition SGBleTypes.h:108
@ SGBleErrorNotImplemented
Call not implemented.
Definition SGBleTypes.h:111
@ SGBleConnectionEventDisconnected
Raised when the peripheral is disconnected, the reason for the disconnection is also given.
Definition SGBleTypes.h:70
@ SGBleConnectionEventConnecting
Raised at the beginning of the connect sequence and is followed either by Connected or FailedToConnec...
Definition SGBleTypes.h:55
@ SGBleConnectionEventDisconnecting
Raised at the beginning of a user initiated disconnect.
Definition SGBleTypes.h:67
@ SGBleConnectionEventFailedToConnect
Raised when the peripheral fails to connect, the reason of failure is also given.
Definition SGBleTypes.h:61
@ SGBleConnectionEventConnected
Raised once the peripheral is connected, just before services are being discovered.
Definition SGBleTypes.h:58
@ SGBleConnectionEventReady
Raised after a Connected event, once the required services have been discovered.
Definition SGBleTypes.h:64
Implementation of the CBPeripheralDelegate protocol. Queues up operations to be performed with a Blue...
Definition SGBlePeripheralQueue.h:44