8000 Gouroutine does not release Because it is not initialized by GrootYuan · Pull Request #5 · moogle19/ble · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Gouroutine does not release Because it is not initialized #5

8000 New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1dd6d60
Fix cancel via context and respect context deadline (#14)
moogle19 Mar 16, 2018
1e3172f
scan full advertising packet for UUIDs (#16)
estutzenberger Mar 16, 2018
582be3b
fill in char and desc values on successful read (#15)
estutzenberger Apr 4, 2018
721d240
Rollback 619ee1f77e2de4a17af8786baa9c08b1c77e442e
moogle19 Apr 4, 2018
7370f1c
Refinement (#19)
moogle19 May 24, 2018
b4a677b
Add isConnected field to darwin.conn type (#25)
jlubawy Jul 18, 2018
11b1dad
Add lock for sent map (#22)
moogle19 Jul 18, 2018
731710e
Add Conn method to Client interface (#26)
jlubawy Aug 14, 2018
c9d4987
Fixes OSX unsupported key for MTU (#30)
xibz Aug 31, 2018
e78417b
Add option to pass HCI options when creating a device (#28)
Oct 2, 2018
cc345f2
linux/add: fix duplicated switch case error
quasilyte Dec 10, 2018
e4c7701
Update README.md
moogle19 May 13, 2019
147700f
Some fixes and QoL improvements (#45)
estutzenberger May 21, 2019
5328f95
linux.hci: fix stop advertise on new connection
rkjdid Aug 2, 2019
31b5b19
hci: add Connect/DisconnectHandler options
rkjdid Jul 28, 2019
965572d
Corrected ioctl on mips (#52)
Sep 3, 2019
27f6032
linux.hci: do not exit sktLoop on handlePacket error (#51)
rkjdid Jan 9, 2020
6e59c69
add go.mod/sum (#54)
cbrake Jan 9, 2020
5ba052e
remove log entry
rkjdid Jan 10, 2020
0105c68
Merge pull request #50 from rkjdid/conn-handlers
estutzenberger Jan 10, 2020
67ae735
Merge pull request #49 from rkjdid/fix-stop-advertise
estutzenberger Jan 10, 2020
15dbdb1
re-adding log
armaanhammer Jan 17, 2020
0a73a9d
Merge pull request #58 from armaanhammer/isolate-bugfix-from-tempfix
estutzenberger Jan 20, 2020
9f14c3a
Add SetConnectedHandler and SetDisconnectedHandler to *darwin.Device
peterhellberg Mar 8, 2020
2323c1a
fix go vet warning for unkeyed field in composite literal
mfiumara Mar 14, 2020
067514c
Merge pull request #63 from peterhellberg/darwin/Device-type-does-not…
estutzenberger Apr 7, 2020
e97c2ff
Mojave / Catalina support
ccollins476ad Apr 27, 2020
91f80b5
Fix hang when cmgr/pmgr initialize early
ccollins476ad May 16, 2020
9ab2720
Added support for reading RSSI of a connected peripheral
abferm Jul 31, 2020
d66aac6
Client should also support incoming MTU exchanges
abferm Sep 2, 2020
c72d728
Don't try to handle canceled connections
markdrayton Dec 27, 2020
7713241
Merge pull request #64 from mfiumara/fix-unkeyed-field
estutzenberger May 19, 2021
4bfb849
Merge pull request #67 from ccollins476ad/mojave
estutzenberger May 19, 2021
16670f7
Merge pull request #72 from abferm/master
estutzenberger May 19, 2021
3abdc48
Merge pull request #79 from markdrayton/issue-77-leak-goroutine
estutzenberger May 19, 2021
22bd95b
Merge pull request #53 from amarkee/mips_ioctl
estutzenberger May 19, 2021
b055c21
Merge pull request #39 from quasilyte/patch-1
estutzenberger May 19, 2021
918dbc1
fix bug
GrootYuan Aug 24, 2021
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
.tags1

/examples/bin/*
vendor
.idea
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ os:
- linux

go:
- 1.7
- 1.8
- 1.9
- tip
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[![codebeat badge](https://codebeat.co/badges/ba9fae6e-77d2-4173-8587-36ac8756676b)](https://codebeat.co/projects/github-com-go-ble-ble-master)
[![Build Status](https://travis-ci.org/go-ble/ble.svg?branch=master)](https://travis-ci.org/go-ble/ble)

**ble** is a Golang [Bluetooth Low Energy](https://en.wikipedia.org/wiki/Bluetooth_Low_Energy) package for Linux and Mac OS.


**ble** is a [Bluetooth Low Energy](https://en.wikipedia.org/wiki/Bluetooth_Low_Energy) package for Linux and macOS.

**Note:** The Mac OS portion is not being actively maintained.
3 changes: 3 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,7 @@ type Client interface {

// Disconnected returns a receiving channel, which is closed when the client disconnects.
Disconnected() <-chan struct{}

// Conn returns the client's current connection.
Conn() Conn
}
3 changes: 3 additions & 0 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ type Conn interface {
// SetTxMTU sets the ATT_MTU which the remote device is capable of accepting.
SetTxMTU(mtu int)

// ReadRSSI retrieves the current RSSI value of remote peripheral. [Vol 2, Part E, 7.5.4]
ReadRSSI() int

// Disconnected returns a receiving channel, which is closed when the connection disconnects.
Disconnected() <-chan struct{}
}
49 changes: 16 additions & 33 deletions darwin/adv.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,55 @@ package darwin

import (
"github.com/go-ble/ble"
"github.com/raff/goble/xpc"
)

type adv struct {
args xpc.Dict
ad xpc.Dict
localName string
rssi int
mfgData []byte
powerLevel int
connectable bool
svcUUIDs []ble.UUID
svcData []ble.ServiceData
peerUUID ble.Addr
}

func (a *adv) LocalName() string {
return a.ad.GetString("kCBAdvDataLocalName", a.args.GetString("kCBMsgArgName", ""))
return a.localName
}

func (a *adv) ManufacturerData() []byte {
return a.ad.GetBytes("kCBAdvDataManufacturerData", nil)
return a.mfgData
}

func (a *adv) ServiceData() []ble.ServiceData {
xSDs, ok := a.ad["kCBAdvDataServiceData"]
if !ok {
return nil
}

xSD := xSDs.(xpc.Array)
var sd []ble.ServiceData
for i := 0; i < len(xSD); i += 2 {
sd = append(
sd, ble.ServiceData{
UUID: ble.UUID(xSD[i].([]byte)),
Data: xSD[i+1].([]byte),
})
}
return sd
return a.svcData
}

func (a *adv) Services() []ble.UUID {
xUUIDs, ok := a.ad["kCBAdvDataServiceUUIDs"]
if !ok {
return nil
}
var uuids []ble.UUID
for _, xUUID := range xUUIDs.(xpc.Array) {
uuids = append(uuids, ble.UUID(ble.Reverse(xUUID.([]byte))))
}
return uuids
return a.svcUUIDs
}

func (a *adv) OverflowService() []ble.UUID {
return nil // TODO
}

func (a *adv) TxPowerLevel() int {
return a.ad.GetInt("kCBAdvDataTxPowerLevel", 0)
return a.powerLevel
}

func (a *adv) SolicitedService() []ble.UUID {
return nil // TODO
}

func (a *adv) Connectable() bool {
return a.ad.GetInt("kCBAdvDataIsConnectable", 0) > 0
return a.connectable
}

func (a *adv) RSSI() int {
return a.args.GetInt("kCBMsgArgRssi", 0)
return a.rssi
}

func (a *adv) Addr() ble.Addr {
return a.args.MustGetUUID("kCBMsgArgDeviceUUID")
return a.peerUUID
}
Loading
0