internal static LoRaDevice CreateFromSimulatedDevice( SimulatedDevice simulatedDevice, ILoRaDeviceClient loRaDeviceClient, DefaultLoRaDataRequestHandler requestHandler = null, ILoRaDeviceClientConnectionManager connectionManager = null) { var result = new LoRaDevice(simulatedDevice.LoRaDevice.DevAddr, simulatedDevice.LoRaDevice.DeviceID, connectionManager ?? new SingleDeviceConnectionManager(loRaDeviceClient)) { AppEUI = simulatedDevice.LoRaDevice.AppEUI, AppKey = simulatedDevice.LoRaDevice.AppKey, SensorDecoder = simulatedDevice.LoRaDevice.SensorDecoder, AppSKey = simulatedDevice.LoRaDevice.AppSKey, NwkSKey = simulatedDevice.LoRaDevice.NwkSKey, GatewayID = simulatedDevice.LoRaDevice.GatewayID, IsOurDevice = true, ClassType = (simulatedDevice.ClassType == 'C' || simulatedDevice.ClassType == 'c') ? LoRaDeviceClassType.C : LoRaDeviceClassType.A, }; result.SetFcntDown(simulatedDevice.FrmCntDown); result.SetFcntUp(simulatedDevice.FrmCntUp); result.AcceptFrameCountChanges(); if (requestHandler != null) { result.SetRequestHandler(requestHandler); } return(result); }
public TestLoRaDeviceFactory(ILoRaDeviceClient loRaDeviceClient, ILoRaDeviceClientConnectionManager connectionManager = null) { this.loRaDeviceClient = loRaDeviceClient; this.connectionManager = connectionManager ?? new LoRaDeviceClientConnectionManager(new MemoryCache(new MemoryCacheOptions { ExpirationScanFrequency = TimeSpan.FromSeconds(5), })); }
public MultiGatewayFrameCounterUpdateStrategyTest() { this.deviceClient = new Mock <ILoRaDeviceClient>(); this.deviceApi = new Mock <LoRaDeviceAPIServiceBase>(MockBehavior.Strict); this.gatewayID = "test-gateway"; this.connectionManager = new SingleDeviceConnectionManager(this.deviceClient.Object); this.device = new LoRaDevice(new DevAddr(1), new DevEui(2), connectionManager); }
public TestLoRaDeviceFactory( NetworkServerConfiguration configuration, ILoRaDeviceClient loRaDeviceClient, ILoRaDeviceClientConnectionManager connectionManager, LoRaDeviceCache deviceCache, ILoRaDataRequestHandler requestHandler) : this(requestHandler, connectionManager, deviceCache, configuration, loRaDeviceClient) { }
public TestDeviceFactory(NetworkServerConfiguration configuration = null, ILoRaDeviceClientConnectionManager connectionManager = null, LoRaDeviceCache loRaDeviceCache = null, Action <Mock <LoRaDevice> > deviceSetup = null, Meter meter = null) : base(configuration ?? new NetworkServerConfiguration(), new Mock <ILoRaDataRequestHandler>().Object, connectionManager ?? new Mock <ILoRaDeviceClientConnectionManager>().Object, loRaDeviceCache, NullLoggerFactory.Instance, NullLogger <LoRaDeviceFactory> .Instance, meter) { this.deviceSetup = deviceSetup; }
public LoRaDeviceFactory(NetworkServerConfiguration configuration, ILoRaDataRequestHandler dataRequestHandler, ILoRaDeviceClientConnectionManager connectionManager, LoRaDeviceCache loRaDeviceCache, ILoggerFactory loggerFactory, ILogger <LoRaDeviceFactory> logger, Meter meter) { this.configuration = configuration; this.dataRequestHandler = dataRequestHandler; this.connectionManager = connectionManager; this.loggerFactory = loggerFactory; this.logger = logger; this.meter = meter; this.loRaDeviceCache = loRaDeviceCache; }
private TestLoRaDeviceFactory(ILoRaDataRequestHandler requestHandler, ILoRaDeviceClientConnectionManager connectionManager, LoRaDeviceCache deviceCache, NetworkServerConfiguration configuration, ILoRaDeviceClient loRaDeviceClient) : base(configuration ?? new NetworkServerConfiguration { GatewayID = MessageProcessorTestBase.ServerGatewayID }, requestHandler, connectionManager, deviceCache, NullLoggerFactory.Instance, NullLogger <LoRaDeviceFactory> .Instance, meter: null) { this.loRaDeviceClient = loRaDeviceClient; }
public TestLoRaDeviceFactory( NetworkServerConfiguration configuration, ILoRaDeviceFrameCounterUpdateStrategyProvider frameCounterUpdateStrategyProvider, ILoRaDeviceClient loRaDeviceClient, IDeduplicationStrategyFactory deduplicationFactory, ILoRaADRStrategyProvider adrStrategyProvider, ILoRAADRManagerFactory adrManagerFactory, IFunctionBundlerProvider functionBundlerProvider, ILoRaDeviceClientConnectionManager connectionManager) : this(loRaDeviceClient) { this.configuration = configuration; this.frameCounterUpdateStrategyProvider = frameCounterUpdateStrategyProvider; this.deduplicationFactory = deduplicationFactory; this.adrStrategyProvider = adrStrategyProvider; this.adrManagerFactory = adrManagerFactory; this.functionBundlerProvider = functionBundlerProvider; this.connectionManager = connectionManager; }
public LoRaDeviceFactory(NetworkServerConfiguration configuration, DefaultLoRaDataRequestHandler dataRequestHandler, ILoRaDeviceClientConnectionManager connectionManager) { this.configuration = configuration; this.dataRequestHandler = dataRequestHandler; this.connectionManager = connectionManager; }
public SingleGatewayFrameCounterUpdateStrategyTest() { this.deviceClient = new Mock <ILoRaDeviceClient>(); this.connectionManager = new SingleDeviceConnectionManager(this.deviceClient.Object); this.device = new LoRaDevice(new DevAddr(1), new DevEui(2), connectionManager); }
public TestLoRaDeviceFactory(ILoRaDeviceClient loRaDeviceClient, ILoRaDataRequestHandler requestHandler, LoRaDeviceCache deviceCache, ILoRaDeviceClientConnectionManager connectionManager = null) : this(requestHandler, connectionManager, deviceCache, null, loRaDeviceClient) { }
public TestLoRaDeviceFactory(ILoRaDeviceClient loRaDeviceClient, LoRaDeviceCache deviceCache, ILoRaDeviceClientConnectionManager connectionManager = null) : this(null, connectionManager, deviceCache, null, loRaDeviceClient) { }