Former-commit-id: 17970baeb930bbd2fd7a9e9bb77ed6f1da7a5aa8
TangShanKaiPing
wanggang 6 years ago
parent 4134f6dd9c
commit 78f27a1194

@ -639,7 +639,7 @@ namespace FBeeService
var device = this.GetDeviceByAddress(deviceRepo, sn, address); var device = this.GetDeviceByAddress(deviceRepo, sn, address);
if (device != null) if (device != null)
{ {
device.AddorUpdateData("State", ms.ReadInt(), DeviceDataType.Int, "状态"); device.AddorUpdateData(Keys.State, ms.ReadInt(), DeviceDataType.Int, "状态");
deviceRepo.SaveChanges(); deviceRepo.SaveChanges();
this.SendDevice(device); this.SendDevice(device);
} }
@ -1265,22 +1265,22 @@ namespace FBeeService
public void SendDevice(Device device) public void SendDevice(Device device)
{ {
Console.WriteLine("send device to server"); //Console.WriteLine("send device to server");
using (var scope = _applicationServices.CreateScope()) //using (var scope = _applicationServices.CreateScope())
{ //{
var clientService = scope.ServiceProvider.GetService<ClientService>(); // var clientService = scope.ServiceProvider.GetService<ClientService>();
clientService.SendDevice(device); // clientService.SendDevice(device);
} //}
} }
public void SendDeviceInfo(DeviceInfo deviceInfo) public void SendDeviceInfo(DeviceInfo deviceInfo)
{ {
Console.WriteLine("send device to server"); //Console.WriteLine("send device to server");
using (var scope = _applicationServices.CreateScope()) //using (var scope = _applicationServices.CreateScope())
{ //{
var clientService = scope.ServiceProvider.GetService<ClientService>(); // var clientService = scope.ServiceProvider.GetService<ClientService>();
clientService.SendDeviceInfo(deviceInfo); // clientService.SendDeviceInfo(deviceInfo);
}; //};
} }
} }
} }
Loading…
Cancel
Save