using RioJoy.Core.Mapping; namespace RioJoy.Core.Serial; /// /// that sends lamp feedback back to the RIO as /// LampRequest packets over the serial link. Writes are fire-and-forget /// (lamp feedback is best-effort and must not block input routing). /// public sealed class SerialLampSink : ILampSink { private readonly RioSerialLink _link; public SerialLampSink(RioSerialLink link) { _link = link ?? throw new ArgumentNullException(nameof(link)); } public void SetLamp(int address, byte lampState) { _ = SendAsync((byte)address, lampState); } private async Task SendAsync(byte address, byte state) { try { await _link.SetLampAsync(address, state).ConfigureAwait(false); } catch { // Best-effort: a dropped lamp update must not crash the input path. } } }