Merge branch 'master' (POS895/POS896 integration) into main

Resolution notes:
- Inspectron.Epson.Tests was added on both sides. Took the master version
  wholesale (POS895, CompositeDiscoveryService, SprtDiscoveryService,
  BitImagePrinting, PrinterRegistration tests). This drops the
  Configuration/, Sanity/ and Telemetry/ tests that existed only on main,
  and the test project's reference to EpsonPrintService.
- CLAUDE.md, PrintServerBootstrapper.cs and Inspectron.Epson.slnx
  auto-merged; verified the composite discovery binding and the Insin
  telemetry bindings both survive in the bootstrapper.

Solution builds with 0 errors; unit tests 33/33 pass on the merged tree.

Claude-Session: https://claude.ai/code/session_01KyCpB2jH3urYByRG5t98gz
This commit is contained in:
EugeneTes
2026-09-04 08:31:22 +02:00
40 changed files with 3472 additions and 349 deletions

View File

@@ -59,17 +59,19 @@ public class PrintServerBootstrapper
{
["127.0.0.2"] = ("emulation/u220.html", 0x13, 258),
["127.0.0.3"] = ("emulation/t30.html", 0x01, 384),
["127.0.0.4"] = ("emulation/pos895.html", 0x20, 576),
};
var discovery = new PreconfiguredDiscoveryService();
discovery.AddPrinter("127.0.0.2", "TM-U220II");
discovery.AddPrinter("127.0.0.3", "TM-T30III");
discovery.AddPrinter("127.0.0.4", "POS895");
_kernel.Bind<IDiscoveryService>().ToConstant(discovery).InSingletonScope();
_kernel.Bind<IPrinterFactory>().ToMethod(ctx =>
new EmulationPrinterFactory(emulationConfigs, ctx.Kernel.Get<ILogger>()));
Console.WriteLine("Emulation mode enabled: 127.0.0.2 (TM-U220II), 127.0.0.3 (TM-T30III)");
Console.WriteLine("Emulation mode enabled: 127.0.0.2 (TM-U220II), 127.0.0.3 (TM-T30III), 127.0.0.4 (POS895)");
}
else
{
@@ -80,7 +82,19 @@ public class PrintServerBootstrapper
//discovery.AddPrinter("192.168.1.124", "TM-T30III");
//_kernel.Bind<IDiscoveryService>().ToConstant(discovery).InSingletonScope();\
_kernel.Bind<IDiscoveryService>().To<DiscoveryService>().InSingletonScope();
// Epson printers answer ENPC; POS895/POS896 answer SPRT. Both broadcast
// on UDP 3289, but only the composite sees them all.
_kernel.Bind<IDiscoveryService>().ToMethod(ctx =>
{
var logger = ctx.Kernel.Get<ILogger>();
return new CompositeDiscoveryService(
new IDiscoveryService[]
{
new DiscoveryService(logger),
new SprtDiscoveryService(logger)
},
logger);
}).InSingletonScope();
_kernel.Bind<IPrinterFactory>().To<EpsonPrinterFactory>();
}
_kernel.Bind<IPrintJobSource, SignalRPrintJobSource>().To<SignalRPrintJobSource>().InSingletonScope();