|
|
@ -251,9 +251,21 @@ public class LedClient
|
|
|
|
public static bool SendMsgByKey(string key)
|
|
|
|
public static bool SendMsgByKey(string key)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Log.Info($"send by {key}");
|
|
|
|
Log.Info($"send by {key}");
|
|
|
|
|
|
|
|
int count = 0;
|
|
|
|
if (Dictionary.TryGetValue(key, out var bytes))
|
|
|
|
if (Dictionary.TryGetValue(key, out var bytes))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return InnerSend(bytes);
|
|
|
|
|
|
|
|
|
|
|
|
while (!InnerSend(bytes))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Thread.Sleep(100);
|
|
|
|
|
|
|
|
count++;
|
|
|
|
|
|
|
|
if (count > 10)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|