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
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user