harald v0.1.1 Harald.HCI View Source

The HCI provides a uniform interface method of accessing a Bluetooth Controller’s capabilities.

Reference: Version 5.0, Vol. 2, Part E, 1

Link to this section Summary

Types

OpCode Command Field

OpCode Group Field

Each command is assigned a 2 byte Opcode used to uniquely identify different types of commands. The Opcode parameter is divided into two fields, called the OpCode Group Field (OGF) and OpCode Command Field (OCF). The OGF occupies the upper 6 bits of the Opcode, while the OCF occupies the remaining 10 bits. The OGF of 0x3F is reserved for vendor-specific debug commands. The organization of the opcodes allows additional information to be inferred without fully decoding the entire Opcode

Link to this section Types

Link to this type

command() View Source
command() :: <<_::8, _::_*8>>

Link to this type

ocf() View Source
ocf() :: 0..1023

OpCode Command Field.

See opcode/0

OpCode Group Field.

See opcode/0

Each command is assigned a 2 byte Opcode used to uniquely identify different types of commands. The Opcode parameter is divided into two fields, called the OpCode Group Field (OGF) and OpCode Command Field (OCF). The OGF occupies the upper 6 bits of the Opcode, while the OCF occupies the remaining 10 bits. The OGF of 0x3F is reserved for vendor-specific debug commands. The organization of the opcodes allows additional information to be inferred without fully decoding the entire Opcode.

Reference: Version 5.0, Vol. 2, Part E, 5.4.1

Link to this section Functions

Link to this function

command(opcode, opts \\ "") View Source
command(opcode(), opts()) :: command()

Link to this function

opcode(ogf, ocf) View Source
opcode(ogf(), ocf()) :: opcode()

Convert a value to a binary.

iex> to_bin(false)
<<0>>

iex> to_bin(true)
<<1>>

iex> to_bin(<<1, 2, 3>>)
<<1, 2, 3>>