forked from JuulLabs-OSS/cbgo
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmanager.go
32 lines (27 loc) · 1018 Bytes
/
manager.go
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
package cbgo
/*
// See cutil.go for C compiler flags.
#import "bt.h"
*/
import "C"
// ManagerState: https://developer.apple.com/documentation/corebluetooth/cbmanagerstate
type ManagerState int
const (
ManagerStatePoweredOff = ManagerState(C.CBManagerStatePoweredOff)
ManagerStatePoweredOn = ManagerState(C.CBManagerStatePoweredOn)
ManagerStateResetting = ManagerState(C.CBManagerStateResetting)
ManagerStateUnauthorized = ManagerState(C.CBManagerStateUnauthorized)
ManagerStateUnknown = ManagerState(C.CBManagerStateUnknown)
ManagerStateUnsupported = ManagerState(C.CBManagerStateUnsupported)
)
// ManagerOpts: https://developer.apple.com/documentation/corebluetooth/cbcentralmanager/central_manager_initialization_options
type ManagerOpts struct {
ShowPowerAlert bool
RestoreIdentifier string
}
// DfltManagerOpts is the set of options that gets used when nil is
// passed to `NewCentralManager()`.
var DfltManagerOpts = ManagerOpts{
ShowPowerAlert: false,
RestoreIdentifier: "",
}