forked from JuulLabs-OSS/cbgo
-
Notifications
You must be signed in to change notification settings - Fork 2
/
central.go
25 lines (20 loc) · 668 Bytes
/
central.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
package cbgo
/*
// See cutil.go for C compiler flags.
#import "bt.h"
*/
import "C"
import "unsafe"
// Central: https://developer.apple.com/documentation/corebluetooth/cbcentral
type Central struct {
ptr unsafe.Pointer
}
// Identifier: https://developer.apple.com/documentation/corebluetooth/cbpeer/1620687-identifier
func (c Central) Identifier() UUID {
cstr := C.cb_peer_identifier(c.ptr)
return MustParseUUID(C.GoString(cstr))
}
// MaximumUpdateValueLength: https://developer.apple.com/documentation/corebluetooth/cbcentral/1408800-maximumupdatevaluelength
func (c Central) MaximumUpdateValueLength() int {
return int(C.cb_cent_maximum_update_len(c.ptr))
}