using System; using System.Threading; using System.Threading.Tasks; using HC_APTBS.Models; namespace HC_APTBS.Services { /// /// Manages the immobilizer unlock sequence required by certain pump ECUs /// (e.g. Ford VP44 models) before they respond to test commands. /// public interface IUnlockService { /// Raised with progress text during the unlock sequence. event Action? StatusChanged; /// Raised when the unlock sequence completes. Argument is true if successful. event Action? UnlockCompleted; /// /// Runs the immobilizer unlock sequence for the given pump. /// Returns immediately if is 0 (no unlock needed). /// The persistent CAN senders remain active after this method returns; /// call when the pump is deselected. /// /// Pump definition with unlock type and CAN parameters. /// Cancellation token to abort the unlock sequence. Task UnlockAsync(PumpDefinition pump, CancellationToken ct); /// /// Stops the persistent CAN unlock senders. Call this when the pump is /// deselected or the application is shutting down. Safe to call when no /// senders are active. /// void StopSenders(); } }