diff --git a/pyproject.toml b/pyproject.toml index 14714e8..25c46e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "meshcore" -version = "2.2.0" +version = "2.2.1" authors = [ { name="Florent de Lamotte", email="florent@frizoncorrea.fr" }, { name="Alex Wolden", email="awolden@gmail.com" }, diff --git a/src/meshcore/commands/contact.py b/src/meshcore/commands/contact.py index ce18784..9786ecd 100644 --- a/src/meshcore/commands/contact.py +++ b/src/meshcore/commands/contact.py @@ -124,8 +124,8 @@ class ContactCommands(CommandHandlerBase): data = ( b"\x09" + bytes.fromhex(contact["public_key"]) - + contact["type"].to_bytes(1) - + flags.to_bytes(1) + + contact["type"].to_bytes(1, "little") + + flags.to_bytes(1, "little") + out_path_len.to_bytes(1, "little", signed=True) + bytes.fromhex(out_path_hex) + bytes.fromhex(adv_name_hex) diff --git a/src/meshcore/commands/device.py b/src/meshcore/commands/device.py index 06be335..6d1c657 100644 --- a/src/meshcore/commands/device.py +++ b/src/meshcore/commands/device.py @@ -106,9 +106,9 @@ class DeviceCommands(CommandHandlerBase): ) data = ( b"\x26" - + manual_add_contacts.to_bytes(1) - + telemetry_mode.to_bytes(1) - + advert_loc_policy.to_bytes(1) + + manual_add_contacts.to_bytes(1, "little") + + telemetry_mode.to_bytes(1, "little") + + advert_loc_policy.to_bytes(1, "little") ) return await self.send(data, [EventType.OK, EventType.ERROR]) @@ -120,10 +120,10 @@ class DeviceCommands(CommandHandlerBase): ) data = ( b"\x26" - + infos["manual_add_contacts"].to_bytes(1) - + telemetry_mode.to_bytes(1) - + infos["adv_loc_policy"].to_bytes(1) - + infos["multi_acks"].to_bytes(1) + + infos["manual_add_contacts"].to_bytes(1, "little") + + telemetry_mode.to_bytes(1, "little") + + infos["adv_loc_policy"].to_bytes(1, "little") + + infos["multi_acks"].to_bytes(1, "little") ) return await self.send(data, [EventType.OK, EventType.ERROR])