Multibyte: fix map

This commit is contained in:
HDDen
2026-05-28 02:20:56 +03:00
parent 6e81fdfd46
commit 2e4f26d7cd
8 changed files with 338 additions and 267 deletions
+7 -3
View File
@@ -2864,7 +2864,8 @@ class MeshCoreConnector extends ChangeNotifier {
: updatedFlags;
final mode = _pathHashByteWidth - 1;
final encodedPathLen = (latestContact.pathLength >= 0 && latestContact.pathLength != 0xFF)
final encodedPathLen =
(latestContact.pathLength >= 0 && latestContact.pathLength != 0xFF)
? (latestContact.pathLength | (mode << 6))
: latestContact.pathLength;
await sendFrame(
@@ -3208,7 +3209,8 @@ class MeshCoreConnector extends ChangeNotifier {
if (!isConnected) return;
final mode = _pathHashByteWidth - 1;
final encodedPathLen = (contact.pathLength >= 0 && contact.pathLength != 0xFF)
final encodedPathLen =
(contact.pathLength >= 0 && contact.pathLength != 0xFF)
? (contact.pathLength | (mode << 6))
: contact.pathLength;
await sendFrame(
@@ -6089,7 +6091,9 @@ class MeshCoreConnector extends ChangeNotifier {
publicKey: publicKey,
name: name,
type: type,
pathLength: pathBytes.isEmpty ? -1 : (pathBytes.length ~/ pathHashWidth),
pathLength: pathBytes.isEmpty
? -1
: (pathBytes.length ~/ pathHashWidth),
path: Uint8List.fromList(
pathBytes.reversed.toList(),
), // Store path in reverse for easier use in outgoing messages