meshtastic 0.0.55 → 0.0.56
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/meshtastic/version.rb +1 -1
- data/lib/meshtastic.rb +11 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 587ec9cf838d9bc00fb0881bfb06e5baaf32b76cf92be0f1687dee8397cc372e
|
4
|
+
data.tar.gz: 4bf94458eae35a86738318fff4931094f943bd3afcacb967e2022809c0e211ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cb23efe67552373a15b746b6553951f6694fe64fd03a68f4db730b2c477a769999dba92146b8a40d85cd3c29ea71c931a5406b1d081367a3699eaf8358af8b2
|
7
|
+
data.tar.gz: 9c2733116cfaebcfa388a4211d519e0216ca1709d2752d197bc7175cb92e4a1246c4e5ff7baea6fcd5314ff69af458b90b24094eb5ff749861ad2d116aae1844
|
data/lib/meshtastic/version.rb
CHANGED
data/lib/meshtastic.rb
CHANGED
@@ -216,9 +216,15 @@ module Meshtastic
|
|
216
216
|
mesh_packet.channel = channel
|
217
217
|
mesh_packet.want_ack = want_ack
|
218
218
|
mesh_packet.hop_limit = hop_limit
|
219
|
-
|
220
|
-
#
|
221
|
-
|
219
|
+
|
220
|
+
# TODO: Implement strategy for obtaining last packet id
|
221
|
+
packet_id = 0
|
222
|
+
if mesh_packet.id.zero?
|
223
|
+
packet_id = generate_packet_id(
|
224
|
+
last_packet_id: packet_id
|
225
|
+
)
|
226
|
+
end
|
227
|
+
mesh_packet.id = packet_id
|
222
228
|
|
223
229
|
if psks
|
224
230
|
nonce_packet_id = [mesh_packet.id].pack('V').ljust(8, "\x00")
|
@@ -267,7 +273,8 @@ module Meshtastic
|
|
267
273
|
last_packet_id = opts[:last_packet_id] ||= 0
|
268
274
|
last_packet_id = 0 if last_packet_id.negative?
|
269
275
|
|
270
|
-
(
|
276
|
+
Random.rand(0xffffffff) if last_packet_id.zero?
|
277
|
+
(last_packet_id + 1) & 0xffffffff if last_packet_id.positive?
|
271
278
|
end
|
272
279
|
|
273
280
|
# Supported Method Parameters::
|