meshcore 2.1.17__py3-none-any.whl → 2.1.18__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of meshcore might be problematic. Click here for more details.
- meshcore/commands/device.py +41 -42
- meshcore/reader.py +1 -0
- {meshcore-2.1.17.dist-info → meshcore-2.1.18.dist-info}/METADATA +1 -1
- {meshcore-2.1.17.dist-info → meshcore-2.1.18.dist-info}/RECORD +6 -6
- {meshcore-2.1.17.dist-info → meshcore-2.1.18.dist-info}/WHEEL +0 -0
- {meshcore-2.1.17.dist-info → meshcore-2.1.18.dist-info}/licenses/LICENSE +0 -0
meshcore/commands/device.py
CHANGED
|
@@ -87,14 +87,18 @@ class DeviceCommands(CommandHandlerBase):
|
|
|
87
87
|
[EventType.OK, EventType.ERROR],
|
|
88
88
|
)
|
|
89
89
|
|
|
90
|
+
# the old set_other_params function has been replaced in
|
|
91
|
+
# favour of set_other_params_from_infos to be more generic
|
|
92
|
+
# stays here for backward compatibility but does not support
|
|
93
|
+
# multi_acks for instance
|
|
90
94
|
async def set_other_params(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
self,
|
|
96
|
+
manual_add_contacts: bool,
|
|
97
|
+
telemetry_mode_base: int,
|
|
98
|
+
telemetry_mode_loc: int,
|
|
99
|
+
telemetry_mode_env: int,
|
|
100
|
+
advert_loc_policy: int,
|
|
101
|
+
) -> Event:
|
|
98
102
|
telemetry_mode = (
|
|
99
103
|
(telemetry_mode_base & 0b11)
|
|
100
104
|
| ((telemetry_mode_loc & 0b11) << 2)
|
|
@@ -108,55 +112,50 @@ class DeviceCommands(CommandHandlerBase):
|
|
|
108
112
|
)
|
|
109
113
|
return await self.send(data, [EventType.OK, EventType.ERROR])
|
|
110
114
|
|
|
115
|
+
async def set_other_params_from_infos(self, infos) -> Event:
|
|
116
|
+
telemetry_mode = (
|
|
117
|
+
(infos["telemetry_mode_base"] & 0b11)
|
|
118
|
+
| ((infos["telemetry_mode_loc"] & 0b11) << 2)
|
|
119
|
+
| ((infos["telemetry_mode_env"] & 0b11) << 4)
|
|
120
|
+
)
|
|
121
|
+
data = (
|
|
122
|
+
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)
|
|
127
|
+
)
|
|
128
|
+
return await self.send(data, [EventType.OK, EventType.ERROR])
|
|
129
|
+
|
|
111
130
|
async def set_telemetry_mode_base(self, telemetry_mode_base: int) -> Event:
|
|
112
131
|
infos = (await self.send_appstart()).payload
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
telemetry_mode_base,
|
|
116
|
-
infos["telemetry_mode_loc"],
|
|
117
|
-
infos["telemetry_mode_env"],
|
|
118
|
-
infos["adv_loc_policy"],
|
|
119
|
-
)
|
|
132
|
+
infos["telemetry_mode_base"] = telemetry_mode_base
|
|
133
|
+
return await self.set_other_params_from_infos(infos)
|
|
120
134
|
|
|
121
135
|
async def set_telemetry_mode_loc(self, telemetry_mode_loc: int) -> Event:
|
|
122
136
|
infos = (await self.send_appstart()).payload
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
infos["telemetry_mode_base"],
|
|
126
|
-
telemetry_mode_loc,
|
|
127
|
-
infos["telemetry_mode_env"],
|
|
128
|
-
infos["adv_loc_policy"],
|
|
129
|
-
)
|
|
137
|
+
infos["telemetry_mode_loc"] = telemetry_mode_loc
|
|
138
|
+
return await self.set_other_params_from_infos(infos)
|
|
130
139
|
|
|
131
140
|
async def set_telemetry_mode_env(self, telemetry_mode_env: int) -> Event:
|
|
132
141
|
infos = (await self.send_appstart()).payload
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
infos["telemetry_mode_base"],
|
|
136
|
-
infos["telemetry_mode_loc"],
|
|
137
|
-
telemetry_mode_env,
|
|
138
|
-
infos["adv_loc_policy"],
|
|
139
|
-
)
|
|
142
|
+
infos["telemetry_mode_env"] = telemetry_mode_env
|
|
143
|
+
return await self.set_other_params_from_infos(infos)
|
|
140
144
|
|
|
141
145
|
async def set_manual_add_contacts(self, manual_add_contacts: bool) -> Event:
|
|
142
146
|
infos = (await self.send_appstart()).payload
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
infos["telemetry_mode_base"],
|
|
146
|
-
infos["telemetry_mode_loc"],
|
|
147
|
-
infos["telemetry_mode_env"],
|
|
148
|
-
infos["adv_loc_policy"],
|
|
149
|
-
)
|
|
147
|
+
infos["manual_add_contacts"] = manual_add_contacts
|
|
148
|
+
return await self.set_other_params_from_infos(infos)
|
|
150
149
|
|
|
151
150
|
async def set_advert_loc_policy(self, advert_loc_policy: int) -> Event:
|
|
152
151
|
infos = (await self.send_appstart()).payload
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
)
|
|
152
|
+
infos["adv_loc_policy"] = advert_loc_policy
|
|
153
|
+
return await self.set_other_params_from_infos(infos)
|
|
154
|
+
|
|
155
|
+
async def set_multi_ack(self, multi_acks: int) -> Event:
|
|
156
|
+
infos = (await self.send_appstart()).payload
|
|
157
|
+
infos["multi_acks"] = multi_acks
|
|
158
|
+
return await self.set_other_params_from_infos(infos)
|
|
160
159
|
|
|
161
160
|
async def set_devicepin(self, pin: int) -> Event:
|
|
162
161
|
logger.debug(f"Setting device PIN to: {pin}")
|
meshcore/reader.py
CHANGED
|
@@ -123,6 +123,7 @@ class MessageReader:
|
|
|
123
123
|
self_info["adv_lon"] = (
|
|
124
124
|
int.from_bytes(data[40:44], byteorder="little", signed=True) / 1e6
|
|
125
125
|
)
|
|
126
|
+
self_info["multi_acks"] = data[44]
|
|
126
127
|
self_info["adv_loc_policy"] = data[45]
|
|
127
128
|
self_info["telemetry_mode_env"] = (data[46] >> 4) & 0b11
|
|
128
129
|
self_info["telemetry_mode_loc"] = (data[46] >> 2) & 0b11
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meshcore
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.18
|
|
4
4
|
Summary: Base classes for communicating with meshcore companion radios
|
|
5
5
|
Project-URL: Homepage, https://github.com/fdlamotte/meshcore_py
|
|
6
6
|
Project-URL: Issues, https://github.com/fdlamotte/meshcore_py/issues
|
|
@@ -6,16 +6,16 @@ meshcore/lpp_json_encoder.py,sha256=vyn7z3VYWOo_B9xmCzqblh5xCa0QKWKcMi2eOqw18RE,
|
|
|
6
6
|
meshcore/meshcore.py,sha256=n8fH7AEx7DR8BHOYL_Qex9ns6ACKklNNqYbPnNnvqyE,16110
|
|
7
7
|
meshcore/packets.py,sha256=2soo3H6FEbVdYk-ZQANIM3YpyCwsaIOrB4QIEJLLw0c,1072
|
|
8
8
|
meshcore/parsing.py,sha256=48PQkig-sqvsRlkF9zkvWhJoSq6ERCbGb_aRuCND5NI,4044
|
|
9
|
-
meshcore/reader.py,sha256=
|
|
9
|
+
meshcore/reader.py,sha256=Q7gbYNod9A9sBLYjuDXiEvdk-zGKW8lXSxIPFMVkiLo,24831
|
|
10
10
|
meshcore/serial_cx.py,sha256=-kaqnqk7Ydufu2DECFfPDv4Xs-7gHUBuz8v0xf8fvvE,3969
|
|
11
11
|
meshcore/tcp_cx.py,sha256=05YRVMnjY5aVBTJcHa0uG4VfFKGbV6hQ1pPIsJg4CDI,4227
|
|
12
12
|
meshcore/commands/__init__.py,sha256=NNmkTEcL-DLyuwKLUagEzpqe3C6ui2tETbu_mUd4p-I,441
|
|
13
13
|
meshcore/commands/base.py,sha256=0bDHcNGlKoej03xJqzo_wL5ctoPQU5kcK1Ca5sZh1pk,7097
|
|
14
14
|
meshcore/commands/binary.py,sha256=MVKXrT4pFSlzFkVFLBX988Eh57tRwunw4XPKBumbQNU,4890
|
|
15
15
|
meshcore/commands/contact.py,sha256=-dRY68xZkDFP6-i53WujyWhEsXZsFRk98B3j3zBzaL4,5860
|
|
16
|
-
meshcore/commands/device.py,sha256=
|
|
16
|
+
meshcore/commands/device.py,sha256=X4Y4pGe3QthAudScVd1PwIRUv_B6OfoEdUe0eqx5q-w,8661
|
|
17
17
|
meshcore/commands/messaging.py,sha256=MIVGM5G8J16qimKjCHdrlEiVJ4g_MsBaZKPvRJHJcLU,8306
|
|
18
|
-
meshcore-2.1.
|
|
19
|
-
meshcore-2.1.
|
|
20
|
-
meshcore-2.1.
|
|
21
|
-
meshcore-2.1.
|
|
18
|
+
meshcore-2.1.18.dist-info/METADATA,sha256=h4HndUy4I2TXWZqUyHiG2xPjdmlK_TSbidp5PV4t-oU,25317
|
|
19
|
+
meshcore-2.1.18.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
20
|
+
meshcore-2.1.18.dist-info/licenses/LICENSE,sha256=o62-JWT_C-ZqEtzb1Gl_PPtPr0pVT8KDmgji_Y_bejI,1075
|
|
21
|
+
meshcore-2.1.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|