Skip to content

Commit

Permalink
ninafw: remove some pointer receivers from method calls
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Jan 3, 2024
1 parent 1a90b00 commit 7c9b2e4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gattc_ninafw.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand All @@ -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")
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 7c9b2e4

Please sign in to comment.