forked from moogle19/ble
-
Notifications
You must be signed in to change notification settings - Fork 108
/
conn.go
41 lines (29 loc) · 1.03 KB
/
conn.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package ble
import (
"context"
"io"
)
// Conn implements a L2CAP connection.
type Conn interface {
io.ReadWriteCloser
// Context returns the context that is used by this Conn.
Context() context.Context
// SetContext sets the context that is used by this Conn.
SetContext(ctx context.Context)
// LocalAddr returns local device's address.
LocalAddr() Addr
// RemoteAddr returns remote device's address.
RemoteAddr() Addr
// RxMTU returns the ATT_MTU which the local device is capable of accepting.
RxMTU() int
// SetRxMTU sets the ATT_MTU which the local device is capable of accepting.
SetRxMTU(mtu int)
// TxMTU returns the ATT_MTU which the remote device is capable of accepting.
TxMTU() int
// 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{}
}