Skip to content

Commit 2ccc121

Browse files
committed
byteorder is now mandatory in to_bytes vim pyproject.toml !
1 parent fd67639 commit 2ccc121

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "meshcore"
7-
version = "2.2.0"
7+
version = "2.2.1"
88
authors = [
99
{ name="Florent de Lamotte", email="[email protected]" },
1010
{ name="Alex Wolden", email="[email protected]" },

src/meshcore/commands/contact.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ async def update_contact(self, contact, path=None, flags=None) -> Event:
124124
data = (
125125
b"\x09"
126126
+ bytes.fromhex(contact["public_key"])
127-
+ contact["type"].to_bytes(1)
128-
+ flags.to_bytes(1)
127+
+ contact["type"].to_bytes(1, "little")
128+
+ flags.to_bytes(1, "little")
129129
+ out_path_len.to_bytes(1, "little", signed=True)
130130
+ bytes.fromhex(out_path_hex)
131131
+ bytes.fromhex(adv_name_hex)

src/meshcore/commands/device.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ async def set_other_params(
106106
)
107107
data = (
108108
b"\x26"
109-
+ manual_add_contacts.to_bytes(1)
110-
+ telemetry_mode.to_bytes(1)
111-
+ advert_loc_policy.to_bytes(1)
109+
+ manual_add_contacts.to_bytes(1, "little")
110+
+ telemetry_mode.to_bytes(1, "little")
111+
+ advert_loc_policy.to_bytes(1, "little")
112112
)
113113
return await self.send(data, [EventType.OK, EventType.ERROR])
114114

@@ -120,10 +120,10 @@ async def set_other_params_from_infos(self, infos) -> Event:
120120
)
121121
data = (
122122
b"\x26"
123-
+ infos["manual_add_contacts"].to_bytes(1)
124-
+ telemetry_mode.to_bytes(1)
125-
+ infos["adv_loc_policy"].to_bytes(1)
126-
+ infos["multi_acks"].to_bytes(1)
123+
+ infos["manual_add_contacts"].to_bytes(1, "little")
124+
+ telemetry_mode.to_bytes(1, "little")
125+
+ infos["adv_loc_policy"].to_bytes(1, "little")
126+
+ infos["multi_acks"].to_bytes(1, "little")
127127
)
128128
return await self.send(data, [EventType.OK, EventType.ERROR])
129129

0 commit comments

Comments
 (0)