meshtastic 0.0.137 → 0.0.139
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.
- checksums.yaml +4 -4
- data/lib/meshtastic/mqtt.rb +3 -3
- data/lib/meshtastic/version.rb +1 -1
- 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: 72220abdd7ec8a367cd29fc79b420a915890ef3266119f9657d1ed2b73608308
|
|
4
|
+
data.tar.gz: 482a685bdef11f2f108ac3a36e3d1908ce58b79dbf6751255ec0c18082ac04c6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8418f7484ab23a717f4e4189db8d5c7d2e18f6dd4a3677f20cba6028402975f69a24b270e1a98eb96c6f43f3230b73f8a3cbac5bf44ee6bade2f8fbdc158ffcb
|
|
7
|
+
data.tar.gz: 8e5c92e166e822b6fa1b85b0ec629a11e5f5842f645933ce2868e69aebb535258dd054b87c9a9de6fd6608b1439635381f3523d73e048cd4b93357eb26ed21d8
|
data/lib/meshtastic/mqtt.rb
CHANGED
|
@@ -279,14 +279,14 @@ module Meshtastic
|
|
|
279
279
|
|
|
280
280
|
# TODO: Implement chunked message to deal with large messages
|
|
281
281
|
text = opts[:text].to_s
|
|
282
|
-
max_bytes =
|
|
282
|
+
max_bytes = 231
|
|
283
283
|
mui = Meshtastic::MeshInterface.new
|
|
284
284
|
|
|
285
285
|
if text.bytesize > max_bytes
|
|
286
286
|
total_chunks = (text.bytesize.to_f / max_bytes).ceil
|
|
287
287
|
total_chunks.times do |i|
|
|
288
288
|
chunk_num = i + 1
|
|
289
|
-
chunk_prefix = "(#{chunk_num} of #{total_chunks})"
|
|
289
|
+
chunk_prefix = " (#{chunk_num} of #{total_chunks})"
|
|
290
290
|
chunk_prefix_len = chunk_prefix.bytesize
|
|
291
291
|
start_index = i * (max_bytes - chunk_prefix_len)
|
|
292
292
|
end_index = (start_index + (max_bytes - chunk_prefix_len)) - 1
|
|
@@ -294,7 +294,7 @@ module Meshtastic
|
|
|
294
294
|
# This addresses a weird bug in the protocal if the first byte
|
|
295
295
|
# is an h or H followed by a single byte, which returns
|
|
296
296
|
# {} or {bitfiled: INT}
|
|
297
|
-
opts[:text] =
|
|
297
|
+
opts[:text] = chunk
|
|
298
298
|
protobuf_chunk = mui.send_text(opts)
|
|
299
299
|
mqtt_obj.publish(absolute_topic, protobuf_chunk)
|
|
300
300
|
end
|
data/lib/meshtastic/version.rb
CHANGED