mirror of
https://github.com/google/bumble.git
synced 2026-05-09 04:08:02 +00:00
Fix a misconfig of HCI_PIN_Code_Reply_Command
The pin_code field is of fixed length of 16 bytes
This commit is contained in:
@@ -2102,7 +2102,7 @@ class HCI_Link_Key_Request_Negative_Reply_Command(HCI_Command):
|
||||
fields=[
|
||||
('bd_addr', Address.parse_address),
|
||||
('pin_code_length', 1),
|
||||
('pin_code', '*'),
|
||||
('pin_code', 16),
|
||||
],
|
||||
return_parameters_fields=[
|
||||
('status', STATUS_SPEC),
|
||||
|
||||
@@ -215,12 +215,18 @@ def test_HCI_Command():
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
def test_HCI_PIN_Code_Request_Reply_Command():
|
||||
pin_code = b'1234'
|
||||
pin_code_length = len(pin_code)
|
||||
# here to make the test pass, we need to
|
||||
# pad pin_code, as HCI_Object.format_fields
|
||||
# does not do it for us
|
||||
padded_pin_code = pin_code + bytes(16 - pin_code_length)
|
||||
command = HCI_PIN_Code_Request_Reply_Command(
|
||||
bd_addr=Address(
|
||||
'00:11:22:33:44:55', address_type=Address.PUBLIC_DEVICE_ADDRESS
|
||||
),
|
||||
pin_code_length=4,
|
||||
pin_code=b'1234',
|
||||
pin_code_length=pin_code_length,
|
||||
pin_code=padded_pin_code,
|
||||
)
|
||||
basic_check(command)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user