Commit b2e7d481 authored by deadprogram's avatar deadprogram
Browse files

Need to populate the correct map


Signed-off-by: default avatardeadprogram <ron@hybridgroup.com>
parent cfb84dbb
......@@ -38,6 +38,10 @@ type Device struct {
// NewDevice returns a BLE device.
func NewDevice(opts ...Option) (*Device, error) {
initXpcIDs()
var utsname xpc.Utsname
xpc.Uname(&utsname)
d := &Device{
rspc: make(chan msg),
conns: make(map[string]*conn),
......@@ -49,10 +53,6 @@ func NewDevice(opts ...Option) (*Device, error) {
return nil, err
}
initXpcIDs()
var utsname xpc.Utsname
xpc.Uname(&utsname)
if utsname.Release < "17." {
// yosemite
d.pm = xpc.XpcConnect("com.apple.blued", d)
......
......@@ -62,7 +62,7 @@ func initXpcIDs() {
var utsname xpc.Utsname
xpc.Uname(&utsname)
xpcID := make(map[int]int)
xpcID = make(map[int]int)
xpcID[cmdInit] = 1
xpcID[cmdAdvertiseStart] = 8
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment