Documentation ¶
Index ¶
- Constants
- Variables
- func DumpAttributes(aa []*attr)
- type Client
- func (c *Client) ExchangeMTU(clientRxMTU int) (serverRxMTU int, err error)
- func (c *Client) ExecuteWrite(flags uint8) error
- func (c *Client) FindInformation(starth, endh uint16) (fmt int, data []byte, err error)
- func (c *Client) Loop()
- func (c *Client) PrepareWrite(handle uint16, offset uint16, value []byte) (uint16, uint16, []byte, error)
- func (c *Client) Read(handle uint16) ([]byte, error)
- func (c *Client) ReadBlob(handle, offset uint16) ([]byte, error)
- func (c *Client) ReadByGroupType(starth, endh uint16, uuid ble.UUID) (int, []byte, error)
- func (c *Client) ReadByType(starth, endh uint16, uuid ble.UUID) (int, []byte, error)
- func (c *Client) ReadMultiple(handles []uint16) ([]byte, error)
- func (c *Client) SignedWrite(handle uint16, value []byte, signature [12]byte) error
- func (c *Client) Write(handle uint16, value []byte) error
- func (c *Client) WriteCommand(handle uint16, value []byte) error
- type DB
- type ErrorResponse
- func (r ErrorResponse) AttributeInError() uint16
- func (r ErrorResponse) AttributeOpcode() uint8
- func (r ErrorResponse) ErrorCode() uint8
- func (r ErrorResponse) RequestOpcodeInError() uint8
- func (r ErrorResponse) SetAttributeInError(v uint16)
- func (r ErrorResponse) SetAttributeOpcode()
- func (r ErrorResponse) SetErrorCode(v uint8)
- func (r ErrorResponse) SetRequestOpcodeInError(v uint8)
- type ExchangeMTURequest
- type ExchangeMTUResponse
- type ExecuteWriteRequest
- type ExecuteWriteResponse
- type FindByTypeValueRequest
- func (r FindByTypeValueRequest) AttributeOpcode() uint8
- func (r FindByTypeValueRequest) AttributeType() uint16
- func (r FindByTypeValueRequest) AttributeValue() []byte
- func (r FindByTypeValueRequest) EndingHandle() uint16
- func (r FindByTypeValueRequest) SetAttributeOpcode()
- func (r FindByTypeValueRequest) SetAttributeType(v uint16)
- func (r FindByTypeValueRequest) SetAttributeValue(v []byte)
- func (r FindByTypeValueRequest) SetEndingHandle(v uint16)
- func (r FindByTypeValueRequest) SetStartingHandle(v uint16)
- func (r FindByTypeValueRequest) StartingHandle() uint16
- type FindByTypeValueResponse
- type FindInformationRequest
- func (r FindInformationRequest) AttributeOpcode() uint8
- func (r FindInformationRequest) EndingHandle() uint16
- func (r FindInformationRequest) SetAttributeOpcode()
- func (r FindInformationRequest) SetEndingHandle(v uint16)
- func (r FindInformationRequest) SetStartingHandle(v uint16)
- func (r FindInformationRequest) StartingHandle() uint16
- type FindInformationResponse
- func (r FindInformationResponse) AttributeOpcode() uint8
- func (r FindInformationResponse) Format() uint8
- func (r FindInformationResponse) InformationData() []byte
- func (r FindInformationResponse) SetAttributeOpcode()
- func (r FindInformationResponse) SetFormat(v uint8)
- func (r FindInformationResponse) SetInformationData(v []byte)
- type HandleValueConfirmation
- type HandleValueIndication
- func (r HandleValueIndication) AttributeHandle() uint16
- func (r HandleValueIndication) AttributeOpcode() uint8
- func (r HandleValueIndication) AttributeValue() []byte
- func (r HandleValueIndication) SetAttributeHandle(v uint16)
- func (r HandleValueIndication) SetAttributeOpcode()
- func (r HandleValueIndication) SetAttributeValue(v []byte)
- type HandleValueNotification
- func (r HandleValueNotification) AttributeHandle() uint16
- func (r HandleValueNotification) AttributeOpcode() uint8
- func (r HandleValueNotification) AttributeValue() []byte
- func (r HandleValueNotification) SetAttributeHandle(v uint16)
- func (r HandleValueNotification) SetAttributeOpcode()
- func (r HandleValueNotification) SetAttributeValue(v []byte)
- type NotificationHandler
- type PrepareWriteRequest
- func (r PrepareWriteRequest) AttributeHandle() uint16
- func (r PrepareWriteRequest) AttributeOpcode() uint8
- func (r PrepareWriteRequest) PartAttributeValue() []byte
- func (r PrepareWriteRequest) SetAttributeHandle(v uint16)
- func (r PrepareWriteRequest) SetAttributeOpcode()
- func (r PrepareWriteRequest) SetPartAttributeValue(v []byte)
- func (r PrepareWriteRequest) SetValueOffset(v uint16)
- func (r PrepareWriteRequest) ValueOffset() uint16
- type PrepareWriteResponse
- func (r PrepareWriteResponse) AttributeHandle() uint16
- func (r PrepareWriteResponse) AttributeOpcode() uint8
- func (r PrepareWriteResponse) PartAttributeValue() []byte
- func (r PrepareWriteResponse) SetAttributeHandle(v uint16)
- func (r PrepareWriteResponse) SetAttributeOpcode()
- func (r PrepareWriteResponse) SetPartAttributeValue(v []byte)
- func (r PrepareWriteResponse) SetValueOffset(v uint16)
- func (r PrepareWriteResponse) ValueOffset() uint16
- type ReadBlobRequest
- type ReadBlobResponse
- type ReadByGroupTypeRequest
- func (r ReadByGroupTypeRequest) AttributeGroupType() []byte
- func (r ReadByGroupTypeRequest) AttributeOpcode() uint8
- func (r ReadByGroupTypeRequest) EndingHandle() uint16
- func (r ReadByGroupTypeRequest) SetAttributeGroupType(v []byte)
- func (r ReadByGroupTypeRequest) SetAttributeOpcode()
- func (r ReadByGroupTypeRequest) SetEndingHandle(v uint16)
- func (r ReadByGroupTypeRequest) SetStartingHandle(v uint16)
- func (r ReadByGroupTypeRequest) StartingHandle() uint16
- type ReadByGroupTypeResponse
- func (r ReadByGroupTypeResponse) AttributeDataList() []byte
- func (r ReadByGroupTypeResponse) AttributeOpcode() uint8
- func (r ReadByGroupTypeResponse) Length() uint8
- func (r ReadByGroupTypeResponse) SetAttributeDataList(v []byte)
- func (r ReadByGroupTypeResponse) SetAttributeOpcode()
- func (r ReadByGroupTypeResponse) SetLength(v uint8)
- type ReadByTypeRequest
- func (r ReadByTypeRequest) AttributeOpcode() uint8
- func (r ReadByTypeRequest) AttributeType() []byte
- func (r ReadByTypeRequest) EndingHandle() uint16
- func (r ReadByTypeRequest) SetAttributeOpcode()
- func (r ReadByTypeRequest) SetAttributeType(v []byte)
- func (r ReadByTypeRequest) SetEndingHandle(v uint16)
- func (r ReadByTypeRequest) SetStartingHandle(v uint16)
- func (r ReadByTypeRequest) StartingHandle() uint16
- type ReadByTypeResponse
- func (r ReadByTypeResponse) AttributeDataList() []byte
- func (r ReadByTypeResponse) AttributeOpcode() uint8
- func (r ReadByTypeResponse) Length() uint8
- func (r ReadByTypeResponse) SetAttributeDataList(v []byte)
- func (r ReadByTypeResponse) SetAttributeOpcode()
- func (r ReadByTypeResponse) SetLength(v uint8)
- type ReadMultipleRequest
- type ReadMultipleResponse
- type ReadRequest
- type ReadResponse
- type Server
- type SignedWriteCommand
- func (r SignedWriteCommand) AttributeHandle() uint16
- func (r SignedWriteCommand) AttributeOpcode() uint8
- func (r SignedWriteCommand) AttributeValue() []byte
- func (r SignedWriteCommand) AuthenticationSignature() [12]byte
- func (r SignedWriteCommand) SetAttributeHandle(v uint16)
- func (r SignedWriteCommand) SetAttributeOpcode()
- func (r SignedWriteCommand) SetAttributeValue(v []byte)
- func (r SignedWriteCommand) SetAuthenticationSignature(v [12]byte)
- type WriteCommand
- type WriteRequest
- type WriteResponse
Constants ¶
const ErrorResponseCode = 0x01
ErrorResponseCode ...
const ExchangeMTURequestCode = 0x02
ExchangeMTURequestCode ...
const ExchangeMTUResponseCode = 0x03
ExchangeMTUResponseCode ...
const ExecuteWriteRequestCode = 0x18
ExecuteWriteRequestCode ...
const ExecuteWriteResponseCode = 0x19
ExecuteWriteResponseCode ...
const FindByTypeValueRequestCode = 0x06
FindByTypeValueRequestCode ...
const FindByTypeValueResponseCode = 0x07
FindByTypeValueResponseCode ...
const FindInformationRequestCode = 0x04
FindInformationRequestCode ...
const FindInformationResponseCode = 0x05
FindInformationResponseCode ...
const HandleValueConfirmationCode = 0x1E
HandleValueConfirmationCode ...
const HandleValueIndicationCode = 0x1D
HandleValueIndicationCode ...
const HandleValueNotificationCode = 0x1B
HandleValueNotificationCode ...
const PrepareWriteRequestCode = 0x16
PrepareWriteRequestCode ...
const PrepareWriteResponseCode = 0x17
PrepareWriteResponseCode ...
const ReadBlobRequestCode = 0x0C
ReadBlobRequestCode ...
const ReadBlobResponseCode = 0x0D
ReadBlobResponseCode ...
const ReadByGroupTypeRequestCode = 0x10
ReadByGroupTypeRequestCode ...
const ReadByGroupTypeResponseCode = 0x11
ReadByGroupTypeResponseCode ...
const ReadByTypeRequestCode = 0x08
ReadByTypeRequestCode ...
const ReadByTypeResponseCode = 0x09
ReadByTypeResponseCode ...
const ReadMultipleRequestCode = 0x0E
ReadMultipleRequestCode ...
const ReadMultipleResponseCode = 0x0F
ReadMultipleResponseCode ...
const ReadRequestCode = 0x0A
ReadRequestCode ...
const ReadResponseCode = 0x0B
ReadResponseCode ...
const SignedWriteCommandCode = 0xD2
SignedWriteCommandCode ...
const WriteCommandCode = 0x52
WriteCommandCode ...
const WriteRequestCode = 0x12
WriteRequestCode ...
const WriteResponseCode = 0x13
WriteResponseCode ...
Variables ¶
var ( // ErrInvalidArgument means one or more of the arguments are invalid. ErrInvalidArgument = errors.New("invalid argument") // ErrInvalidResponse means one or more of the response fields are invalid. ErrInvalidResponse = errors.New("invalid response") // ErrSeqProtoTimeout means the request hasn't been acknowledged in 30 seconds. // [Vol 3, Part F, 3.3.3] ErrSeqProtoTimeout = errors.New("req timeout") )
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implementa an Attribute Protocol Client.
func NewClient ¶
func NewClient(l2c ble.Conn, h NotificationHandler) *Client
NewClient returns an Attribute Protocol Client.
func (*Client) ExchangeMTU ¶
ExchangeMTU informs the server of the client’s maximum receive MTU size and request the server to respond with its maximum receive MTU size. [Vol 3, Part F, 3.4.2.1]
func (*Client) ExecuteWrite ¶
ExecuteWrite requests the server to write or cancel the write of all the prepared values currently held in the prepare queue from this Client. This request shall be handled by the server as an atomic operation. [Vol 3, Part F, 3.4.6.3 & 3.4.6.4]
func (*Client) FindInformation ¶
FindInformation obtains the mapping of attribute handles with their associated types. This allows a Client to discover the list of attributes and their types on a server. [Vol 3, Part F, 3.4.3.1 & 3.4.3.2]
func (*Client) PrepareWrite ¶
func (c *Client) PrepareWrite(handle uint16, offset uint16, value []byte) (uint16, uint16, []byte, error)
PrepareWrite requests the server to prepare to write the value of an attribute. The server will respond to this request with a Prepare Write Response, so that the Client can verify that the value was received correctly. [Vol 3, Part F, 3.4.6.1 & 3.4.6.2]
func (*Client) Read ¶
Read requests the server to read the value of an attribute and return its value in a Read Response. [Vol 3, Part F, 3.4.4.3 & 3.4.4.4]
func (*Client) ReadBlob ¶
ReadBlob requests the server to read part of the value of an attribute at a given offset and return a specific part of the value in a Read Blob Response. [Vol 3, Part F, 3.4.4.5 & 3.4.4.6]
func (*Client) ReadByGroupType ¶
ReadByGroupType obtains the values of attributes where the attribute type is known, the type of a grouping attribute as defined by a higher layer specification, but the handle is not known. [Vol 3, Part F, 3.4.4.9 & 3.4.4.10]
func (*Client) ReadByType ¶
ReadByType obtains the values of attributes where the attribute type is known but the handle is not known. [Vol 3, Part F, 3.4.4.1 & 3.4.4.2]
func (*Client) ReadMultiple ¶
ReadMultiple requests the server to read two or more values of a set of attributes and return their values in a Read Multiple Response. Only values that have a known fixed size can be read, with the exception of the last value that can have a variable length. The knowledge of whether attributes have a known fixed size is defined in a higher layer specification. [Vol 3, Part F, 3.4.4.7 & 3.4.4.8]
func (*Client) SignedWrite ¶
SignedWrite requests the server to write the value of an attribute with an authentication signature, typically into a control-point attribute. [Vol 3, Part F, 3.4.5.4]
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
A DB is a contiguous range of attributes.
type ErrorResponse ¶
type ErrorResponse []byte
ErrorResponse implements Error Response (0x01) [Vol 3, Part E, 3.4.1.1].
func (ErrorResponse) AttributeInError ¶
func (r ErrorResponse) AttributeInError() uint16
AttributeInError ...
func (ErrorResponse) AttributeOpcode ¶
func (r ErrorResponse) AttributeOpcode() uint8
AttributeOpcode ...
func (ErrorResponse) RequestOpcodeInError ¶
func (r ErrorResponse) RequestOpcodeInError() uint8
RequestOpcodeInError ...
func (ErrorResponse) SetAttributeInError ¶
func (r ErrorResponse) SetAttributeInError(v uint16)
SetAttributeInError ...
func (ErrorResponse) SetAttributeOpcode ¶
func (r ErrorResponse) SetAttributeOpcode()
SetAttributeOpcode ...
func (ErrorResponse) SetRequestOpcodeInError ¶
func (r ErrorResponse) SetRequestOpcodeInError(v uint8)
SetRequestOpcodeInError ...
type ExchangeMTURequest ¶
type ExchangeMTURequest []byte
ExchangeMTURequest implements Exchange MTU Request (0x02) [Vol 3, Part E, 3.4.2.1].
func (ExchangeMTURequest) AttributeOpcode ¶
func (r ExchangeMTURequest) AttributeOpcode() uint8
AttributeOpcode ...
func (ExchangeMTURequest) ClientRxMTU ¶
func (r ExchangeMTURequest) ClientRxMTU() uint16
ClientRxMTU ...
func (ExchangeMTURequest) SetAttributeOpcode ¶
func (r ExchangeMTURequest) SetAttributeOpcode()
SetAttributeOpcode ...
func (ExchangeMTURequest) SetClientRxMTU ¶
func (r ExchangeMTURequest) SetClientRxMTU(v uint16)
SetClientRxMTU ...
type ExchangeMTUResponse ¶
type ExchangeMTUResponse []byte
ExchangeMTUResponse implements Exchange MTU Response (0x03) [Vol 3, Part E, 3.4.2.2].
func (ExchangeMTUResponse) AttributeOpcode ¶
func (r ExchangeMTUResponse) AttributeOpcode() uint8
AttributeOpcode ...
func (ExchangeMTUResponse) ServerRxMTU ¶
func (r ExchangeMTUResponse) ServerRxMTU() uint16
ServerRxMTU ...
func (ExchangeMTUResponse) SetAttributeOpcode ¶
func (r ExchangeMTUResponse) SetAttributeOpcode()
SetAttributeOpcode ...
func (ExchangeMTUResponse) SetServerRxMTU ¶
func (r ExchangeMTUResponse) SetServerRxMTU(v uint16)
SetServerRxMTU ...
type ExecuteWriteRequest ¶
type ExecuteWriteRequest []byte
ExecuteWriteRequest implements Execute Write Request (0x18) [Vol 3, Part E, 3.4.6.3].
func (ExecuteWriteRequest) AttributeOpcode ¶
func (r ExecuteWriteRequest) AttributeOpcode() uint8
AttributeOpcode ...
func (ExecuteWriteRequest) SetAttributeOpcode ¶
func (r ExecuteWriteRequest) SetAttributeOpcode()
SetAttributeOpcode ...
type ExecuteWriteResponse ¶
type ExecuteWriteResponse []byte
ExecuteWriteResponse implements Execute Write Response (0x19) [Vol 3, Part E, 3.4.6.4].
func (ExecuteWriteResponse) AttributeOpcode ¶
func (r ExecuteWriteResponse) AttributeOpcode() uint8
AttributeOpcode ...
func (ExecuteWriteResponse) SetAttributeOpcode ¶
func (r ExecuteWriteResponse) SetAttributeOpcode()
SetAttributeOpcode ...
type FindByTypeValueRequest ¶
type FindByTypeValueRequest []byte
FindByTypeValueRequest implements Find By Type Value Request (0x06) [Vol 3, Part E, 3.4.3.3].
func (FindByTypeValueRequest) AttributeOpcode ¶
func (r FindByTypeValueRequest) AttributeOpcode() uint8
AttributeOpcode ...
func (FindByTypeValueRequest) AttributeType ¶
func (r FindByTypeValueRequest) AttributeType() uint16
AttributeType ...
func (FindByTypeValueRequest) AttributeValue ¶
func (r FindByTypeValueRequest) AttributeValue() []byte
AttributeValue ...
func (FindByTypeValueRequest) EndingHandle ¶
func (r FindByTypeValueRequest) EndingHandle() uint16
EndingHandle ...
func (FindByTypeValueRequest) SetAttributeOpcode ¶
func (r FindByTypeValueRequest) SetAttributeOpcode()
SetAttributeOpcode ...
func (FindByTypeValueRequest) SetAttributeType ¶
func (r FindByTypeValueRequest) SetAttributeType(v uint16)
SetAttributeType ...
func (FindByTypeValueRequest) SetAttributeValue ¶
func (r FindByTypeValueRequest) SetAttributeValue(v []byte)
SetAttributeValue ...
func (FindByTypeValueRequest) SetEndingHandle ¶
func (r FindByTypeValueRequest) SetEndingHandle(v uint16)
SetEndingHandle ...
func (FindByTypeValueRequest) SetStartingHandle ¶
func (r FindByTypeValueRequest) SetStartingHandle(v uint16)
SetStartingHandle ...
func (FindByTypeValueRequest) StartingHandle ¶
func (r FindByTypeValueRequest) StartingHandle() uint16
StartingHandle ...
type FindByTypeValueResponse ¶
type FindByTypeValueResponse []byte
FindByTypeValueResponse implements Find By Type Value Response (0x07) [Vol 3, Part E, 3.4.3.4].
func (FindByTypeValueResponse) AttributeOpcode ¶
func (r FindByTypeValueResponse) AttributeOpcode() uint8
AttributeOpcode ...
func (FindByTypeValueResponse) HandleInformationList ¶
func (r FindByTypeValueResponse) HandleInformationList() []byte
HandleInformationList ...
func (FindByTypeValueResponse) SetAttributeOpcode ¶
func (r FindByTypeValueResponse) SetAttributeOpcode()
SetAttributeOpcode ...
func (FindByTypeValueResponse) SetHandleInformationList ¶
func (r FindByTypeValueResponse) SetHandleInformationList(v []byte)
SetHandleInformationList ...
type FindInformationRequest ¶
type FindInformationRequest []byte
FindInformationRequest implements Find Information Request (0x04) [Vol 3, Part E, 3.4.3.1].
func (FindInformationRequest) AttributeOpcode ¶
func (r FindInformationRequest) AttributeOpcode() uint8
AttributeOpcode ...
func (FindInformationRequest) EndingHandle ¶
func (r FindInformationRequest) EndingHandle() uint16
EndingHandle ...
func (FindInformationRequest) SetAttributeOpcode ¶
func (r FindInformationRequest) SetAttributeOpcode()
SetAttributeOpcode ...
func (FindInformationRequest) SetEndingHandle ¶
func (r FindInformationRequest) SetEndingHandle(v uint16)
SetEndingHandle ...
func (FindInformationRequest) SetStartingHandle ¶
func (r FindInformationRequest) SetStartingHandle(v uint16)
SetStartingHandle ...
func (FindInformationRequest) StartingHandle ¶
func (r FindInformationRequest) StartingHandle() uint16
StartingHandle ...
type FindInformationResponse ¶
type FindInformationResponse []byte
FindInformationResponse implements Find Information Response (0x05) [Vol 3, Part E, 3.4.3.2].
func (FindInformationResponse) AttributeOpcode ¶
func (r FindInformationResponse) AttributeOpcode() uint8
AttributeOpcode ...
func (FindInformationResponse) InformationData ¶
func (r FindInformationResponse) InformationData() []byte
InformationData ...
func (FindInformationResponse) SetAttributeOpcode ¶
func (r FindInformationResponse) SetAttributeOpcode()
SetAttributeOpcode ...
func (FindInformationResponse) SetFormat ¶
func (r FindInformationResponse) SetFormat(v uint8)
SetFormat ...
func (FindInformationResponse) SetInformationData ¶
func (r FindInformationResponse) SetInformationData(v []byte)
SetInformationData ...
type HandleValueConfirmation ¶
type HandleValueConfirmation []byte
HandleValueConfirmation implements Handle Value Confirmation (0x1E) [Vol 3, Part E, 3.4.7.3].
func (HandleValueConfirmation) AttributeOpcode ¶
func (r HandleValueConfirmation) AttributeOpcode() uint8
AttributeOpcode ...
func (HandleValueConfirmation) SetAttributeOpcode ¶
func (r HandleValueConfirmation) SetAttributeOpcode()
SetAttributeOpcode ...
type HandleValueIndication ¶
type HandleValueIndication []byte
HandleValueIndication implements Handle Value Indication (0x1D) [Vol 3, Part E, 3.4.7.2].
func (HandleValueIndication) AttributeHandle ¶
func (r HandleValueIndication) AttributeHandle() uint16
AttributeHandle ...
func (HandleValueIndication) AttributeOpcode ¶
func (r HandleValueIndication) AttributeOpcode() uint8
AttributeOpcode ...
func (HandleValueIndication) AttributeValue ¶
func (r HandleValueIndication) AttributeValue() []byte
AttributeValue ...
func (HandleValueIndication) SetAttributeHandle ¶
func (r HandleValueIndication) SetAttributeHandle(v uint16)
SetAttributeHandle ...
func (HandleValueIndication) SetAttributeOpcode ¶
func (r HandleValueIndication) SetAttributeOpcode()
SetAttributeOpcode ...
func (HandleValueIndication) SetAttributeValue ¶
func (r HandleValueIndication) SetAttributeValue(v []byte)
SetAttributeValue ...
type HandleValueNotification ¶
type HandleValueNotification []byte
HandleValueNotification implements Handle Value Notification (0x1B) [Vol 3, Part E, 3.4.7.1].
func (HandleValueNotification) AttributeHandle ¶
func (r HandleValueNotification) AttributeHandle() uint16
AttributeHandle ...
func (HandleValueNotification) AttributeOpcode ¶
func (r HandleValueNotification) AttributeOpcode() uint8
AttributeOpcode ...
func (HandleValueNotification) AttributeValue ¶
func (r HandleValueNotification) AttributeValue() []byte
AttributeValue ...
func (HandleValueNotification) SetAttributeHandle ¶
func (r HandleValueNotification) SetAttributeHandle(v uint16)
SetAttributeHandle ...
func (HandleValueNotification) SetAttributeOpcode ¶
func (r HandleValueNotification) SetAttributeOpcode()
SetAttributeOpcode ...
func (HandleValueNotification) SetAttributeValue ¶
func (r HandleValueNotification) SetAttributeValue(v []byte)
SetAttributeValue ...
type NotificationHandler ¶
type NotificationHandler interface {
HandleNotification(req []byte)
}
NotificationHandler handles notification or indication.
type PrepareWriteRequest ¶
type PrepareWriteRequest []byte
PrepareWriteRequest implements Prepare Write Request (0x16) [Vol 3, Part E, 3.4.6.1].
func (PrepareWriteRequest) AttributeHandle ¶
func (r PrepareWriteRequest) AttributeHandle() uint16
AttributeHandle ...
func (PrepareWriteRequest) AttributeOpcode ¶
func (r PrepareWriteRequest) AttributeOpcode() uint8
AttributeOpcode ...
func (PrepareWriteRequest) PartAttributeValue ¶
func (r PrepareWriteRequest) PartAttributeValue() []byte
PartAttributeValue ...
func (PrepareWriteRequest) SetAttributeHandle ¶
func (r PrepareWriteRequest) SetAttributeHandle(v uint16)
SetAttributeHandle ...
func (PrepareWriteRequest) SetAttributeOpcode ¶
func (r PrepareWriteRequest) SetAttributeOpcode()
SetAttributeOpcode ...
func (PrepareWriteRequest) SetPartAttributeValue ¶
func (r PrepareWriteRequest) SetPartAttributeValue(v []byte)
SetPartAttributeValue ...
func (PrepareWriteRequest) SetValueOffset ¶
func (r PrepareWriteRequest) SetValueOffset(v uint16)
SetValueOffset ...
func (PrepareWriteRequest) ValueOffset ¶
func (r PrepareWriteRequest) ValueOffset() uint16
ValueOffset ...
type PrepareWriteResponse ¶
type PrepareWriteResponse []byte
PrepareWriteResponse implements Prepare Write Response (0x17) [Vol 3, Part E, 3.4.6.2].
func (PrepareWriteResponse) AttributeHandle ¶
func (r PrepareWriteResponse) AttributeHandle() uint16
AttributeHandle ...
func (PrepareWriteResponse) AttributeOpcode ¶
func (r PrepareWriteResponse) AttributeOpcode() uint8
AttributeOpcode ...
func (PrepareWriteResponse) PartAttributeValue ¶
func (r PrepareWriteResponse) PartAttributeValue() []byte
PartAttributeValue ...
func (PrepareWriteResponse) SetAttributeHandle ¶
func (r PrepareWriteResponse) SetAttributeHandle(v uint16)
SetAttributeHandle ...
func (PrepareWriteResponse) SetAttributeOpcode ¶
func (r PrepareWriteResponse) SetAttributeOpcode()
SetAttributeOpcode ...
func (PrepareWriteResponse) SetPartAttributeValue ¶
func (r PrepareWriteResponse) SetPartAttributeValue(v []byte)
SetPartAttributeValue ...
func (PrepareWriteResponse) SetValueOffset ¶
func (r PrepareWriteResponse) SetValueOffset(v uint16)
SetValueOffset ...
func (PrepareWriteResponse) ValueOffset ¶
func (r PrepareWriteResponse) ValueOffset() uint16
ValueOffset ...
type ReadBlobRequest ¶
type ReadBlobRequest []byte
ReadBlobRequest implements Read Blob Request (0x0C) [Vol 3, Part E, 3.4.4.5].
func (ReadBlobRequest) AttributeHandle ¶
func (r ReadBlobRequest) AttributeHandle() uint16
AttributeHandle ...
func (ReadBlobRequest) AttributeOpcode ¶
func (r ReadBlobRequest) AttributeOpcode() uint8
AttributeOpcode ...
func (ReadBlobRequest) SetAttributeHandle ¶
func (r ReadBlobRequest) SetAttributeHandle(v uint16)
SetAttributeHandle ...
func (ReadBlobRequest) SetAttributeOpcode ¶
func (r ReadBlobRequest) SetAttributeOpcode()
SetAttributeOpcode ...
func (ReadBlobRequest) SetValueOffset ¶
func (r ReadBlobRequest) SetValueOffset(v uint16)
SetValueOffset ...
type ReadBlobResponse ¶
type ReadBlobResponse []byte
ReadBlobResponse implements Read Blob Response (0x0D) [Vol 3, Part E, 3.4.4.6].
func (ReadBlobResponse) AttributeOpcode ¶
func (r ReadBlobResponse) AttributeOpcode() uint8
AttributeOpcode ...
func (ReadBlobResponse) PartAttributeValue ¶
func (r ReadBlobResponse) PartAttributeValue() []byte
PartAttributeValue ...
func (ReadBlobResponse) SetAttributeOpcode ¶
func (r ReadBlobResponse) SetAttributeOpcode()
SetAttributeOpcode ...
func (ReadBlobResponse) SetPartAttributeValue ¶
func (r ReadBlobResponse) SetPartAttributeValue(v []byte)
SetPartAttributeValue ...
type ReadByGroupTypeRequest ¶
type ReadByGroupTypeRequest []byte
ReadByGroupTypeRequest implements Read By Group Type Request (0x10) [Vol 3, Part E, 3.4.4.9].
func (ReadByGroupTypeRequest) AttributeGroupType ¶
func (r ReadByGroupTypeRequest) AttributeGroupType() []byte
AttributeGroupType ...
func (ReadByGroupTypeRequest) AttributeOpcode ¶
func (r ReadByGroupTypeRequest) AttributeOpcode() uint8
AttributeOpcode ...
func (ReadByGroupTypeRequest) EndingHandle ¶
func (r ReadByGroupTypeRequest) EndingHandle() uint16
EndingHandle ...
func (ReadByGroupTypeRequest) SetAttributeGroupType ¶
func (r ReadByGroupTypeRequest) SetAttributeGroupType(v []byte)
SetAttributeGroupType ...
func (ReadByGroupTypeRequest) SetAttributeOpcode ¶
func (r ReadByGroupTypeRequest) SetAttributeOpcode()
SetAttributeOpcode ...
func (ReadByGroupTypeRequest) SetEndingHandle ¶
func (r ReadByGroupTypeRequest) SetEndingHandle(v uint16)
SetEndingHandle ...
func (ReadByGroupTypeRequest) SetStartingHandle ¶
func (r ReadByGroupTypeRequest) SetStartingHandle(v uint16)
SetStartingHandle ...
func (ReadByGroupTypeRequest) StartingHandle ¶
func (r ReadByGroupTypeRequest) StartingHandle() uint16
StartingHandle ...
type ReadByGroupTypeResponse ¶
type ReadByGroupTypeResponse []byte
ReadByGroupTypeResponse implements Read By Group Type Response (0x11) [Vol 3, Part E, 3.4.4.10].
func (ReadByGroupTypeResponse) AttributeDataList ¶
func (r ReadByGroupTypeResponse) AttributeDataList() []byte
AttributeDataList ...
func (ReadByGroupTypeResponse) AttributeOpcode ¶
func (r ReadByGroupTypeResponse) AttributeOpcode() uint8
AttributeOpcode ...
func (ReadByGroupTypeResponse) SetAttributeDataList ¶
func (r ReadByGroupTypeResponse) SetAttributeDataList(v []byte)
SetAttributeDataList ...
func (ReadByGroupTypeResponse) SetAttributeOpcode ¶
func (r ReadByGroupTypeResponse) SetAttributeOpcode()
SetAttributeOpcode ...
func (ReadByGroupTypeResponse) SetLength ¶
func (r ReadByGroupTypeResponse) SetLength(v uint8)
SetLength ...
type ReadByTypeRequest ¶
type ReadByTypeRequest []byte
ReadByTypeRequest implements Read By Type Request (0x08) [Vol 3, Part E, 3.4.4.1].
func (ReadByTypeRequest) AttributeOpcode ¶
func (r ReadByTypeRequest) AttributeOpcode() uint8
AttributeOpcode ...
func (ReadByTypeRequest) AttributeType ¶
func (r ReadByTypeRequest) AttributeType() []byte
AttributeType ...
func (ReadByTypeRequest) EndingHandle ¶
func (r ReadByTypeRequest) EndingHandle() uint16
EndingHandle ...
func (ReadByTypeRequest) SetAttributeOpcode ¶
func (r ReadByTypeRequest) SetAttributeOpcode()
SetAttributeOpcode ...
func (ReadByTypeRequest) SetAttributeType ¶
func (r ReadByTypeRequest) SetAttributeType(v []byte)
SetAttributeType ...
func (ReadByTypeRequest) SetEndingHandle ¶
func (r ReadByTypeRequest) SetEndingHandle(v uint16)
SetEndingHandle ...
func (ReadByTypeRequest) SetStartingHandle ¶
func (r ReadByTypeRequest) SetStartingHandle(v uint16)
SetStartingHandle ...
func (ReadByTypeRequest) StartingHandle ¶
func (r ReadByTypeRequest) StartingHandle() uint16
StartingHandle ...
type ReadByTypeResponse ¶
type ReadByTypeResponse []byte
ReadByTypeResponse implements Read By Type Response (0x09) [Vol 3, Part E, 3.4.4.2].
func (ReadByTypeResponse) AttributeDataList ¶
func (r ReadByTypeResponse) AttributeDataList() []byte
AttributeDataList ...
func (ReadByTypeResponse) AttributeOpcode ¶
func (r ReadByTypeResponse) AttributeOpcode() uint8
AttributeOpcode ...
func (ReadByTypeResponse) SetAttributeDataList ¶
func (r ReadByTypeResponse) SetAttributeDataList(v []byte)
SetAttributeDataList ...
func (ReadByTypeResponse) SetAttributeOpcode ¶
func (r ReadByTypeResponse) SetAttributeOpcode()
SetAttributeOpcode ...
type ReadMultipleRequest ¶
type ReadMultipleRequest []byte
ReadMultipleRequest implements Read Multiple Request (0x0E) [Vol 3, Part E, 3.4.4.7].
func (ReadMultipleRequest) AttributeOpcode ¶
func (r ReadMultipleRequest) AttributeOpcode() uint8
AttributeOpcode ...
func (ReadMultipleRequest) SetAttributeOpcode ¶
func (r ReadMultipleRequest) SetAttributeOpcode()
SetAttributeOpcode ...
func (ReadMultipleRequest) SetOfHandles ¶
func (r ReadMultipleRequest) SetOfHandles() []byte
SetOfHandles ...
func (ReadMultipleRequest) SetSetOfHandles ¶
func (r ReadMultipleRequest) SetSetOfHandles(v []byte)
SetSetOfHandles ...
type ReadMultipleResponse ¶
type ReadMultipleResponse []byte
ReadMultipleResponse implements Read Multiple Response (0x0F) [Vol 3, Part E, 3.4.4.8].
func (ReadMultipleResponse) AttributeOpcode ¶
func (r ReadMultipleResponse) AttributeOpcode() uint8
AttributeOpcode ...
func (ReadMultipleResponse) SetAttributeOpcode ¶
func (r ReadMultipleResponse) SetAttributeOpcode()
SetAttributeOpcode ...
func (ReadMultipleResponse) SetOfValues ¶
func (r ReadMultipleResponse) SetOfValues() []byte
SetOfValues ...
func (ReadMultipleResponse) SetSetOfValues ¶
func (r ReadMultipleResponse) SetSetOfValues(v []byte)
SetSetOfValues ...
type ReadRequest ¶
type ReadRequest []byte
ReadRequest implements Read Request (0x0A) [Vol 3, Part E, 3.4.4.3].
func (ReadRequest) AttributeHandle ¶
func (r ReadRequest) AttributeHandle() uint16
AttributeHandle ...
func (ReadRequest) AttributeOpcode ¶
func (r ReadRequest) AttributeOpcode() uint8
AttributeOpcode ...
func (ReadRequest) SetAttributeHandle ¶
func (r ReadRequest) SetAttributeHandle(v uint16)
SetAttributeHandle ...
func (ReadRequest) SetAttributeOpcode ¶
func (r ReadRequest) SetAttributeOpcode()
SetAttributeOpcode ...
type ReadResponse ¶
type ReadResponse []byte
ReadResponse implements Read Response (0x0B) [Vol 3, Part E, 3.4.4.4].
func (ReadResponse) AttributeOpcode ¶
func (r ReadResponse) AttributeOpcode() uint8
AttributeOpcode ...
func (ReadResponse) AttributeValue ¶
func (r ReadResponse) AttributeValue() []byte
AttributeValue ...
func (ReadResponse) SetAttributeOpcode ¶
func (r ReadResponse) SetAttributeOpcode()
SetAttributeOpcode ...
func (ReadResponse) SetAttributeValue ¶
func (r ReadResponse) SetAttributeValue(v []byte)
SetAttributeValue ...
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implementas an ATT (Attribute Protocol) server.
type SignedWriteCommand ¶
type SignedWriteCommand []byte
SignedWriteCommand implements Signed Write Command (0xD2) [Vol 3, Part E, 3.4.5.4].
func (SignedWriteCommand) AttributeHandle ¶
func (r SignedWriteCommand) AttributeHandle() uint16
AttributeHandle ...
func (SignedWriteCommand) AttributeOpcode ¶
func (r SignedWriteCommand) AttributeOpcode() uint8
AttributeOpcode ...
func (SignedWriteCommand) AttributeValue ¶
func (r SignedWriteCommand) AttributeValue() []byte
AttributeValue ...
func (SignedWriteCommand) AuthenticationSignature ¶
func (r SignedWriteCommand) AuthenticationSignature() [12]byte
AuthenticationSignature ...
func (SignedWriteCommand) SetAttributeHandle ¶
func (r SignedWriteCommand) SetAttributeHandle(v uint16)
SetAttributeHandle ...
func (SignedWriteCommand) SetAttributeOpcode ¶
func (r SignedWriteCommand) SetAttributeOpcode()
SetAttributeOpcode ...
func (SignedWriteCommand) SetAttributeValue ¶
func (r SignedWriteCommand) SetAttributeValue(v []byte)
SetAttributeValue ...
func (SignedWriteCommand) SetAuthenticationSignature ¶
func (r SignedWriteCommand) SetAuthenticationSignature(v [12]byte)
SetAuthenticationSignature ...
type WriteCommand ¶
type WriteCommand []byte
WriteCommand implements Write Command (0x52) [Vol 3, Part E, 3.4.5.3].
func (WriteCommand) AttributeHandle ¶
func (r WriteCommand) AttributeHandle() uint16
AttributeHandle ...
func (WriteCommand) AttributeOpcode ¶
func (r WriteCommand) AttributeOpcode() uint8
AttributeOpcode ...
func (WriteCommand) AttributeValue ¶
func (r WriteCommand) AttributeValue() []byte
AttributeValue ...
func (WriteCommand) SetAttributeHandle ¶
func (r WriteCommand) SetAttributeHandle(v uint16)
SetAttributeHandle ...
func (WriteCommand) SetAttributeOpcode ¶
func (r WriteCommand) SetAttributeOpcode()
SetAttributeOpcode ...
func (WriteCommand) SetAttributeValue ¶
func (r WriteCommand) SetAttributeValue(v []byte)
SetAttributeValue ...
type WriteRequest ¶
type WriteRequest []byte
WriteRequest implements Write Request (0x12) [Vol 3, Part E, 3.4.5.1].
func (WriteRequest) AttributeHandle ¶
func (r WriteRequest) AttributeHandle() uint16
AttributeHandle ...
func (WriteRequest) AttributeOpcode ¶
func (r WriteRequest) AttributeOpcode() uint8
AttributeOpcode ...
func (WriteRequest) AttributeValue ¶
func (r WriteRequest) AttributeValue() []byte
AttributeValue ...
func (WriteRequest) SetAttributeHandle ¶
func (r WriteRequest) SetAttributeHandle(v uint16)
SetAttributeHandle ...
func (WriteRequest) SetAttributeOpcode ¶
func (r WriteRequest) SetAttributeOpcode()
SetAttributeOpcode ...
func (WriteRequest) SetAttributeValue ¶
func (r WriteRequest) SetAttributeValue(v []byte)
SetAttributeValue ...
type WriteResponse ¶
type WriteResponse []byte
WriteResponse implements Write Response (0x13) [Vol 3, Part E, 3.4.5.2].
func (WriteResponse) AttributeOpcode ¶
func (r WriteResponse) AttributeOpcode() uint8
AttributeOpcode ...
func (WriteResponse) SetAttributeOpcode ¶
func (r WriteResponse) SetAttributeOpcode()
SetAttributeOpcode ...