This commit is contained in:
Đăng Nguyễn
2025-12-23 09:52:42 +07:00
parent e4e135e35f
commit a51cfe80c8
12 changed files with 80 additions and 194 deletions

View File

@@ -21,8 +21,8 @@ namespace RobotApp.Hubs
// Phương thức này sẽ được gọi từ service để broadcast
public async Task SendState(string serialNumber, StateMsg state)
{
var json = JsonSerializer.Serialize(state, JsonOptionExtends.Write);
await Clients.Group(serialNumber).SendAsync("ReceiveState", json);
//var json = JsonSerializer.Serialize(state, JsonOptionExtends.Write);
await Clients.Group(serialNumber).SendAsync("ReceiveState", state);
}
}
}

View File

@@ -12,3 +12,7 @@ public class RobotMonitorHub : Hub