1little_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 CENTRAL_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 45group PairingInfo { 46 io_capability : IoCapability, 47 oob_data_flag : OobDataFlag, 48 auth_req: 8, 49 maximum_encryption_key_size : 5, // 7 - 16 50 _reserved_ : 3, 51 initiator_key_distribution : 8, 52 responder_key_distribution : 8, 53} 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) { 64 confirm_value : 8[16], // Initiating device sends Mconfirm, responding device sends Sconfirm 65} 66 67packet PairingRandom : Command (code = PAIRING_RANDOM) { 68 random_value : 8[16], // Initiating device sends Mrand, responding device sends Srand 69} 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) { 93 long_term_key : 8[16], 94} 95 96packet CentralIdentification : Command (code = CENTRAL_IDENTIFICATION) { 97 ediv : 16, 98 rand : 8[8], 99} 100 101packet IdentityInformation : Command (code = IDENTITY_INFORMATION) { 102 identity_resolving_key : 8[16], 103} 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) { 116 signature_key : 8[16], 117} 118 119packet SecurityRequest : Command (code = SECURITY_REQUEST) { 120 auth_req: 8, 121} 122 123packet PairingPublicKey : Command (code = PAIRING_PUBLIC_KEY) { 124 public_key_x : 8[32], 125 public_key_y : 8[32], 126} 127 128packet PairingDhKeyCheck : Command (code = PAIRING_DH_KEY_CHECK) { 129 dh_key_check : 8[16], 130} 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} 143