Documentation ¶
Index ¶
- Constants
- Variables
- type Advertisement
- func (a *Advertisement) Address() ble.Addr
- func (a *Advertisement) AddressString() string
- func (a *Advertisement) AddressType() ble.AddressType
- 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
- type Command
- type CommandRP
- type CommandReject
- type Conn
- func (c *Conn) Close(ctx context.Context) error
- func (c *Conn) ConfigurationRequest(ctx context.Context, options []l2cap.Option, timeout time.Duration) error
- func (c *Conn) ConnectionRequest(ctx context.Context, psm uint16, timeout time.Duration) error
- func (c *Conn) Disconnected() <-chan struct{}
- func (c *Conn) InformationRequest(ctx context.Context, infoType uint16, timeout time.Duration) error
- func (c *Conn) LECreditBasedConnectionRequest() error
- func (c *Conn) LEFlowControlCredit() error
- 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) SetRxMTU(mtu int)
- func (c *Conn) SetTxMTU(mtu int)
- func (c *Conn) Signal(ctx context.Context, req Signal, rsp Signal, timeout time.Duration) error
- func (c *Conn) TxMTU() int
- func (c *Conn) Write(sdu []byte) (int, error)
- type ConnectionCompleteEvent
- type ConnectionParameterUpdateRequest
- type ConnectionParameterUpdateResponse
- type DisconnectRequest
- type DisconnectResponse
- type ErrCommand
- type HCI
- func (h *HCI) Accept() (ble.Conn, error)
- func (h *HCI) Addr() ble.Addr
- func (h *HCI) Advertise(ctx context.Context) error
- func (h *HCI) AdvertiseAdv(ctx context.Context, a ble.Advertisement) error
- func (h *HCI) AdvertiseIBeacon(ctx context.Context, u ble.UUID, major, minor uint16, pwr int8) error
- func (h *HCI) AdvertiseIBeaconData(ctx context.Context, md []byte) error
- func (h *HCI) AdvertiseMfgData(ctx context.Context, id uint16, md []byte) error
- func (h *HCI) AdvertiseNameAndServices(ctx context.Context, name string, uuids ...ble.UUID) error
- func (h *HCI) AdvertiseServiceData16(ctx context.Context, id uint16, b []byte) error
- func (h *HCI) Close() (err error)
- func (h *HCI) Closed() chan struct{}
- func (h *HCI) Dial(ctx context.Context, a ble.Addr, addressType ble.AddressType) (ble.ClientBLE, error)
- func (h *HCI) DialRFCOMM(ctx context.Context, a ble.Addr, clockOffset uint16, ...) (cli ble.ClientRFCOMM, err error)
- func (h *HCI) Init(ctx context.Context) (err error)
- func (h *HCI) Inquire(ctx context.Context, length int, numResponses int) error
- func (h *HCI) RequestRemoteName(ctx context.Context, a ble.Addr) (string, error)
- func (h *HCI) Scan(ctx context.Context, allowDup bool) error
- func (h *HCI) Send(ctx context.Context, 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(ctx context.Context, 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) SetDisconnectedHandler(f func(ble.Conn)) error
- func (h *HCI) SetInqHandler(ah ble.InqHandler) error
- func (h *HCI) SetPairingCapabilities(param smp.Capabilities) error
- func (h *HCI) SetPeripheralRole() error
- func (h *HCI) SetScanParams(param cmd.LESetScanParameters) error
- func (h *HCI) StopAdvertising(ctx context.Context) error
- func (h *HCI) StopInquiry(ctx context.Context) error
- func (h *HCI) StopScanning(ctx context.Context) (err error)
- type Inquiry
- type InquiryEvent
- type LECreditBasedConnectionRequest
- type LECreditBasedConnectionResponse
- type LEFlowControlCredit
- type Pool
- type SMP
- type Signal
Constants ¶
const SignalCommandReject = 0x01
SignalCommandReject is the code of Command Reject signaling packet.
const SignalConnectionParameterUpdateRequest = 0x12
SignalConnectionParameterUpdateRequest is the code of Connection Parameter Update Request signaling packet.
const SignalConnectionParameterUpdateResponse = 0x13
SignalConnectionParameterUpdateResponse is the code of Connection Parameter Update Response signaling packet.
const SignalDisconnectRequest = 0x06
SignalDisconnectRequest is the code of Disconnect Request signaling packet.
const SignalDisconnectResponse = 0x07
SignalDisconnectResponse is the code of Disconnect Response signaling packet.
const SignalLECreditBasedConnectionRequest = 0x14
SignalLECreditBasedConnectionRequest is the code of LE Credit Based Connection Request signaling packet.
const SignalLECreditBasedConnectionResponse = 0x15
SignalLECreditBasedConnectionResponse is the code of LE Credit Based Connection Response signaling packet.
const SignalLEFlowControlCredit = 0x16
SignalLEFlowControlCredit is the code of LE Flow Control Credit signaling packet.
Variables ¶
var ( ErrBusyScanning = errors.New("busy scanning") ErrBusyAdvertising = errors.New("busy advertising") ErrBusyDialing = errors.New("busy dialing") ErrBusyListening = errors.New("busy listening") ErrInvalidAddr = errors.New("invalid address") ErrUnsupportedVendorPacket = errors.New("unsupported vendor packet") ErrUnsupportedScoPacket = errors.New("unsupported sco packet") ErrUnsupportedCommand = errors.New("unsupported command") ErrInvalidPacket = errors.New("invalid packet") )
errors
Functions ¶
This section is empty.
Types ¶
type Advertisement ¶
type Advertisement struct {
// contains filtered or unexported fields
}
Advertisement implements ble.Advertisement and other functions that are only available on Linux.
func (*Advertisement) Address ¶
func (a *Advertisement) Address() ble.Addr
Addr returns the address of the remote peripheral.
func (*Advertisement) AddressString ¶ added in v0.0.12
func (a *Advertisement) AddressString() string
func (*Advertisement) AddressType ¶
func (a *Advertisement) AddressType() ble.AddressType
AddressType returns the address type of the Advertisement. This is linux sepcific.
func (*Advertisement) Connectable ¶
func (a *Advertisement) Connectable() bool
Connectable indicates weather the remote peripheral is connectable.
func (*Advertisement) Data ¶
func (a *Advertisement) Data() []byte
Data returns the advertising data of the packet. This is linux sepcific.
func (*Advertisement) EventType ¶
func (a *Advertisement) EventType() uint8
EventType returns the event type of Advertisement. This is linux sepcific.
func (*Advertisement) LocalName ¶
func (a *Advertisement) LocalName() string
LocalName returns the LocalName of the remote peripheral.
func (*Advertisement) ManufacturerData ¶
func (a *Advertisement) ManufacturerData() []byte
ManufacturerData returns the ManufacturerData of the advertisement.
func (*Advertisement) OverflowService ¶
func (a *Advertisement) OverflowService() []ble.UUID
OverflowService returns the UUIDs of overflowed service.
func (*Advertisement) ScanResponse ¶
func (a *Advertisement) ScanResponse() []byte
ScanResponse returns the scan response of the packet, if it presents. This is linux sepcific.
func (*Advertisement) ServiceData ¶
func (a *Advertisement) ServiceData() []ble.ServiceData
ServiceData returns the service data of the advertisement.
func (*Advertisement) Services ¶
func (a *Advertisement) Services() []ble.UUID
Services returns the service UUIDs of the advertisement.
func (*Advertisement) SolicitedService ¶
func (a *Advertisement) SolicitedService() []ble.UUID
SolicitedService returns UUIDs of solicited services.
func (*Advertisement) TxPowerLevel ¶
func (a *Advertisement) TxPowerLevel() int
TxPowerLevel returns the tx power level of the remote peripheral.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client ...
func (*Client) Put ¶
func (c *Client) Put()
Put puts the oldest sent buffer back to the shared pool.
type CommandReject ¶ added in v0.0.6
CommandReject implements Command Reject (0x01) [Vol 3, Part A, 4.1].
func (CommandReject) Code ¶ added in v0.0.6
func (s CommandReject) Code() int
Code returns the event code of the command.
func (*CommandReject) Marshal ¶ added in v0.0.6
func (s *CommandReject) Marshal() ([]byte, error)
Marshal serializes the command parameters into binary form.
func (*CommandReject) Unmarshal ¶ added in v0.0.6
func (s *CommandReject) Unmarshal(b []byte) error
Unmarshal de-serializes the binary data and stores the result in the receiver.
type Conn ¶
type Conn struct { sync.WaitGroup // The channel identifiers. This may be a fixed ID for some protocols (LE) // but dynamic for others (BR/EDR) [Vol 3, Part A, 2.1] SourceID uint16 DestinationID uint16 // contains filtered or unexported fields }
Conn ...
func (*Conn) Close ¶
Close disconnects the connection by sending hci disconnect command to the device.
func (*Conn) ConfigurationRequest ¶
func (c *Conn) ConfigurationRequest(ctx context.Context, options []l2cap.Option, timeout time.Duration) error
ConfigurationRequest [Vol 3, Part A, 4.4]
func (*Conn) ConnectionRequest ¶
ConnectionRequest [Vol 3, Part A, 4.2]
func (*Conn) Disconnected ¶
func (c *Conn) Disconnected() <-chan struct{}
Disconnected returns a receiving channel, which is closed when the connection disconnects.
func (*Conn) InformationRequest ¶
func (c *Conn) InformationRequest(ctx context.Context, infoType uint16, timeout time.Duration) error
InformationRequest [Vol 3, Part A, 4.10]
func (*Conn) LECreditBasedConnectionRequest ¶
LECreditBasedConnectionRequest ...
func (*Conn) LEFlowControlCredit ¶
LEFlowControlCredit ...
func (*Conn) RemoteAddr ¶
RemoteAddr returns remote device's MAC address.
type ConnectionCompleteEvent ¶
type ConnectionParameterUpdateRequest ¶ added in v0.0.6
type ConnectionParameterUpdateRequest struct { IntervalMin uint16 IntervalMax uint16 SlaveLatency uint16 TimeoutMultiplier uint16 }
ConnectionParameterUpdateRequest implements Connection Parameter Update Request (0x12) [Vol 3, Part A, 4.20].
func (ConnectionParameterUpdateRequest) Code ¶ added in v0.0.6
func (s ConnectionParameterUpdateRequest) Code() int
Code returns the event code of the command.
func (*ConnectionParameterUpdateRequest) Marshal ¶ added in v0.0.6
func (s *ConnectionParameterUpdateRequest) Marshal() ([]byte, error)
Marshal serializes the command parameters into binary form.
func (*ConnectionParameterUpdateRequest) Unmarshal ¶ added in v0.0.6
func (s *ConnectionParameterUpdateRequest) Unmarshal(b []byte) error
Unmarshal de-serializes the binary data and stores the result in the receiver.
type ConnectionParameterUpdateResponse ¶ added in v0.0.6
type ConnectionParameterUpdateResponse struct {
Result uint16
}
ConnectionParameterUpdateResponse implements Connection Parameter Update Response (0x13) [Vol 3, Part A, 4.21].
func (ConnectionParameterUpdateResponse) Code ¶ added in v0.0.6
func (s ConnectionParameterUpdateResponse) Code() int
Code returns the event code of the command.
func (*ConnectionParameterUpdateResponse) Marshal ¶ added in v0.0.6
func (s *ConnectionParameterUpdateResponse) Marshal() ([]byte, error)
Marshal serializes the command parameters into binary form.
func (*ConnectionParameterUpdateResponse) Unmarshal ¶ added in v0.0.6
func (s *ConnectionParameterUpdateResponse) Unmarshal(b []byte) error
Unmarshal de-serializes the binary data and stores the result in the receiver.
type DisconnectRequest ¶ added in v0.0.6
DisconnectRequest implements Disconnect Request (0x06) [Vol 3, Part A, 4.6].
func (DisconnectRequest) Code ¶ added in v0.0.6
func (s DisconnectRequest) Code() int
Code returns the event code of the command.
func (*DisconnectRequest) Marshal ¶ added in v0.0.6
func (s *DisconnectRequest) Marshal() ([]byte, error)
Marshal serializes the command parameters into binary form.
func (*DisconnectRequest) Unmarshal ¶ added in v0.0.6
func (s *DisconnectRequest) Unmarshal(b []byte) error
Unmarshal de-serializes the binary data and stores the result in the receiver.
type DisconnectResponse ¶ added in v0.0.6
DisconnectResponse implements Disconnect Response (0x07) [Vol 3, Part A, 4.7].
func (DisconnectResponse) Code ¶ added in v0.0.6
func (s DisconnectResponse) Code() int
Code returns the event code of the command.
func (*DisconnectResponse) Marshal ¶ added in v0.0.6
func (s *DisconnectResponse) Marshal() ([]byte, error)
Marshal serializes the command parameters into binary form.
func (*DisconnectResponse) Unmarshal ¶ added in v0.0.6
func (s *DisconnectResponse) Unmarshal(b []byte) error
Unmarshal de-serializes the binary data and stores the result in the receiver.
type ErrCommand ¶
type ErrCommand byte
ErrCommand [Vol2, Part D, 1.3 ]
const ( ErrUnknownCommand ErrCommand = 0x01 // Unknown HCI Command ErrConnID ErrCommand = 0x02 // Unknown Connection Identifier ErrHardware ErrCommand = 0x03 // Hardware Failure ErrPageTimeout ErrCommand = 0x04 // Page Timeout ErrAuth ErrCommand = 0x05 // Authentication Failure ErrPINMissing ErrCommand = 0x06 // PIN or Key Missing ErrMemoryCapacity ErrCommand = 0x07 // Memory Capacity Exceeded ErrConnTimeout ErrCommand = 0x08 // Connection Timeout ErrConnLimit ErrCommand = 0x09 // Connection Limit Exceeded ErrSCOConnLimit ErrCommand = 0x0A // Synchronous Connection Limit To A Device Exceeded ErrACLConnExists ErrCommand = 0x0B // ACL Connection Already Exists ErrDisallowed ErrCommand = 0x0C // Command Disallowed ErrLimitedResource ErrCommand = 0x0D // Connection Rejected due to Limited Resources ErrSecurity ErrCommand = 0x0E // Connection Rejected Due To Security Reasons ErrBDADDR ErrCommand = 0x0F // Connection Rejected due to Unacceptable BD_ADDR ErrConnAcceptTimeout ErrCommand = 0x10 // Connection Accept Timeout Exceeded ErrUnsupportedParams ErrCommand = 0x11 // Unsupported Feature or Parameter Value ErrInvalidParams ErrCommand = 0x12 // Invalid HCI Command Parameters ErrRemoteUser ErrCommand = 0x13 // Remote User Terminated Connection ErrRemoteLowResources ErrCommand = 0x14 // Remote Device Terminated Connection due to Low Resources ErrRemotePowerOff ErrCommand = 0x15 // Remote Device Terminated Connection due to Power Off ErrLocalHost ErrCommand = 0x16 // Connection Terminated By Local Host ErrRepeatedAttempts ErrCommand = 0x17 // Repeated Attempts ErrPairingNotAllowed ErrCommand = 0x18 // Pairing Not Allowed ErrUnknownLMP ErrCommand = 0x19 // Unknown LMP PDU ErrUnsupportedLMP ErrCommand = 0x1A // Unsupported Remote Feature / Unsupported LMP Feature ErrSCOOffset ErrCommand = 0x1B // SCO Offset Rejected ErrSCOInterval ErrCommand = 0x1C // SCO Interval Rejected ErrSCOAirMode ErrCommand = 0x1D // SCO Air Mode Rejected ErrInvalidLLParams ErrCommand = 0x1E // Invalid LMP Parameters / Invalid LL Parameters ErrUnspecified ErrCommand = 0x1F // Unspecified Error ErrUnsupportedLLParams ErrCommand = 0x20 // Unsupported LMP Parameter Value / Unsupported LL Parameter Value ErrRoleChangeNotAllowed ErrCommand = 0x21 // Role Change Not Allowed ErrLLResponseTimeout ErrCommand = 0x22 // LMP Response Timeout / LL Response Timeout ErrLMPTransColl ErrCommand = 0x23 // LMP Error Transaction Collision ErrLMPPDU ErrCommand = 0x24 // LMP PDU Not Allowed ErrEncNotAccepted ErrCommand = 0x25 // Encryption Mode Not Acceptable ErrLinkKey ErrCommand = 0x26 // Link Key cannot be Changed ErrQoSNotSupported ErrCommand = 0x27 // Requested QoS Not Supported ErrInstantPassed ErrCommand = 0x28 // Instant Passed ErrUnitKeyNotSupported ErrCommand = 0x29 // Pairing With Unit Key Not Supported ErrDifferentTransColl ErrCommand = 0x2A // Different Transaction Collision ErrQOSParameter ErrCommand = 0x2C // QoS Unacceptable Parameter ErrQOSReject ErrCommand = 0x2D // QoS Rejected ErrChannelClass ErrCommand = 0x2E // Channel Classification Not Supported ErrInsufficientSecurity ErrCommand = 0x2F // Insufficient Security ErrOutOfRange ErrCommand = 0x30 // Parameter Out Of Mandatory Range ErrRoleSwitchPending ErrCommand = 0x32 // Role Switch Pending ErrReservedSlot ErrCommand = 0x34 // Reserved Slot Violation ErrRoleSwitch ErrCommand = 0x35 // Role Switch Failed ErrEIRTooLarge ErrCommand = 0x36 // Extended Inquiry Response Too Large ErrSecureSimplePairing ErrCommand = 0x37 // Secure Simple Pairing Not Supported By Host ErrHostBusy ErrCommand = 0x38 // Host Busy - Pairing ErrNoChannel ErrCommand = 0x39 // Connection Rejected due to No Suitable Channel Found ErrControllerBusy ErrCommand = 0x3A // Controller Busy ErrConnParams ErrCommand = 0x3B // Unacceptable Connection Parameters ErrDirAdvTimeout ErrCommand = 0x3C // Directed Advertising Timeout ErrMIC ErrCommand = 0x3D // Connection Terminated due to MIC Failure ErrEstablished ErrCommand = 0x3E // Connection Failed to be Established ErrMACConn ErrCommand = 0x3F // MAC Connection Failed ErrCoarseClock ErrCommand = 0x40 // Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging )
HCI Command Errors [Vol2, Part D, 1.3 ] FIXME: Terrible shorthand. Name them properly.
func (ErrCommand) Error ¶
func (e ErrCommand) Error() string
type HCI ¶
HCI ...
func (*HCI) AdvertiseAdv ¶ added in v0.0.6
AdvertiseAdv advertises a given Advertisement, context is used for timing out long running send command to the hci device in case the device does not respond as expected
func (*HCI) AdvertiseIBeacon ¶
func (h *HCI) AdvertiseIBeacon(ctx context.Context, u ble.UUID, major, minor uint16, pwr int8) error
AdvertiseIBeacon advertises iBeacon with specified parameters.
func (*HCI) AdvertiseIBeaconData ¶
AdvertiseIBeaconData advertise iBeacon with given manufacturer data.
func (*HCI) AdvertiseMfgData ¶
AdvertiseMfgData avertises the given manufacturer data.
func (*HCI) AdvertiseNameAndServices ¶
AdvertiseNameAndServices advertises device name, and specified service UUIDs. It tries to fit the UUIDs in the advertising data as much as possible. If name doesn't fit in the advertising data, it will be put in scan response.
func (*HCI) AdvertiseServiceData16 ¶
AdvertiseServiceData16 advertises data associated with a 16bit service uuid
func (*HCI) Dial ¶
func (h *HCI) Dial(ctx context.Context, a ble.Addr, addressType ble.AddressType) (ble.ClientBLE, error)
Dial ...
func (*HCI) DialRFCOMM ¶
func (*HCI) RequestRemoteName ¶
func (*HCI) SetAdvParams ¶ added in v0.0.6
func (h *HCI) SetAdvParams(param cmd.LESetAdvertisingParameters) error
SetAdvParams overrides default advertising parameters.
func (*HCI) SetAdvertisement ¶
SetAdvertisement sets advertising data and scanResp.
func (*HCI) SetCentralRole ¶ added in v0.0.6
SetCentralRole is not supported
func (*HCI) SetConnParams ¶ added in v0.0.6
func (h *HCI) SetConnParams(param cmd.LECreateConnection) error
SetConnParams overrides default connection parameters.
func (*HCI) SetConnectedHandler ¶ added in v0.0.6
func (h *HCI) SetConnectedHandler(f func(complete evt.LEConnectionComplete)) error
SetConnectedHandler sets handler to be called when new connection is established.
func (*HCI) SetDeviceID ¶ added in v0.0.6
SetDeviceID sets HCI device ID.
func (*HCI) SetDisconnectedHandler ¶ added in v0.0.6
SetDisconnectedHandler sets handler to be called on disconnect.
func (*HCI) SetPairingCapabilities ¶ added in v0.0.6
func (h *HCI) SetPairingCapabilities(param smp.Capabilities) error
OptPairingIO allows input and output for the pairing process.
func (*HCI) SetPeripheralRole ¶ added in v0.0.6
SetPeripheralRole is not supported
func (*HCI) SetScanParams ¶ added in v0.0.6
func (h *HCI) SetScanParams(param cmd.LESetScanParameters) error
SetScanParams overrides default scanning parameters.
func (*HCI) StopAdvertising ¶
StopAdvertising stops advertising.
func (*HCI) StopInquiry ¶
StopInquiry stops inquiring for BR/EDR devices by sending an InquiryCancel command
type Inquiry ¶
type Inquiry struct {
// contains filtered or unexported fields
}
Inquiry implements ble.Inquiry and other functions that are only available on Linux.
func (*Inquiry) AddressType ¶ added in v0.0.6
func (i *Inquiry) AddressType() ble.AddressType
func (*Inquiry) ClassOfDevice ¶
ClassOfDevice returns a bit mask as defined here: https://www.bluetooth.com/specifications/assigned-numbers/baseband
func (*Inquiry) ClockOffset ¶
ClockOffset returns the difference in time between the host and client
func (*Inquiry) ExtendedInquiryResponse ¶
func (*Inquiry) PageScanRepetitionMode ¶
PageScanRepetitionMode returns the mode used for page scans
type InquiryEvent ¶
type InquiryEvent interface { NumResponses() uint8 BDADDR(i int) [6]byte PageScanRepetitionMode(i int) uint8 ClassOfDevice(i int) [3]byte ClockOffset(i int) uint16 RSSI(i int) uint8 ExtendedInquiryResponse() [240]byte }
InquiryEvent interface that wraps methods common to all inquiry events
type LECreditBasedConnectionRequest ¶ added in v0.0.6
type LECreditBasedConnectionRequest struct { LEPSM uint16 SourceCID uint16 MTU uint16 MPS uint16 InitialCredits uint16 }
LECreditBasedConnectionRequest implements LE Credit Based Connection Request (0x14) [Vol 3, Part A, 4.22].
func (LECreditBasedConnectionRequest) Code ¶ added in v0.0.6
func (s LECreditBasedConnectionRequest) Code() int
Code returns the event code of the command.
func (*LECreditBasedConnectionRequest) Marshal ¶ added in v0.0.6
func (s *LECreditBasedConnectionRequest) Marshal() ([]byte, error)
Marshal serializes the command parameters into binary form.
func (*LECreditBasedConnectionRequest) Unmarshal ¶ added in v0.0.6
func (s *LECreditBasedConnectionRequest) Unmarshal(b []byte) error
Unmarshal de-serializes the binary data and stores the result in the receiver.
type LECreditBasedConnectionResponse ¶ added in v0.0.6
type LECreditBasedConnectionResponse struct { DestinationCID uint16 MTU uint16 MPS uint16 InitialCreditsCID uint16 Result uint16 }
LECreditBasedConnectionResponse implements LE Credit Based Connection Response (0x15) [Vol 3, Part A, 4.23].
func (LECreditBasedConnectionResponse) Code ¶ added in v0.0.6
func (s LECreditBasedConnectionResponse) Code() int
Code returns the event code of the command.
func (*LECreditBasedConnectionResponse) Marshal ¶ added in v0.0.6
func (s *LECreditBasedConnectionResponse) Marshal() ([]byte, error)
Marshal serializes the command parameters into binary form.
func (*LECreditBasedConnectionResponse) Unmarshal ¶ added in v0.0.6
func (s *LECreditBasedConnectionResponse) Unmarshal(b []byte) error
Unmarshal de-serializes the binary data and stores the result in the receiver.
type LEFlowControlCredit ¶ added in v0.0.6
LEFlowControlCredit implements LE Flow Control Credit (0x16) [Vol 3, Part A, 4.24].
func (LEFlowControlCredit) Code ¶ added in v0.0.6
func (s LEFlowControlCredit) Code() int
Code returns the event code of the command.
func (*LEFlowControlCredit) Marshal ¶ added in v0.0.6
func (s *LEFlowControlCredit) Marshal() ([]byte, error)
Marshal serializes the command parameters into binary form.
func (*LEFlowControlCredit) Unmarshal ¶ added in v0.0.6
func (s *LEFlowControlCredit) Unmarshal(b []byte) error
Unmarshal de-serializes the binary data and stores the result in the receiver.