connection

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CidSMP uint16 = 0x06 // SecurityManager Protocol [Vol 3, Part H].
)

L2CAP Channel Identifier namespace for LE-U logical link [Vol 3, Part A, 2.1].

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() hci.ConnectionFactory

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn ...

func New

func New(ctrl hci.Controller, param evt.LEConnectionComplete) *Conn

func (*Conn) BufferPool

func (c *Conn) BufferPool() hci.BufferPool

func (*Conn) CancelContext

func (c *Conn) CancelContext()

func (*Conn) Close

func (c *Conn) Close() error

Close disconnects the connection by sending hci disconnect command to the device.

func (*Conn) CloseInputChannel

func (c *Conn) CloseInputChannel()

func (*Conn) Context

func (c *Conn) Context() context.Context

Context returns the context that is used by this Conn.

func (*Conn) Disconnected

func (c *Conn) Disconnected() <-chan struct{}

Disconnected returns a receiving channel, which is closed when the connection disconnects.

func (*Conn) LECreditBasedConnectionRequest

func (c *Conn) LECreditBasedConnectionRequest(s sigCmd)

LECreditBasedConnectionRequest ...

func (*Conn) LEFlowControlCredit

func (c *Conn) LEFlowControlCredit(s sigCmd)

LEFlowControlCredit ...

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() ble.Addr

LocalAddr returns local device's MAC address.

func (*Conn) Pair

func (c *Conn) Pair(authData ble.AuthData, to time.Duration) error

func (*Conn) PutPacket

func (c *Conn) PutPacket(b []byte)

func (*Conn) Read

func (c *Conn) Read(sdu []byte) (n int, err error)

Read copies re-assembled L2CAP PDUs into sdu.

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() ble.Addr

RemoteAddr returns remote device's MAC address.

func (*Conn) Role

func (c *Conn) Role() uint8

func (*Conn) Run

func (c *Conn) Run()

func (*Conn) RxMTU

func (c *Conn) RxMTU() int

RxMTU returns the MTU which the upper layer is capable of accepting.

func (*Conn) SetClosed

func (c *Conn) SetClosed()

func (*Conn) SetContext

func (c *Conn) SetContext(ctx context.Context)

SetContext sets the context that is used by this Conn.

func (*Conn) SetRxMTU

func (c *Conn) SetRxMTU(mtu int)

SetRxMTU sets the MTU which the upper layer is capable of accepting.

func (*Conn) SetTxMTU

func (c *Conn) SetTxMTU(mtu int)

SetTxMTU sets the MTU which the remote device is capable of accepting.

func (*Conn) Signal

func (c *Conn) Signal(req Signal, rsp Signal) error

Signal ...

func (*Conn) StartEncryption

func (c *Conn) StartEncryption() error

func (*Conn) TxMTU

func (c *Conn) TxMTU() int

TxMTU returns the MTU which the remote device is capable of accepting.

func (*Conn) Write

func (c *Conn) Write(sdu []byte) (int, error)

Write breaks down a L2CAP SDU into segmants [Vol 3, Part A, 7.3.1]

type Encrypter

type Encrypter interface {
	Encrypt() error
}

type Packet

type Packet []byte

pkt implements HCI ACL Data Packet [Vol 2, Part E, 5.4.2] Packet boundary flags , bit[5:6] of handle field's MSB Broadcast flags. bit[7:8] of handle field's MSB Not used in LE-U. Leave it as 0x00 (Point-to-Point). Broadcasting in LE uses ADVB logical transport.

func (Packet) Pbf

func (a Packet) Pbf() int

type Pdu

type Pdu []byte

type Signal

type Signal interface {
	Code() int
	Marshal() ([]byte, error)
	Unmarshal([]byte) error
}

Signal ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL