mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-11 11:07:04 +10:00
Update ML timeout handling and adjust distance threshold for path hops
This commit is contained in:
@@ -3903,7 +3903,9 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
if (mlTimeout != null) {
|
if (mlTimeout != null) {
|
||||||
if (pathLength < 0) {
|
if (pathLength < 0) {
|
||||||
// Flood: trust ML, only enforce firmware formula as floor
|
// Flood: trust ML, only enforce firmware formula as floor
|
||||||
return mlTimeout.clamp(physicsMin, mlTimeout);
|
if (mlTimeout < physicsMin) {
|
||||||
|
return physicsMin;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return mlTimeout.clamp(physicsMin, physicsMax);
|
return mlTimeout.clamp(physicsMin, physicsMax);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -879,7 +879,7 @@ List<_PathHop> _buildPathHops(
|
|||||||
previousPosition = resolvedPosition;
|
previousPosition = resolvedPosition;
|
||||||
}
|
}
|
||||||
// If the best candidate is much farther than the previous hop, it's likely not the correct match.
|
// If the best candidate is much farther than the previous hop, it's likely not the correct match.
|
||||||
if (lastDistance + bestDistance > 70000 &&
|
if (lastDistance + bestDistance > 50000 &&
|
||||||
candidates != null &&
|
candidates != null &&
|
||||||
candidates.isNotEmpty) {
|
candidates.isNotEmpty) {
|
||||||
i--;
|
i--;
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ class _NeighborsScreenState extends State<NeighborsScreen> {
|
|||||||
|
|
||||||
void _handleNeighborsResponse(MeshCoreConnector connector, Uint8List frame) {
|
void _handleNeighborsResponse(MeshCoreConnector connector, Uint8List frame) {
|
||||||
final buffer = BufferReader(frame);
|
final buffer = BufferReader(frame);
|
||||||
final contacts = connector.allContacts;
|
final contacts = connector.allContactsUnfiltered;
|
||||||
try {
|
try {
|
||||||
final neighborCount = buffer.readUInt16LE();
|
final neighborCount = buffer.readUInt16LE();
|
||||||
final parsedNeighbors = parseNeighborsData(buffer, buffer.readUInt16LE());
|
final parsedNeighbors = parseNeighborsData(buffer, buffer.readUInt16LE());
|
||||||
|
|||||||
Reference in New Issue
Block a user