forked from currantlabs/ble
-
Notifications
You must be signed in to change notification settings - Fork 2
/
conn.go
38 lines (27 loc) · 948 Bytes
/
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
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)
// Disconnected returns a receiving channel, which is closed when the connection disconnects.
Disconnected() <-chan struct{}
}