/// <summary> /// Constructs for the given lower layer. /// </summary> /// <param name="lowerLayer">The lower layer for talking to this device.</param> /// <param name="oidLookup">The OID lookup table for the device.</param> /// <param name="osVersion">The SW version of the device.</param> /// <param name="model">The device's model name. Shall be the same name as used for the device name during OID database lookups.</param> /// <param name="options">The options to use.</param> public AlixDeviceHandler(ISnmpLowerLayer lowerLayer, IDeviceSpecificOidLookup oidLookup, SemanticVersion osVersion, string model, IQuerierOptions options) : base(lowerLayer, oidLookup, osVersion, model, options) { if ((options.AllowedApis & this.SupportedApi) == 0) { throw new ArgumentOutOfRangeException(nameof(options), $"This device handler doesn't support any of the APIs allowed by the IQuerierOptions (allowed: {options.AllowedApis}, supported {this.SupportedApi})."); } LazyLoadingDeviceSystemData llsd = lowerLayer.SystemData as LazyLoadingDeviceSystemData; if (llsd != null) { if (oidLookup.TryGetValue(RetrievableValuesEnum.RxSignalStrengthCh0AppendMacAndInterfaceId, out DeviceSpecificOid oid0) && !oid0.Oid.IsNull) { // for ALIX/H4L devices we currently only support RSSI querying llsd.SupportedFeatures = DeviceSupportedFeatures.Rssi; } } }
/// <summary> /// Initializes the device system data container. /// </summary> private void InitSystemData() { this.cachedSystemData = new LazyLoadingDeviceSystemData(this); }