blob: fc813e645fb6e23b8861ebae7d1dbb413a29adc9 [file] [log] [blame]
# Copyright 2023 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
# This file contains Emboss packet definitions for extensions to the Bluetooth
# Host-Controller interface. These extensions are not standardized through the
# Bluetooth SIG.
#
# NOTE: The definitions below are incomplete. They get added as needed.
# This list will grow as we support more vendor features.
import "pw_bluetooth/hci_common.emb" as hci
[$default byte_order: "LittleEndian"]
[(cpp) namespace: "pw::bluetooth::vendor::android_hci"]
# ======================= Android HCI extensions ===============================
# Documentation: https://source.android.com/devices/bluetooth/hci_requirements
# ------------------------ HCI packet headers ----------------------------------
struct AndroidCommandHeader:
-- HCI Vendor Command packet header.
let hdr_size = hci.CommandHeader.$size_in_bytes
0 [+hdr_size] hci.CommandHeader header
$next [+1] UInt sub_opcode
# ----------------------- Get Vendor Capabilities ------------------------------
enum Capability:
[maximum_bits: 8]
NOT_CAPABLE = 0x00
CAPABLE = 0x01
struct LEGetVendorCapabilitiesCommand:
let hdr_size = hci.CommandHeader.$size_in_bytes
0 [+hdr_size] hci.CommandHeader header
struct LEGetVendorCapabilitiesCommandCompleteEvent:
# NOTE: There can be various versions of this command complete event sent by
# the Controller. As fields are added, the version_supported field is
# incremented to signify which fields are available. The version_supported
# field was only introduced into the command in Version 0.95. Controllers that
# use the base version, Version 0.55, don't have the version_supported field.
#
# NOTE(https://pwrev.dev/203950): In a previous undertaking, we attempted to
# use Emboss' conditional fields feature to conditionally define fields based
# on the version they are included in. However, in practice
# (https://fxbug.dev/332924195#comment6), we've found vendors sometimes send
# the wrong number of bytes for the version they are claiming to send. To
# tolerate these types of errors without issue, we simply define all the
# fields in Emboss and do error checking more manually.
#
# NOTE: Android's definition for this command complete event is available in
# AOSP: LeGetVendorCapabilitiesComplete and friends
# https://cs.android.com/android/platform/superproject/+/main:packages/modules/Bluetooth/system/gd/hci/hci_packets.pdl
#
# NOTE: An example implementation of how this command is filled in by a
# Controller is available within AOSP:
# le_get_vendor_capabilities_handler(...)
# https://cs.android.com/android/platform/superproject/main/+/main:packages/modules/Bluetooth/system/gd/hci/controller.cc
let hdr_size = hci.CommandCompleteEvent.$size_in_bytes
0 [+hdr_size] hci.CommandCompleteEvent command_complete
# Version 0.55
# NOTE(https://github.com/google/emboss/issues/132): Emboss doesn't currently
# support using the $next keyword here.
let version_0_55_size = command_complete.$size_in_bytes+9
$next [+1] hci.StatusCode status
$next [+1] UInt max_advt_instances
-- Number of advertisement instances supported
-- Deprecated in Google feature spec v0.98 and higher
$next [+1] Capability offloaded_resolution_of_private_address
-- BT chip capability of RPA
-- Deprecated in Google feature spec v0.98 and higher
$next [+2] UInt total_scan_results_storage
-- Storage for scan results in bytes
$next [+1] UInt max_irk_list_sz
-- Number of IRK entries supported in the firmware
$next [+1] Capability filtering_support
-- Support for filtering in the controller
$next [+1] UInt max_filter
-- Number of filters supported
$next [+1] Capability activity_energy_info_support
-- Supports reporting of activity and energy information
# Version 0.95
let version_0_95_size = version_0_55_size+6
$next [+2] bits version_supported:
-- Specifies the version of the Google feature spec supported
0 [+8] UInt major_number
$next [+8] UInt minor_number
$next [+2] UInt total_num_of_advt_tracked
-- Total number of advertisers tracked for OnLost/OnFound purposes
$next [+1] Capability extended_scan_support
-- Supports extended scan window and interval
$next [+1] Capability debug_logging_supported
-- Supports logging of binary debug information from controller
# Version 0.96
let version_0_96_size = version_0_95_size+1
$next [+1] Capability le_address_generation_offloading_support
-- Deprecated in Google feature spec v0.98 and higher
# Version 0.98
let version_0_98_size = version_0_96_size+5
$next [+4] bits:
0 [+5] AudioCodecSupportMask a2dp_source_offload_capability_mask
$next [+1] Capability bluetooth_quality_report_support
-- Supports reporting of Bluetooth Quality events
# Version 1.03
let version_1_03_size = version_0_98_size+4
$next [+4] bits:
0 [+5] AudioCodecSupportMask dynamic_audio_buffer_support
# Version 1.04
let version_1_04_size = version_1_03_size+1
$next [+1] Capability a2dp_offload_v2_support
# ----------------------- A2DP Offloading --------------------------------------
bits AudioCodecSupportMask:
0 [+1] Flag sbc
1 [+1] Flag aac
2 [+1] Flag aptx
3 [+1] Flag aptx_hd
4 [+1] Flag ldac
enum A2dpCodecType:
[maximum_bits: 8]
SBC = 0x01
AAC = 0x02
APTX = 0x04
APTX_HD = 0x08
LDAC = 0x10
struct A2dpScmsTEnable:
0 [+1] hci.GenericEnableParam enabled
$next [+1] UInt header
enum A2dpSamplingFrequency:
[maximum_bits: 8]
HZ_44100 = 0x01
HZ_48000 = 0x02
HZ_88200 = 0x04
HZ_96000 = 0x08
enum A2dpBitsPerSample:
[maximum_bits: 8]
BITS_PER_SAMPLE_16 = 0x01
BITS_PER_SAMPLE_24 = 0x02
BITS_PER_SAMPLE_32 = 0x04
enum A2dpChannelMode:
[maximum_bits: 8]
MONO = 0x01
STEREO = 0x02
enum SbcSamplingFrequency:
[maximum_bits: 4]
HZ_48000 = 0x01
HZ_44100 = 0x02
HZ_32000 = 0x04
HZ_16000 = 0x08
enum SbcChannelMode:
[maximum_bits: 4]
JOINT_STEREO = 0x01
STEREO = 0x02
DUAL_CHANNEL = 0x04
MONO = 0x08
enum SbcBlockLen:
[maximum_bits: 4]
BLOCK_LEN_16 = 0x01
BLOCK_LEN_12 = 0x02
BLOCK_LEN_8 = 0x04
BLOCK_LEN_4 = 0x08
enum SbcSubBands:
[maximum_bits: 2]
SUBBANDS_8 = 0x01
SUBBANDS_4 = 0x02
enum SbcAllocationMethod:
[maximum_bits: 2]
LOUDNESS = 0x01
SNR = 0x02
enum AacEnableVariableBitRate:
-- 1-octet boolean "enable"/"disable" parameter for AAC variable bitrate
[maximum_bits: 8]
DISABLE = 0x00
ENABLE = 0x80
enum LdacBitrateIndex:
-- Values 0x03 - 0x7E are reserved
-- Values 0x80 - 0xFF are reserved
[maximum_bits: 8]
HIGH = 0x00
MID = 0x01
LOW = 0x02
ADAPTIVE_BITRATE = 0x7F
bits LdacChannelMode:
-- Bitmask values for LDAC Channel Mode
0 [+1] Flag stereo
1 [+1] Flag dual
2 [+1] Flag mono
struct SbcCodecInformation:
0 [+1] bits:
0 [+2] SbcAllocationMethod allocation_method
$next [+2] SbcSubBands subbands
$next [+4] SbcBlockLen block_length
$next [+1] UInt min_bitpool_value
$next [+1] UInt max_bitpool_value
$next [+1] bits:
0 [+4] SbcChannelMode channel_mode
$next [+4] SbcSamplingFrequency sampling_frequency
$next [+28] UInt:8[28] reserved
struct AacCodecInformation:
0 [+1] UInt object_type
$next [+1] AacEnableVariableBitRate variable_bit_rate
$next [+30] UInt:8[30] reserved
struct LdacCodecInformation:
0 [+4] UInt vendor_id
-- Must always be set to kLdacVendorId
$next [+2] UInt codec_id
-- Must always be set to kLdacCodecId
-- All other values are reserved
$next [+1] LdacBitrateIndex bitrate_index
-- See enum class LdacBitrateIndex in this file for possible values
$next [+1] bits:
0 [+3] LdacChannelMode ldac_channel_mode
-- Bitmask: LDAC channel mode (see LdacChannelMode for bitmask values)
$next [+24] UInt:8[24] reserved
struct AptxCodecInformation:
0 [+32] UInt:8[32] reserved
enum A2dpOffloadSubOpcode:
START_LEGACY = 0x01
STOP_LEGACY = 0x02
START = 0x03
STOP = 0x04
struct A2dpOffloadCommandCompleteEvent:
let hdr_size = hci.CommandCompleteEvent.$size_in_bytes
0 [+hdr_size] hci.CommandCompleteEvent command_complete
$next [+1] hci.StatusCode status
$next [+1] A2dpOffloadSubOpcode sub_opcode
struct StartA2dpOffloadCommand:
-- TODO(b/321089008): This definition is actually the legacy version of this
-- command. There is a non-legacy version as well. We should rename this and
-- the other start/stop commands/events to indicate that it is the legacy
-- version.
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+4] bits:
0 [+8] A2dpCodecType codec_type
-- See enum class A2dpCodecType in this file for possible values
$next [+2] UInt max_latency
-- Max latency allowed in ms. A value of zero disables flush.
$next [+2] A2dpScmsTEnable scms_t_enable
$next [+4] bits:
0 [+8] A2dpSamplingFrequency sampling_frequency
-- See enum class A2dpSamplingFrequency in this file for possible values
$next [+1] A2dpBitsPerSample bits_per_sample
-- See enum class A2dpBitsPerSample in this file for possible values
$next [+1] A2dpChannelMode channel_mode
-- See enum class A2dpChannelMode in this file for possible values
$next [+4] UInt encoded_audio_bitrate
-- The encoded audio bitrate in bits per second
-- 0x00000000 - The audio bitrate is not specified / unused
-- 0x00000001 - 0x00FFFFFF - Encoded audio bitrate in bits per second
-- 0x01000000 - 0xFFFFFFFF - Reserved
[requires: 0x00000000 <= this <= 0x00FFFFFF]
$next [+2] UInt connection_handle
-- Connection handle of A2DP connection being configured (only the lower 12-bits are meaningful)
-- Range: 0x0000 to 0x0EFF
[requires: 0x0000 <= this <= 0x0EFF]
$next [+2] UInt l2cap_channel_id
-- L2CAP channel ID to be used for this A2DP connection
$next [+2] UInt l2cap_mtu_size
-- Maximum size of L2CAP MTU containing encoded audio packets
if codec_type == A2dpCodecType.SBC:
28 [+32] SbcCodecInformation sbc_codec_information
if codec_type == A2dpCodecType.AAC:
28 [+32] AacCodecInformation aac_codec_information
if codec_type == A2dpCodecType.LDAC:
28 [+32] LdacCodecInformation ldac_codec_information
if codec_type == A2dpCodecType.APTX || codec_type == A2dpCodecType.APTX_HD:
28 [+32] AptxCodecInformation aptx_codec_information
struct StopA2dpOffloadCommand:
-- TODO(b/321089008): This definition is actually the legacy version of this
-- command. There is a non-legacy version as well. We should rename this and
-- the other start/stop commands/events to indicate that it is the legacy
-- version.
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
# ----------------------- Multiple Advertising ---------------------------------
enum LEMultiAdvtSubOpcode:
SET_ADVERTISING_PARAMETERS = 0x01
SET_ADVERTISING_DATA = 0x02
SET_SCAN_RESPONSE_DATA = 0x03
SET_RANDOM_ADDRESS = 0x04
ENABLE = 0x05
struct LEMultiAdvtCommandCompleteEvent:
let hdr_size = hci.CommandCompleteEvent.$size_in_bytes
0 [+hdr_size] hci.CommandCompleteEvent command_complete
$next [+1] hci.StatusCode status
$next [+1] LEMultiAdvtSubOpcode sub_opcode
struct LEMultiAdvtSetAdvtParamCommand:
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+2] UInt adv_interval_min
-- Default: 0x0800 (1.28 s)
-- Time: N * 0.625 ms
-- Time Range: 20 ms to 10.24 s
[requires: 0x0020 <= this <= 0x4000]
$next [+2] UInt adv_interval_max
-- Default: 0x0800 (1.28 s)
-- Time: N * 0.625 ms
-- Time Range: 20 ms to 10.24 s
[requires: 0x0020 <= this <= 0x4000]
$next [+1] hci.LEAdvertisingType adv_type
-- Used to determine the packet type that is used for advertising when
-- advertising is enabled.
$next [+1] hci.LEOwnAddressType own_addr_type
$next [+hci.BdAddr.$size_in_bytes] hci.BdAddr own_address
-- Public Device Address, Random Device Address, Public Identity Address, or
-- Random (static) Identity Address of our address.
$next [+1] hci.LEPeerAddressTypeNoAnon peer_addr_type
$next [+hci.BdAddr.$size_in_bytes] hci.BdAddr peer_address
-- Public Device Address, Random Device Address, Public Identity Address, or
-- Random (static) Identity Address of the device to be connected.
$next [+1] bits:
0 [+3] hci.LEAdvertisingChannels adv_channel_map
-- Indicates the advertising channels that shall be used when transmitting
-- advertising packets. At least 1 channel must be enabled.
$next [+1] hci.LEAdvertisingFilterPolicy adv_filter_policy
-- This parameter shall be ignored when directed advertising is enabled.
$next [+1] UInt adv_handle
-- Handle used to identify an advertising set.
$next [+1] Int adv_tx_power
-- Transmit_Power, Unit: dBm
-- Range (-70 to +20)
[requires: -70 <= this <= 20]
struct LEMultiAdvtSetAdvtDataCommand:
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+1] UInt adv_data_length
-- Length of the advertising data included in this command packet, up to
-- kMaxLEAdvertisingDataLength bytes.
[requires: 0 <= this <= 31]
$next [+adv_data_length] UInt:8[adv_data_length] adv_data
$next [+1] UInt adv_handle
-- Handle used to identify an advertising set.
struct LEMultiAdvtSetScanRespDataCommand:
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+1] UInt scan_resp_length
-- Length of the scan response data included in this command packet, up to
-- kMaxLEAdvertisingDataLength bytes.
[requires: 0 <= this <= 31]
$next [+scan_resp_length] UInt:8[scan_resp_length] adv_data
$next [+1] UInt adv_handle
-- Handle used to identify an advertising set.
struct LEMultiAdvtSetRandomAddrCommand:
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+hci.BdAddr.$size_in_bytes] hci.BdAddr peer_address
$next [+1] UInt adv_handle
struct LEMultiAdvtEnableCommand:
-- LE multi-advertising enable command.
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+1] hci.GenericEnableParam enable
$next [+1] UInt advertising_handle
struct LEMultiAdvtStateChangeSubevent:
-- LE multi-advertising state change subevent.
--
-- This event indicates that an advertising instance has changed its state. At
-- this time, this event is only used to indicate which advertising instance
-- was stopped as a result of a connection.
let hdr_size = hci.VendorDebugEvent.$size_in_bytes
0 [+hdr_size] hci.VendorDebugEvent vendor_event
$next [+1] UInt advertising_handle
-- Handle used to identify an advertising set.
$next [+1] hci.StatusCode status
-- Reason for state change. Currently will always be 0x00.
-- 0x00: Connection received.
$next [+2] UInt connection_handle
-- Handle used to identify the connection that caused the state change (i.e.
-- advertising instance to be disabled). Value will be 0xFFFF if invalid.
# ------------------ Advertising Packet Content Filter -------------------------
enum ApcfSubOpcode:
ENABLE = 0x00
SET_FILTERING_PARAMETERS = 0x01
BROADCAST_ADDRESS = 0x02
SERVICE_UUID = 0x03
SOLICITATION_UUID = 0x04
LOCAL_NAME = 0x05
MANUFACTURER_DATA = 0x06
SERVICE_DATA = 0x07
enum ApcfAction:
[maximum_bits: 8]
ADD = 0x00
DELETE = 0x01
-- Delete will clear the specific filter along with associated feature
-- entries in other tables
CLEAR = 0x02
-- Clear will clear all the filters and associated entries in other tables
bits ApcfFeature:
0 [+1] Flag broadcast_address
$next [+1] Flag service_data_change
$next [+1] Flag service_uuid
$next [+1] Flag service_solicitation_uuid
$next [+1] Flag local_name
$next [+1] Flag manufacturer_data
$next [+1] Flag service_data
enum ApcfDeliveryMode:
[maximum_bits: 8]
IMMEDIATE = 0x00
-- Deliver a matching advertising packet immediately when the Controller sees
ON_FOUND = 0x01
-- Linger up to a configurable timeout (via onfound_timeout and
-- onfound_timeout_cnt) before delivering a matching advertising packet
BATCHED = 0x02
-- Deliver matching advertising packets in batch
struct LEApcfCommandCompleteEvent:
-- NOTE: The LEApcfCommandCompleteEvent applies to all commands except
-- LEApcfEnableCommand. LEApcfEnableCommand's command complete event is ever
-- so slightly different and has its own definition.
let hdr_size = hci.CommandCompleteEvent.$size_in_bytes
0 [+hdr_size] hci.CommandCompleteEvent command_complete
$next [+1] hci.StatusCode status
$next [+1] ApcfSubOpcode sub_opcode
$next [+1] ApcfAction action
-- Echo back of the action parameter provided in the original command
$next [+1] UInt available_spaces
-- Number of available entries in the Controller's filters table
struct LEApcfEnableCommand:
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+1] hci.GenericEnableParam enabled
struct LEApcfEnableCommandCompleteEvent:
let hdr_size = hci.CommandCompleteEvent.$size_in_bytes
0 [+hdr_size] hci.CommandCompleteEvent command_complete
$next [+1] hci.StatusCode status
$next [+1] UInt sub_opcode
[requires: this == 0x00]
$next [+1] hci.GenericEnableParam enabled
-- Echo back of enable parameter provided in the original command
struct LEApcfSetFilteringParametersCommand:
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+1] ApcfAction action
$next [+1] UInt filter_index
-- Filter index used to identify an advertising packet content
-- filter. Filter indices are assigned on demand when used.
--
-- NOTE: The maximum number of packet filters is published via the
-- max_filter attribute within LEGetVendorCapabilitiesCommandCompleteEvent.
--
-- Range: (0, max_filter - 1)
$next [+2] bits:
0 [+7] ApcfFeature feature_selection
-- set of features to enable for this advertising packet content filter
$next [+2] bits:
0 [+7] ApcfFeature list_logic_type
-- Multiple instances of a filter are stored in a list within the
-- controller. There is a separate list for each filter type within
-- feature_selection. This field specifies the logic operation for each
-- feature selection (per-bit position) specified in
-- feature_selection. Valid only when a feature is enabled.
--
-- Bit position value:
-- 0: OR
-- 1: AND
--
-- NOTE: If AND logic is selected, an advertising packet will pass the
-- filter only if it contains all of the entries in the list. If OR logic is
-- selected, an advertising packet will pass the filter if it contains any
-- of the entries in the list.
$next [+1] bits:
0 [+7] ApcfFeature filter_logic_type
-- The controller supports multiple types of advertising packet content
-- filters. This field specifies the logic operation across advertising
-- packet content filters.
--
-- Bit position value:
-- 0: OR
-- 1: AND
--
-- NOTE: The logic type for the first three fields of ApcfFeature is always
-- AND. This bitmask is only applicable for bits 3 to 6 (four fields) of
-- ApcfFeature.
$next [+1] UInt rssi_high_threshold
-- An advertiser is considered seen only if the signal is higher than the
-- RSSI high threshold. RSSI values must use 2's complement to represent
-- negative values.
--
-- Unit: dBm
$next [+1] ApcfDeliveryMode delivery_mode
$next [+2] UInt onfound_timeout
-- Timeout (in milliseconds) for Controller to linger and collect additional
-- advertisements before reporting an advertising packet. Valid only if
-- delivery_mode is ON_FOUND.
$next [+1] UInt onfound_timeout_count
-- Maximum number of advertisements that can linger unreported within the
-- Controller at any given time. The Controller will report lingering
-- advertising packets even in onfound_timeout hasn't been reached. Valid
-- only if delivery_mode is ON_FOUND.
$next [+1] UInt rssi_low_threshold
-- If the RSSI of the received packet is below the RSSI low threshold, the
-- advertising packet is considered as not seen. RSSI values must use 2's
-- complement to represent negative values. Valid
-- only if delivery_mode is ON_FOUND.
--
-- Unit: dBm
$next [+2] UInt onlost_timeout
-- Timeout (in milliseconds) for Controller to report an advertisement as
-- being lost if, after being found, is not seen contiguously for the
-- timeout period. Valid only if delivery_mode is ON_FOUND.
$next [+2] UInt num_tracking_entries
-- Total number of advertisements to track per filter. Valid only if
-- delivery_mode is ON_FOUND.
struct LEApcfBroadcastAddressCommand:
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+1] ApcfAction action
$next [+1] UInt filter_index
-- Filter index used to identify an advertising packet content
-- filter. Filter indices are assigned on demand when used.
--
-- NOTE: The maximum number of packet filters is published via the
-- max_filter attribute within LEGetVendorCapabilitiesCommandCompleteEvent.
--
-- Range: (0, max_filter - 1)
$next [+hci.BdAddr.$size_in_bytes] hci.BdAddr broadcaster_address
-- Device address to add to or delete from the broadcaster address list
$next [+1] hci.LEPeerAddressType peer_addr_type
struct LEApcfServiceUUIDCommand(uuid_size: UInt:8):
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+1] ApcfAction action
$next [+1] UInt filter_index
-- Filter index used to identify an advertising packet content
-- filter. Filter indices are assigned on demand when used.
--
-- NOTE: The maximum number of packet filters is published via the
-- max_filter attribute within LEGetVendorCapabilitiesCommandCompleteEvent.
--
-- Range: (0, max_filter - 1)
$next [+uuid_size] UInt:8[uuid_size] uuid
-- The Service UUID (16-bit, 32-bit, or 128-bit) for adding to, or deleting
-- from, the list.
$next [+uuid_size] UInt:8[uuid_size] uuid_mask
-- The Service UUID Mask (16-bit, 32-bit, or 128-bit) to add to the list.
struct LEApcfSolicitationUUIDCommand(uuid_size: UInt:8):
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+1] ApcfAction action
$next [+1] UInt filter_index
-- Filter index used to identify an advertising packet content
-- filter. Filter indices are assigned on demand when used.
--
-- NOTE: The maximum number of packet filters is published via the
-- max_filter attribute within LEGetVendorCapabilitiesCommandCompleteEvent.
--
-- Range: (0, max_filter - 1)
$next [+uuid_size] UInt:8[uuid_size] uuid
-- The Solicitation UUID (16-bit, 32-bit, or 128-bit) for adding to, or
-- deleting from, the list.
$next [+uuid_size] UInt:8[uuid_size] uuid_mask
-- The Solicitation UUID Mask (16-bit, 32-bit, or 128-bit) to add to the
-- list.
struct LEApcfLocalNameCommand(size: UInt:8):
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+1] ApcfAction action
$next [+1] UInt filter_index
-- Filter index used to identify an advertising packet content
-- filter. Filter indices are assigned on demand when used.
--
-- NOTE: The maximum number of packet filters is published via the
-- max_filter attribute within LEGetVendorCapabilitiesCommandCompleteEvent.
--
-- Range: (0, max_filter - 1)
$next [+size] UInt:8[size] local_name
-- The character string to match against the local name. Currently, the
-- maximum number of bytes this field supports is kLEApcfMaxPDUValueLength.
--
-- NOTE: This field is not null (0x00) terminated. The size of the packet
-- sent to the controller determines the length of the value.
--
-- NOTE: This field is not applicable when the action above is
-- ApcfAction::Clear.
struct LEApcfManufacturerDataCommand(size: UInt:8):
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+1] ApcfAction action
$next [+1] UInt filter_index
-- Filter index used to identify an advertising packet content
-- filter. Filter indices are assigned on demand when used.
--
-- NOTE: The maximum number of packet filters is published via the
-- max_filter attribute within LEGetVendorCapabilitiesCommandCompleteEvent.
--
-- Range: (0, max_filter - 1)
$next [+size] UInt:8[size] manufacturer_data
-- The character string to match against the manufacturer data. Currently,
-- the maximum number of bytes this field supports is
-- kLEApcfMaxPDUValueLength.
--
-- NOTE: This field is not null (0x00) terminated. The size of the packet
-- sent to the controller determines the length of the value.
--
-- NOTE: This field is not applicable when the action above is
-- ApcfAction::Clear.
$next [+size] UInt:8[size] manufacturer_data_mask
-- The manufacturer data mask to add to the list. Manufacturer data is
-- variable in size and we may want to match against some given part of
-- it. The manufacturer_data_mask selects the bits which we match against
-- within the manufacturer_data field.
--
-- NOTE: This field is not applicable when the action above is
-- ApcfAction::Clear.
struct LEApcfServiceDataCommand(size: UInt:8):
let vendor_size = AndroidCommandHeader.$size_in_bytes
0 [+vendor_size] AndroidCommandHeader vendor_command
$next [+1] ApcfAction action
$next [+1] UInt filter_index
-- Filter index used to identify an advertising packet content
-- filter. Filter indices are assigned on demand when used.
--
-- NOTE: The maximum number of packet filters is published via the
-- max_filter attribute within LEGetVendorCapabilitiesCommandCompleteEvent.
--
-- Range: (0, max_filter - 1)
$next [+size] UInt:8[size] service_data
-- The character string to match against the manufacturer data. Currently,
-- the maximum number of bytes this field supports is
-- kLEApcfMaxPDUValueLength.
--
-- NOTE: This field is not applicable when the action above is
-- ApcfAction::Clear.
$next [+size] UInt:8[size] service_data_mask
-- The service data mask to add to the list. Service data is variable in
-- size and we may want to match against some given part of it. The
-- service_data_mask selects the bits which we match against within the
-- service_data field.
--
-- NOTE: This field is not applicable when the action above is
-- ApcfAction::Clear.