Ejemplo n.º 1
0
        private void RegisterDevice(DeviceGatewayService deviceGatewayService)
        {
            var deviceGuid = deviceGatewayService.DeviceGuid;

            _deviceGatewayServicesByDevice.Add(deviceGuid, deviceGatewayService);
            _deviceService.SubscribeToCommands(deviceGuid.ToString(), deviceGatewayService.DeviceKey);
        }
Ejemplo n.º 2
0
        private void OnAddConnection(IBinaryConnection binaryConnection)
        {
            var deviceGatewayService = new DeviceGatewayService(binaryConnection, this);

            _deviceGatewayServicesByConnection.Add(binaryConnection, deviceGatewayService);

            if (IsStarted)
            {
                deviceGatewayService.Start();
            }
        }