-
Notifications
You must be signed in to change notification settings - Fork 2
/
StatusHub.cs
34 lines (28 loc) · 1.01 KB
/
StatusHub.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using Microsoft.AspNetCore.SignalR;
namespace EVCharging
{
public class StatusHub : Hub
{
private IHubContext<StatusHub> _context;
public StatusHub(IHubContext<StatusHub> context)
{
_context = context;
}
public void AddChargers(string chargers)
{
_context.Clients.All.SendAsync("addChargers", chargers).GetAwaiter().GetResult();
}
public void AddChart(string name, string[] timestamps, float[] values)
{
_context.Clients.All.SendAsync("addChart", name, timestamps, values).GetAwaiter().GetResult();
}
public void AvailableStatus(bool chargerAvailable)
{
_context.Clients.All.SendAsync("availableStatus", chargerAvailable).GetAwaiter().GetResult();
}
public void AddTable(string key, string content)
{
_context.Clients.All.SendAsync("addTable", key, content).GetAwaiter().GetResult();
}
}
}