Versions in this module Expand all Collapse all v0 v0.1.0 Aug 2, 2019 Changes in this version + const SignalCommandReject + const SignalConnectionParameterUpdateRequest + const SignalConnectionParameterUpdateResponse + const SignalDisconnectRequest + const SignalDisconnectResponse + const SignalLECreditBasedConnectionRequest + const SignalLECreditBasedConnectionResponse + const SignalLEFlowControlCredit + var ErrBusyAdvertising = errors.New("busy advertising") + var ErrBusyDialing = errors.New("busy dialing") + var ErrBusyListening = errors.New("busy listening") + var ErrBusyScanning = errors.New("busy scanning") + var ErrInvalidAddr = errors.New("invalid address") + type Advertisement struct + func (a *Advertisement) Addr() ble.Addr + func (a *Advertisement) AddressType() uint8 + func (a *Advertisement) Connectable() bool + func (a *Advertisement) Data() []byte + func (a *Advertisement) EventType() uint8 + func (a *Advertisement) LocalName() string + func (a *Advertisement) ManufacturerData() []byte + func (a *Advertisement) OverflowService() []ble.UUID + func (a *Advertisement) RSSI() int + func (a *Advertisement) ScanResponse() []byte + func (a *Advertisement) ServiceData() []ble.ServiceData + func (a *Advertisement) Services() []ble.UUID + func (a *Advertisement) SolicitedService() []ble.UUID + func (a *Advertisement) TxPowerLevel() int + type Client struct + func NewClient(p *Pool) *Client + func (c *Client) Get() *bytes.Buffer + func (c *Client) LockPool() + func (c *Client) Put() + func (c *Client) PutAll() + func (c *Client) UnlockPool() + type Command interface + Len func() int + Marshal func([]byte) error + OpCode func() int + type CommandRP interface + Unmarshal func(b []byte) error + type CommandReject struct + Data []byte + Reason uint16 + func (s *CommandReject) Marshal() ([]byte, error) + func (s *CommandReject) Unmarshal(b []byte) error + func (s CommandReject) Code() int + type Conn struct + func (c *Conn) Close() error + func (c *Conn) Context() context.Context + func (c *Conn) Disconnected() <-chan struct{} + func (c *Conn) LECreditBasedConnectionRequest(s sigCmd) + func (c *Conn) LEFlowControlCredit(s sigCmd) + func (c *Conn) LocalAddr() ble.Addr + func (c *Conn) Read(sdu []byte) (n int, err error) + func (c *Conn) RemoteAddr() ble.Addr + func (c *Conn) RxMTU() int + func (c *Conn) SetContext(ctx context.Context) + func (c *Conn) SetRxMTU(mtu int) + func (c *Conn) SetTxMTU(mtu int) + func (c *Conn) Signal(req Signal, rsp Signal) error + func (c *Conn) TxMTU() int + func (c *Conn) Write(sdu []byte) (int, error) + type ConnectionParameterUpdateRequest struct + IntervalMax uint16 + IntervalMin uint16 + SlaveLatency uint16 + TimeoutMultiplier uint16 + func (s *ConnectionParameterUpdateRequest) Marshal() ([]byte, error) + func (s *ConnectionParameterUpdateRequest) Unmarshal(b []byte) error + func (s ConnectionParameterUpdateRequest) Code() int + type ConnectionParameterUpdateResponse struct + Result uint16 + func (s *ConnectionParameterUpdateResponse) Marshal() ([]byte, error) + func (s *ConnectionParameterUpdateResponse) Unmarshal(b []byte) error + func (s ConnectionParameterUpdateResponse) Code() int + type DisconnectRequest struct + DestinationCID uint16 + SourceCID uint16 + func (s *DisconnectRequest) Marshal() ([]byte, error) + func (s *DisconnectRequest) Unmarshal(b []byte) error + func (s DisconnectRequest) Code() int + type DisconnectResponse struct + DestinationCID uint16 + SourceCID uint16 + func (s *DisconnectResponse) Marshal() ([]byte, error) + func (s *DisconnectResponse) Unmarshal(b []byte) error + func (s DisconnectResponse) Code() int + type ErrCommand byte + const ErrACLConnExists + const ErrAuth + const ErrBDADDR + const ErrChannelClass + const ErrCoarseClock + const ErrConnAcceptTimeout + const ErrConnID + const ErrConnLimit + const ErrConnParams + const ErrConnTimeout + const ErrControllerBusy + const ErrDifferentTransColl + const ErrDirAdvTimeout + const ErrDisallowed + const ErrEIRTooLarge + const ErrEncNotAccepted + const ErrEstablished + const ErrHardware + const ErrHostBusy + const ErrInstantPassed + const ErrInsufficientSecurity + const ErrInvalidLLParams + const ErrInvalidParams + const ErrLLResponseTimeout + const ErrLMPPDU + const ErrLMPTransColl + const ErrLimitedResource + const ErrLinkKey + const ErrLocalHost + const ErrMACConn + const ErrMIC + const ErrMemoryCapacity + const ErrNoChannel + const ErrOutOfRange + const ErrPINMissing + const ErrPageTimeout + const ErrPairingNotAllowed + const ErrQOSParameter + const ErrQOSReject + const ErrQoSNotSupported + const ErrRemoteLowResources + const ErrRemotePowerOff + const ErrRemoteUser + const ErrRepeatedAttempts + const ErrReservedSlot + const ErrRoleChangeNotAllowed + const ErrRoleSwitch + const ErrRoleSwitchPending + const ErrSCOAirMode + const ErrSCOConnLimit + const ErrSCOInterval + const ErrSCOOffset + const ErrSecureSimplePairing + const ErrSecurity + const ErrUnitKeyNotSupported + const ErrUnknownCommand + const ErrUnknownLMP + const ErrUnspecified + const ErrUnsupportedLLParams + const ErrUnsupportedLMP + const ErrUnsupportedParams + func (e ErrCommand) Error() string + type HCI struct + func NewHCI(opts ...ble.Option) (*HCI, error) + func (h *HCI) Accept() (ble.Conn, error) + func (h *HCI) Addr() ble.Addr + func (h *HCI) Advertise() error + func (h *HCI) AdvertiseAdv(a ble.Advertisement) error + func (h *HCI) AdvertiseIBeacon(u ble.UUID, major, minor uint16, pwr int8) error + func (h *HCI) AdvertiseIBeaconData(md []byte) error + func (h *HCI) AdvertiseMfgData(id uint16, md []byte) error + func (h *HCI) AdvertiseNameAndServices(name string, uuids ...ble.UUID) error + func (h *HCI) AdvertiseServiceData16(id uint16, b []byte) error + func (h *HCI) Close() error + func (h *HCI) Dial(ctx context.Context, a ble.Addr) (ble.Client, error) + func (h *HCI) Error() error + func (h *HCI) Init() error + func (h *HCI) Option(opts ...ble.Option) error + func (h *HCI) Scan(allowDup bool) error + func (h *HCI) Send(c Command, r CommandRP) error + func (h *HCI) SetAdvHandler(ah ble.AdvHandler) error + func (h *HCI) SetAdvParams(param cmd.LESetAdvertisingParameters) error + func (h *HCI) SetAdvertisement(ad []byte, sr []byte) error + func (h *HCI) SetCentralRole() error + func (h *HCI) SetConnParams(param cmd.LECreateConnection) error + func (h *HCI) SetConnectedHandler(f func(complete evt.LEConnectionComplete)) error + func (h *HCI) SetDeviceID(id int) error + func (h *HCI) SetDialerTimeout(d time.Duration) error + func (h *HCI) SetDisconnectedHandler(f func(evt.DisconnectionComplete)) error + func (h *HCI) SetListenerTimeout(d time.Duration) error + func (h *HCI) SetPeripheralRole() error + func (h *HCI) SetScanParams(param cmd.LESetScanParameters) error + func (h *HCI) StopAdvertising() error + func (h *HCI) StopScanning() error + type LECreditBasedConnectionRequest struct + InitialCredits uint16 + LEPSM uint16 + MPS uint16 + MTU uint16 + SourceCID uint16 + func (s *LECreditBasedConnectionRequest) Marshal() ([]byte, error) + func (s *LECreditBasedConnectionRequest) Unmarshal(b []byte) error + func (s LECreditBasedConnectionRequest) Code() int + type LECreditBasedConnectionResponse struct + DestinationCID uint16 + InitialCreditsCID uint16 + MPS uint16 + MTU uint16 + Result uint16 + func (s *LECreditBasedConnectionResponse) Marshal() ([]byte, error) + func (s *LECreditBasedConnectionResponse) Unmarshal(b []byte) error + func (s LECreditBasedConnectionResponse) Code() int + type LEFlowControlCredit struct + CID uint16 + Credits uint16 + func (s *LEFlowControlCredit) Marshal() ([]byte, error) + func (s *LEFlowControlCredit) Unmarshal(b []byte) error + func (s LEFlowControlCredit) Code() int + type Pool struct + func NewPool(sz int, cnt int) *Pool + type RandomAddress struct + type Signal interface + Code func() int + Marshal func() ([]byte, error) + Unmarshal func([]byte) error