blob: a7e6614f6f80297bc6fc15df7348b43133c13e55 [file] [log] [blame]
little_endian_packets
custom_field Address : 48 "hci/"
custom_field ClassOfDevice : 24 "hci/"
enum PacketType : 8 {
UNKNOWN = 0x00,
ACL = 0x01,
COMMAND = 0x02,
DISCONNECT = 0x03,
ENCRYPT_CONNECTION = 0x04,
ENCRYPT_CONNECTION_RESPONSE = 0x05,
EVENT = 0x06,
INQUIRY = 0x07,
INQUIRY_RESPONSE = 0x08,
IO_CAPABILITY_REQUEST = 0x09,
IO_CAPABILITY_RESPONSE = 0x0A,
IO_CAPABILITY_NEGATIVE_RESPONSE = 0x0B,
LE_ADVERTISEMENT = 0x0C,
LE_CONNECT = 0x0D,
LE_CONNECT_COMPLETE = 0x0E,
LE_SCAN = 0x0F,
LE_SCAN_RESPONSE = 0x10,
PAGE = 0x11,
PAGE_RESPONSE = 0x12,
PAGE_REJECT = 0x13,
RESPONSE = 0x14,
SCO = 0x15,
}
packet LinkLayerPacket {
type : PacketType,
source_address : Address,
destination_address : Address,
_body_,
}
packet AclPacket : LinkLayerPacket (type = ACL) {
_payload_,
}
packet Command : LinkLayerPacket (type = COMMAND) {
_payload_,
}
packet Disconnect : LinkLayerPacket (type = DISCONNECT) {
reason : 8,
}
packet EncryptConnection : LinkLayerPacket (type = ENCRYPT_CONNECTION) {
key : 8[],
}
packet EncryptConnectionResponse : LinkLayerPacket (type = ENCRYPT_CONNECTION_RESPONSE) {
key : 8[],
}
enum InquiryState : 8 {
STANDBY = 0x00,
INQUIRY = 0x01,
}
enum InquiryType : 8 {
STANDARD = 0x00,
RSSI = 0x01,
EXTENDED = 0x02,
}
packet Inquiry : LinkLayerPacket (type = INQUIRY) {
inquiry_type : InquiryType,
}
packet BasicInquiryResponse : LinkLayerPacket(type = INQUIRY_RESPONSE) {
inquiry_type : InquiryType,
page_scan_repetition_mode : 8,
class_of_device : ClassOfDevice,
clock_offset : 15,
_reserved_ : 1,
_body_,
}
packet InquiryResponse : BasicInquiryResponse (inquiry_type = STANDARD) {
}
packet InquiryResponseWithRssi : BasicInquiryResponse (inquiry_type = RSSI) {
rssi: 8,
}
packet ExtendedInquiryResponse : BasicInquiryResponse (inquiry_type = EXTENDED) {
rssi: 8,
extended_data : 8[],
}
packet IoCapabilityRequest : LinkLayerPacket (type = IO_CAPABILITY_REQUEST) {
io_capability : 8,
oob_data_present : 8,
authentication_requirements : 8,
}
packet IoCapabilityResponse : LinkLayerPacket (type = IO_CAPABILITY_RESPONSE) {
io_capability : 8,
oob_data_present : 8,
authentication_requirements : 8,
}
packet IoCapabilityNegativeResponse : LinkLayerPacket (type = IO_CAPABILITY_NEGATIVE_RESPONSE) {
reason : 8,
}
enum AddressType : 8 {
PUBLIC = 0,
RANDOM = 1,
PUBLIC_IDENTITY = 2,
RANDOM_IDENTITY = 3,
}
enum AdvertisementType : 8 {
ADV_IND = 0, // Connectable and scannable
ADV_DIRECT_IND = 1, // Connectable directed
ADV_SCAN_IND = 2, // Scannable undirected
ADV_NONCONN_IND = 3, // Non connectable undirected
SCAN_RESPONSE = 4,
}
packet LeAdvertisement : LinkLayerPacket (type = LE_ADVERTISEMENT) {
address_type : AddressType,
advertisement_type : AdvertisementType,
data : 8[],
}
packet LeConnect : LinkLayerPacket (type = LE_CONNECT) {
le_connection_interval_min : 16,
le_connection_interval_max : 16,
le_connection_latency : 16,
le_connection_supervision_timeout : 16,
address_type : 8,
}
packet LeConnectComplete : LinkLayerPacket (type = LE_CONNECT_COMPLETE) {
le_connection_interval : 16,
le_connection_latency : 16,
le_connection_supervision_timeout : 16,
address_type : 8,
}
packet LeScan : LinkLayerPacket (type = LE_SCAN) {
}
packet LeScanResponse : LinkLayerPacket (type = LE_SCAN_RESPONSE) {
address_type : AddressType,
advertisement_type : AdvertisementType,
data : 8[],
}
packet Page : LinkLayerPacket (type = PAGE) {
class_of_device : ClassOfDevice,
allow_role_switch : 8,
}
packet PageResponse : LinkLayerPacket (type = PAGE_RESPONSE) {
try_role_switch : 8,
}
packet PageReject : LinkLayerPacket (type = PAGE_REJECT) {
reason : 8,
}
packet Response : LinkLayerPacket (type = RESPONSE) {
opcode : 16,
_payload_,
}