From 754c68de16a3e0e20be24d9be1994997f9144229 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 15 Oct 2015 21:31:03 +0300 Subject: [PATCH] tests: Fix P2P message construction byte order for config_method Signed-off-by: Jouni Malinen --- tests/hwsim/test_p2p_messages.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_p2p_messages.py b/tests/hwsim/test_p2p_messages.py index 19d551b75..1da7afc00 100644 --- a/tests/hwsim/test_p2p_messages.py +++ b/tests/hwsim/test_p2p_messages.py @@ -145,8 +145,9 @@ def p2p_attr_channel_list(): def p2p_attr_device_info(addr, name="Test", config_methods=0, dev_type="00010050F2040001"): val = struct.unpack('6B', binascii.unhexlify(addr.replace(':',''))) val2 = struct.unpack('8B', binascii.unhexlify(dev_type)) - t = (P2P_ATTR_DEVICE_INFO, 6 + 2 + 8 + 1 + 4 + len(name)) + val + (config_methods,) + val2 + (0,) - return struct.pack("HH', 0x1011, len(name)) +name + t = (P2P_ATTR_DEVICE_INFO, 6 + 2 + 8 + 1 + 4 + len(name)) + val + t2 = val2 + (0,) + return struct.pack("H", config_methods) + struct.pack("8BB", *t2) + struct.pack('>HH', 0x1011, len(name)) +name def p2p_attr_group_id(addr, ssid): val = struct.unpack('6B', binascii.unhexlify(addr.replace(':','')))