Files
Substation/Program.cs
T
mute 44421a51e3 Implement Substation: BLE-WS bridge with music-reactive e-stim
- Renamed from CoyoteBridge to Substation (namespace, classes, UI)
- BLE connection via WinRT with graceful disconnect handling
- WebSocket server (127.0.0.1:8765) with single-client, push events
  for BLE connect/disconnect transitions
- Operator strength limiter (clamp/scale modes, default 30)
- Tray icon with 3 states: neutral/active/hot (runtime-drawn voltage glyph)
- A/B strength gauges, hide-on-minimise to tray
- Music mode: MP3 decode + FFT analysis (NAudio + FftSharp), rhythm→ch A,
  melody→ch B, pre-analyzed with synced audio playback
- Test/Stop All work without BLE connected (dev mode)
- WS device-driving commands error when BLE not connected; ping/status/
  connect always work
- TreatWarningsAsErrors, LangVersion=latest
- .gitignore, README with full API docs + attribution
2026-08-08 10:46:25 +00:00

25 lines
508 B
C#

namespace Substation;
static class Program
{
public const int Port = 8765;
[STAThread]
static void Main()
{
ApplicationConfiguration.Initialize();
using var device = new CoyoteDevice();
var state = new State();
var server = new Server(device, state, Port);
device.StrengthChanged += (a, b) =>
{
state.ActualA = a;
state.ActualB = b;
};
Application.Run(new MainForm(device, state, server));
}
}