blob: 69269dd81a612b0b1c3b541f0858363e8b4ed73b [file] [log] [blame]
Martin Brabhamd337cc82019-05-16 09:36:10 -07001little_endian_packets
2
3custom_field Address : 48 "hci/"
4
5enum Code : 8 {
6 PAIRING_REQUEST = 0x01,
7 PAIRING_RESPONSE = 0x02,
8 PAIRING_CONFIRM = 0x03,
9 PAIRING_RANDOM = 0x04,
10 PAIRING_FAILED = 0x05,
11 ENCRYPTION_INFORMATION = 0x06,
12 MASTER_IDENTIFICATION = 0x07,
13 IDENTITY_INFORMATION = 0x08,
14 IDENTITY_ADDRESS_INFORMATION = 0x09,
15 SIGNING_INFORMATION = 0x0A,
16 SECURITY_REQUEST = 0x0B,
17 PAIRING_PUBLIC_KEY = 0x0C,
18 PAIRING_DH_KEY_CHECK = 0x0D,
19 PAIRING_KEYPRESS_NOTIFICATION = 0x0E,
20}
21
22packet Command {
23 code : Code,
24 _payload_,
25}
26
27enum IoCapability : 8 {
28 DISPLAY_ONLY = 0x00,
29 DISPLAY_YES_NO = 0x01,
30 KEYBOARD_ONLY = 0x02,
31 NO_INPUT_NO_OUTPUT = 0x03,
32 KEYBOARD_DISPLAY = 0x04,
33}
34
35enum OobDataFlag : 8 {
36 NOT_PRESENT = 0x00,
37 PRESENT = 0x01,
38}
39
40enum BondingFlags : 2 {
41 NO_BONDING = 0,
42 BONDING = 1,
43}
44
Martin Brabhamd337cc82019-05-16 09:36:10 -070045group PairingInfo {
46 io_capability : IoCapability,
47 oob_data_flag : OobDataFlag,
Jakub Pawlowski0dfabe12019-09-06 16:27:18 +020048 auth_req: 8,
Martin Brabhamd337cc82019-05-16 09:36:10 -070049 maximum_encryption_key_size : 5, // 7 - 16
50 _reserved_ : 3,
Jakub Pawlowski0dfabe12019-09-06 16:27:18 +020051 initiator_key_distribution : 8,
52 responder_key_distribution : 8,
Martin Brabhamd337cc82019-05-16 09:36:10 -070053}
54
55packet PairingRequest : Command (code = PAIRING_REQUEST) {
56 PairingInfo,
57}
58
59packet PairingResponse : Command (code = PAIRING_RESPONSE) {
60 PairingInfo,
61}
62
63packet PairingConfirm : Command (code = PAIRING_CONFIRM) {
Jakub Pawlowski4ea37002019-05-31 14:16:35 +020064 confirm_value : 8[16], // Initiating device sends Mconfirm, responding device sends Sconfirm
Martin Brabhamd337cc82019-05-16 09:36:10 -070065}
66
67packet PairingRandom : Command (code = PAIRING_RANDOM) {
Jakub Pawlowski4ea37002019-05-31 14:16:35 +020068 random_value : 8[16], // Initiating device sends Mrand, responding device sends Srand
Martin Brabhamd337cc82019-05-16 09:36:10 -070069}
70
71enum PairingFailedReason : 8 {
72 PASSKEY_ENTRY_FAILED = 0x01,
73 OOB_NOT_AVAILABLE = 0x02,
74 AUTHENTICATION_REQUIREMENTS = 0x03,
75 CONFIRM_VALUE_FAILED = 0x04,
76 PAIRING_NOT_SUPPORTED = 0x05,
77 ENCRYPTION_KEY_SIZE = 0x06,
78 COMMAND_NOT_SUPPORTED = 0x07,
79 UNSPECIFIED_REASON = 0x08,
80 REPEATED_ATTEMPTS = 0x09,
81 INVALID_PARAMETERS = 0x0A,
82 DHKEY_CHECK_FAILED = 0x0B,
83 NUMERIC_COMPARISON_FAILED = 0x0C,
84 BR_EDR_PAIRING_IN_PROGRESS = 0x0D,
85 CROSS_TRANSPORT_KEY_DERIVATION_NOT_ALLOWED = 0x0E,
86}
87
88packet PairingFailed : Command (code = PAIRING_FAILED) {
89 reason : PairingFailedReason,
90}
91
92packet EncryptionInformation : Command (code = ENCRYPTION_INFORMATION) {
Jakub Pawlowski4ea37002019-05-31 14:16:35 +020093 long_term_key : 8[16],
Martin Brabhamd337cc82019-05-16 09:36:10 -070094}
95
96packet MasterIdentification : Command (code = MASTER_IDENTIFICATION) {
97 ediv : 16,
Jakub Pawlowski0dfabe12019-09-06 16:27:18 +020098 rand : 8[8],
Martin Brabhamd337cc82019-05-16 09:36:10 -070099}
100
101packet IdentityInformation : Command (code = IDENTITY_INFORMATION) {
Jakub Pawlowski4ea37002019-05-31 14:16:35 +0200102 identity_resolving_key : 8[16],
Martin Brabhamd337cc82019-05-16 09:36:10 -0700103}
104
105enum AddrType : 8 {
106 PUBLIC = 0x00,
107 STATIC_RANDOM = 0x01,
108}
109
110packet IdentityAddressInformation : Command (code = IDENTITY_ADDRESS_INFORMATION) {
111 addr_type : AddrType,
112 bd_addr : Address,
113}
114
115packet SigningInformation : Command (code = SIGNING_INFORMATION) {
Jakub Pawlowski4ea37002019-05-31 14:16:35 +0200116 signature_key : 8[16],
Martin Brabhamd337cc82019-05-16 09:36:10 -0700117}
118
119packet SecurityRequest : Command (code = SECURITY_REQUEST) {
Jakub Pawlowski0dfabe12019-09-06 16:27:18 +0200120 auth_req: 8,
Martin Brabhamd337cc82019-05-16 09:36:10 -0700121}
122
123packet PairingPublicKey : Command (code = PAIRING_PUBLIC_KEY) {
Jakub Pawlowski4ea37002019-05-31 14:16:35 +0200124 public_key_x : 8[32],
125 public_key_y : 8[32],
Martin Brabhamd337cc82019-05-16 09:36:10 -0700126}
127
128packet PairingDhKeyCheck : Command (code = PAIRING_DH_KEY_CHECK) {
Jakub Pawlowski4ea37002019-05-31 14:16:35 +0200129 dh_key_check : 8[16],
Martin Brabhamd337cc82019-05-16 09:36:10 -0700130}
131
132enum KeypressNotificationType : 8 {
133 ENTRY_STARTED = 0,
134 DIGIT_ENTERED = 1,
135 DIGIT_ERASED = 2,
136 CLEARED = 3,
137 ENTRY_COMPLETED = 4,
138}
139
140packet PairingKeypressNotification : Command (code = PAIRING_KEYPRESS_NOTIFICATION) {
141 notification_type : KeypressNotificationType,
142}