mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
feat: add IDspPresetsDirectRecall interface to define preset recall functionality
This commit is contained in:
parent
6852f47ce2
commit
f971a3adff
2 changed files with 39 additions and 0 deletions
|
|
@ -306,6 +306,27 @@ public class GenericSshClient : Device, ISocketStatusWithStreamDebugging, IAutoR
|
||||||
ReconnectTimer.Start();
|
ReconnectTimer.Start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (System.Net.Sockets.SocketException e)
|
||||||
|
{
|
||||||
|
// SSH.NET only wraps socket failures in SshConnectionException once the SSH
|
||||||
|
// protocol handshake begins - a failure before that (e.g. DNS resolution failure,
|
||||||
|
// "Name or service not known", or connection refused) surfaces as a raw
|
||||||
|
// SocketException here instead. This is an expected/routine "device offline"
|
||||||
|
// condition (same as the SshConnectionException case above), so log it at Warning
|
||||||
|
// instead of falling through to the generic handler's LogException/Error-level
|
||||||
|
// stack trace dump.
|
||||||
|
this.LogWarning("Connection failure: Cannot reach {host} on {port} ({message})", Hostname, Port, e.Message);
|
||||||
|
|
||||||
|
DisconnectLogged = true;
|
||||||
|
KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED);
|
||||||
|
if (AutoReconnect)
|
||||||
|
{
|
||||||
|
this.LogDebug("Checking autoreconnect: {0}, {1}ms", AutoReconnect, AutoReconnectIntervalMs);
|
||||||
|
ReconnectTimer.Stop();
|
||||||
|
ReconnectTimer.Interval = AutoReconnectIntervalMs;
|
||||||
|
ReconnectTimer.Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
this.LogException(e, "Unhandled exception on connect");
|
this.LogException(e, "Unhandled exception on connect");
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
using PepperDash.Core;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the contract for IDspPresetsDirectRecall
|
||||||
|
/// </summary>
|
||||||
|
public interface IDspPresetsDirectRecall : IKeyed
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recalls the preset by name
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
void RunPreset(string name);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue