/// <summary>
 /// Create an instance of <see cref="ILoraWanGateway"/>.
 /// </summary>
 /// <param name="transceiver">The transceiver.</param>
 /// <param name="gatewaySettings">The gateway settings of <see cref="ILoraWanGateway"/>.</param>
 /// <param name="gatewayEui">The unique Gateway EUI.</param>
 /// <param name="positionProvider">Optional. Interface to a <see cref="IPositionProvider"/>.</param>
 /// <returns></returns>
 public static ILoraWanGateway Create(
     ITransceiver transceiver,
     LoraWanGatewaySettings gatewaySettings,
     GatewayEui gatewayEui,
     IPositionProvider positionProvider = null)
 {
     return(new LoraWanGateway(
                transceiver,
                gatewaySettings,
                gatewayEui,
                positionProvider ?? FixedPositionProvider.NoPositionProvider));
 }
        public LoraWanGateway(
            ITransceiver transceiver,
            LoraWanGatewaySettings gatewaySettings,
            GatewayEui gatewayEui,
            IPositionProvider positionProvider)
        {
            _stopwatch.Start();

            _transceiver        = transceiver;
            _gatewaySettings    = gatewaySettings;
            _positionProvider   = positionProvider;
            _loraNetworkClients = gatewaySettings.Hosts
                                  .Select(x => new LoraNetworkClient(new HostName(x), 1700))
                                  .ToArray();

            _messageComposer = new MessageComposer(gatewayEui);

            _transceiver.OnMessageReceived += TransceiverOnMessageReceived;

            _datr = GetSF() + GetBW();
            _codr = GetCodr();
        }