public IActionResult Get() { var dbc = DComCoreSingleton.GetSingleton().GetDelayBetweenCommands(); var timerManager = new TimerManager( () => hub.Clients.All.SendAsync("recieveMsg", new { status = DComCoreSingleton.GetSingleton().ConnectionState, list = DComCoreSingleton.GetSingleton().Points.ToList() }) , dbc); return(Ok(new { Message = "Request Completed" })); }
/// <summary> /// (SignalR - HTTP GET) /// Metod that handles request for log data througt client hub connection /// </summary> /// <returns>Log data</returns> public string Logs() { return(DComCoreSingleton.GetSingleton().GetLog()); }
/// <summary> /// (SignalR - HTTP POST) /// Metod that handles command request througt client hub connection /// </summary> /// <param name="model">Model of an command from client </param> public void Command(CommandRequest model) { DComCoreSingleton.GetSingleton().ExecuteCommand(model.PointId, model.Address, model.Value); }
public IActionResult ExecuteCommand(CommandRequest model) { DComCoreSingleton.GetSingleton().ExecuteCommand(model.PointId, model.Address, model.Value); return(Ok()); }
public IActionResult GetLogs() { return(Ok(new { log = DComCoreSingleton.GetSingleton().GetLog() })); }
// Dispose DComCore on the end of Application lifetime private void OnStop() { DComCoreSingleton.GetSingleton().Dispose(); }
public Startup(IConfiguration configuration) { Configuration = configuration; DComCoreSingleton.GetSingleton(); }