Distinguish unreachable Muninn Moves
This commit is contained in:
parent
5eef53c0e2
commit
32bd680cce
2 changed files with 33 additions and 8 deletions
|
|
@ -231,10 +231,13 @@ public static class MimirMuninnMoveEvidenceAdapter
|
|||
.ToArray();
|
||||
var hasConnectedBluetooth = snapshots.Any(identity =>
|
||||
identity.State.Equals("bluetooth-connected", StringComparison.OrdinalIgnoreCase));
|
||||
var hasUnreachableBluetooth = snapshots.Any(identity =>
|
||||
identity.State.Equals("bluetooth-unreachable", StringComparison.OrdinalIgnoreCase));
|
||||
var pickupReadiness = ResolvePickupReadiness(
|
||||
usbHostIds,
|
||||
waitingPickupHostIds,
|
||||
hasConnectedBluetooth);
|
||||
hasConnectedBluetooth,
|
||||
hasUnreachableBluetooth);
|
||||
var sourcePaths = snapshots
|
||||
.Select(identity => identity.SourcePath)
|
||||
.Where(path => !string.IsNullOrWhiteSpace(path))
|
||||
|
|
@ -268,7 +271,8 @@ public static class MimirMuninnMoveEvidenceAdapter
|
|||
private static string ResolvePickupReadiness(
|
||||
string[] usbHostIds,
|
||||
string[] waitingPickupHostIds,
|
||||
bool hasConnectedBluetooth)
|
||||
bool hasConnectedBluetooth,
|
||||
bool hasUnreachableBluetooth)
|
||||
{
|
||||
if (usbHostIds.Length > 0)
|
||||
{
|
||||
|
|
@ -280,6 +284,11 @@ public static class MimirMuninnMoveEvidenceAdapter
|
|||
return "bluetooth-connected";
|
||||
}
|
||||
|
||||
if (hasUnreachableBluetooth)
|
||||
{
|
||||
return "bluetooth-unreachable";
|
||||
}
|
||||
|
||||
if (waitingPickupHostIds.Length > 0)
|
||||
{
|
||||
return "pickup-ready";
|
||||
|
|
@ -300,8 +309,9 @@ public static class MimirMuninnMoveEvidenceAdapter
|
|||
{
|
||||
"usb-visible" => 0,
|
||||
"bluetooth-connected" => 1,
|
||||
"bluetooth-waiting" => 2,
|
||||
"bluetooth-known" => 3,
|
||||
"bluetooth-unreachable" => 2,
|
||||
"bluetooth-waiting" => 3,
|
||||
"bluetooth-known" => 4,
|
||||
_ => 9
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue