Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bluetooth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
// those produced by Nordic Semiconductor.
//
// This package can be use to create Bluetooth Low Energy centrals as well as peripherals.
package bluetooth // import "tinygo.org/x/bluetooth"
package bluetooth // import "github.com/aventari/bluetooth"
2 changes: 1 addition & 1 deletion examples/advertisement/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"time"

"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
)

var adapter = bluetooth.DefaultAdapter
Expand Down
2 changes: 1 addition & 1 deletion examples/battery/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"math/rand"
"time"

"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
)

var adapter = bluetooth.DefaultAdapter
Expand Down
2 changes: 1 addition & 1 deletion examples/beacon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"math/rand"
"time"

"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
)

var adapter = bluetooth.DefaultAdapter
Expand Down
2 changes: 1 addition & 1 deletion examples/circuitplay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"machine"
"time"

"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
"tinygo.org/x/drivers/ws2812"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/connparams/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package main
import (
"time"

"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion examples/device-information/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package main
import (
"time"

"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
)

var adapter = bluetooth.DefaultAdapter
Expand Down
2 changes: 1 addition & 1 deletion examples/discover/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package main
import (
"strconv"

"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
)

var adapter = bluetooth.DefaultAdapter
Expand Down
2 changes: 1 addition & 1 deletion examples/heartrate-monitor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
package main

import (
"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion examples/heartrate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"math/rand"
"time"

"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion examples/ledcolor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"machine"
"time"

"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
)

var adapter = bluetooth.DefaultAdapter
Expand Down
4 changes: 2 additions & 2 deletions examples/nusclient/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ package main
// details.

import (
"tinygo.org/x/bluetooth"
"tinygo.org/x/bluetooth/rawterm"
"github.com/aventari/bluetooth"
"github.com/aventari/bluetooth/rawterm"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions examples/nusserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ package main
// Code to interact with a raw terminal is in separate files with build tags.

import (
"tinygo.org/x/bluetooth"
"tinygo.org/x/bluetooth/rawterm"
"github.com/aventari/bluetooth"
"github.com/aventari/bluetooth/rawterm"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion examples/scanner/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
)

var adapter = bluetooth.DefaultAdapter
Expand Down
2 changes: 1 addition & 1 deletion examples/stop-advertisement/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package main
import (
"time"

"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
)

var adapter = bluetooth.DefaultAdapter
Expand Down
2 changes: 1 addition & 1 deletion examples/tinyscan/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"image/color"
"time"

"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
"tinygo.org/x/tinyterm"
)

Expand Down
13 changes: 10 additions & 3 deletions gattc_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,19 @@ func (c *DeviceCharacteristic) EnableNotifications(callback func(buf []byte)) er
if c.property == nil {
return nil
}

err := c.adapter.bus.RemoveMatchSignal(c.propertiesChangedMatchOption)
// Make the D-Bus call to stop notifications on the characteristic.
stopNotifyErr := c.characteristic.Call("org.bluez.GattCharacteristic1.StopNotify", 0).Err
// Still clean up other resources if there was an error
removeSignalErr := c.adapter.bus.RemoveMatchSignal(c.propertiesChangedMatchOption)
c.adapter.bus.RemoveSignal(c.property)
close(c.property)
c.property = nil
return err

// If there were errors, prioritize notify err
if stopNotifyErr == nil {
return removeSignalErr
}
return stopNotifyErr
}
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module tinygo.org/x/bluetooth
module github.com/aventari/bluetooth

go 1.22.1

Expand Down
2 changes: 1 addition & 1 deletion tools/gen-characteristic-uuids/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"golang.org/x/text/cases"
"golang.org/x/text/language"

"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
)

type Characteristic struct {
Expand Down
2 changes: 1 addition & 1 deletion tools/gen-service-uuids/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"golang.org/x/text/cases"
"golang.org/x/text/language"

"tinygo.org/x/bluetooth"
"github.com/aventari/bluetooth"
)

type Service struct {
Expand Down
Loading