private void RegisterDevice(DeviceGatewayService deviceGatewayService) { var deviceGuid = deviceGatewayService.DeviceGuid; _deviceGatewayServicesByDevice.Add(deviceGuid, deviceGatewayService); _deviceService.SubscribeToCommands(deviceGuid.ToString(), deviceGatewayService.DeviceKey); }
private void OnAddConnection(IBinaryConnection binaryConnection) { var deviceGatewayService = new DeviceGatewayService(binaryConnection, this); _deviceGatewayServicesByConnection.Add(binaryConnection, deviceGatewayService); if (IsStarted) { deviceGatewayService.Start(); } }