public void Dispose()
        {
            if (!_disposed)
            {
                _disposed = true;

                if (_monitor is not null)
                {
                    _monitor.Dispose();
                    _monitor = null;
                }

                if (_heartbeatService is not null)
                {
                    _heartbeatService.Dispose();
                    _heartbeatService = null;
                }

                if (_parametersService is not null)
                {
                    _parametersService.Dispose();
                    _parametersService = null;
                }
            }
        }
示例#2
0
 public NodeDescriptor(NodeMonitor monitor, NodeHandle handle, DateTime registered)
 {
     _monitor   = monitor ?? throw new ArgumentNullException(nameof(monitor));
     Handle     = handle;
     Registered = registered;
     Updated    = registered;
     Info       = new NodeInfo();
     Status     = new NodeData();
 }
        internal CommunicationServicesProvider(UavcanService uavcanService)
        {
            if (uavcanService is null)
            {
                throw new ArgumentNullException(nameof(uavcanService));
            }

            _monitor           = new NodeMonitor(uavcanService.Engine);
            _heartbeatService  = new HeartbeatService(uavcanService.Engine);
            _parametersService = new ParametersService(uavcanService.Engine);
        }