diff --git a/gattc_ninafw.go b/gattc_ninafw.go index 3e6b6fd2..fecb57a0 100644 --- a/gattc_ninafw.go +++ b/gattc_ninafw.go @@ -40,7 +40,7 @@ type DeviceService struct { } // UUID returns the UUID for this DeviceService. -func (s *DeviceService) UUID() UUID { +func (s DeviceService) UUID() UUID { return s.uuid } @@ -129,7 +129,7 @@ type DeviceCharacteristic struct { } // UUID returns the UUID for this DeviceCharacteristic. -func (c *DeviceCharacteristic) UUID() UUID { +func (c DeviceCharacteristic) UUID() UUID { return c.uuid } @@ -142,7 +142,7 @@ func (c *DeviceCharacteristic) UUID() UUID { // // Passing a nil slice of UUIDs will return a complete // list of characteristics. -func (s *DeviceService) DiscoverCharacteristics(uuids []UUID) ([]DeviceCharacteristic, error) { +func (s DeviceService) DiscoverCharacteristics(uuids []UUID) ([]DeviceCharacteristic, error) { if _debug { println("DiscoverCharacteristics") } @@ -176,7 +176,7 @@ func (s *DeviceService) DiscoverCharacteristics(uuids []UUID) ([]DeviceCharacter for _, rawCharacteristic := range s.device.adapter.att.characteristics { if len(uuids) == 0 || rawCharacteristic.uuid.isIn(uuids) { dc := DeviceCharacteristic{ - service: s, + service: &s, uuid: rawCharacteristic.uuid, handle: rawCharacteristic.valueHandle, properties: rawCharacteristic.properties, @@ -236,7 +236,7 @@ func (c DeviceCharacteristic) WriteWithoutResponse(p []byte) (n int, err error) // changes. // // Users may call EnableNotifications with a nil callback to disable notifications. -func (c *DeviceCharacteristic) EnableNotifications(callback func(buf []byte)) error { +func (c DeviceCharacteristic) EnableNotifications(callback func(buf []byte)) error { if !c.permissions.Notify() { return errNoNotify } @@ -278,7 +278,7 @@ func (c DeviceCharacteristic) GetMTU() (uint16, error) { } // Read reads the current characteristic value. -func (c *DeviceCharacteristic) Read(data []byte) (int, error) { +func (c DeviceCharacteristic) Read(data []byte) (int, error) { if !c.permissions.Read() { return 0, errNoRead }