diff --git a/gap_darwin.go b/gap_darwin.go index f933f08..c397320 100644 --- a/gap_darwin.go +++ b/gap_darwin.go @@ -93,7 +93,7 @@ type Device struct { servicesChan chan error charsChan chan error - services map[UUID]*DeviceService + services map[UUID]DeviceService } // Connect starts a connection attempt to the given peripheral device address. diff --git a/gattc_darwin.go b/gattc_darwin.go index 96e7d34..e4b10a3 100644 --- a/gattc_darwin.go +++ b/gattc_darwin.go @@ -18,7 +18,7 @@ func (d *Device) DiscoverServices(uuids []UUID) ([]DeviceService, error) { d.prph.DiscoverServices([]cbgo.UUID{}) // clear cache of services - d.services = make(map[UUID]*DeviceService) + d.services = make(map[UUID]DeviceService) // wait on channel for service discovery select { @@ -49,7 +49,7 @@ func (d *Device) DiscoverServices(uuids []UUID) ([]DeviceService, error) { }, } svcs = append(svcs, svc) - d.services[svc.uuidWrapper] = &svc + d.services[svc.uuidWrapper] = svc } return svcs, nil case <-time.NewTimer(10 * time.Second).C: @@ -72,7 +72,7 @@ type deviceService struct { device *Device service cbgo.Service - characteristics map[UUID]*DeviceCharacteristic + characteristics map[UUID]DeviceCharacteristic } // UUID returns the UUID for this DeviceService. @@ -95,7 +95,7 @@ func (s *DeviceService) DiscoverCharacteristics(uuids []UUID) ([]DeviceCharacter s.device.prph.DiscoverCharacteristics(cbuuids, s.service) // clear cache of characteristics - s.characteristics = make(map[UUID]*DeviceCharacteristic) + s.characteristics = make(map[UUID]DeviceCharacteristic) // wait on channel for characteristic discovery select { @@ -150,7 +150,7 @@ func (s *DeviceService) makeCharacteristic(uuid UUID, dchar cbgo.Characteristic) characteristic: dchar, }, } - s.characteristics[char.uuidWrapper] = &char + s.characteristics[char.uuidWrapper] = char return char }