Enum rubble::att::pdus::Opcode[][src]

pub enum Opcode {
Show 29 variants ErrorRsp, ExchangeMtuReq, ExchangeMtuRsp, FindInformationReq, FindInformationRsp, FindByTypeValueReq, FindByTypeValueRsp, ReadByTypeReq, ReadByTypeRsp, ReadReq, ReadRsp, ReadBlobReq, ReadBlobRsp, ReadMultipleReq, ReadMultipleRsp, ReadByGroupReq, ReadByGroupRsp, WriteReq, WriteRsp, WriteCommand, SignedWriteCommand, PrepareWriteReq, PrepareWriteRsp, ExecuteWriteReq, ExecuteWriteRsp, HandleValueNotification, HandleValueIndication, HandleValueConfirmation, Unknown(u8),
}
Expand description

Specifies an ATT operation to perform.

The byte values assigned to opcodes are chosen so that the most significant 2 bits indicate additional information that can be useful in some cases:

MSb                            LSb
+-----------+---------+----------+
| Signature | Command |  Method  |
|   1 bit   |  1 bit  |  6 bits  |
+-----------+---------+----------+
  • Signature is set to 1 to indicate that the Attribute Opcode and Parameters are followed by an Authentication Signature. This is only allowed for the Write Command, resulting in the SignedWriteCommand.
  • Command is set to 1 when the PDU is a command. This is done purely so that the server can ignore unknown commands. Unlike Requests, Commands are not followed by a server response.
  • Method defines which operation to perform.

Variants

ErrorRsp
ExchangeMtuReq
ExchangeMtuRsp
FindInformationReq
FindInformationRsp
FindByTypeValueReq
FindByTypeValueRsp
ReadByTypeReq
ReadByTypeRsp
ReadReq
ReadRsp
ReadBlobReq
ReadBlobRsp
ReadMultipleReq
ReadMultipleRsp
ReadByGroupReq
ReadByGroupRsp
WriteReq
WriteRsp
WriteCommand
SignedWriteCommand
PrepareWriteReq
PrepareWriteRsp
ExecuteWriteReq
ExecuteWriteRsp
HandleValueNotification
HandleValueIndication
HandleValueConfirmation
Unknown(u8)

Tuple Fields of Unknown

0: u8

Implementations

Returns the raw byte corresponding to the opcode self.

Returns whether the Signature bit in this opcode is set.

If the bit is set, this is an authenticated operation. The opcode parameters are followed by a 12-Byte signature.

Returns whether the Command bit in this opcode is set.

Commands sent to the server are not followed by a server response (ie. it is not indicated whether they succeed). Unimplemented commands should be ignored, according to the spec.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.