public async ValueTask <uint> NextFcntDown(LoRaDevice loRaDevice, uint messageFcnt) { var result = await this.loRaDeviceAPIService.NextFCntDownAsync( devEUI : loRaDevice.DevEUI, fcntDown : loRaDevice.FCntDown, fcntUp : messageFcnt, gatewayId : this.gatewayID); if (result > 0) { loRaDevice.SetFcntDown(result); } return(result); }
public async ValueTask <uint> NextFcntDown(LoRaDevice loRaDevice, uint messageFcnt) { if (loRaDevice is null) { throw new System.ArgumentNullException(nameof(loRaDevice)); } var result = await this.loRaDeviceAPIService.NextFCntDownAsync( devEUI : loRaDevice.DevEUI, fcntDown : loRaDevice.FCntDown, fcntUp : messageFcnt, gatewayId : this.gatewayID); if (result > 0) { loRaDevice.SetFcntDown(result); } return(result); }
private async Task <FunctionBundlerResult> TryUseBundler(LoRaRequest request, LoRaDevice loRaDevice, LoRaPayloadData loraPayload, bool useMultipleGateways) { FunctionBundlerResult bundlerResult = null; if (useMultipleGateways) { var bundler = this.functionBundlerProvider.CreateIfRequired(this.configuration.GatewayID, loraPayload, loRaDevice, this.deduplicationFactory, request); if (bundler != null) { bundlerResult = await bundler.Execute(); if (bundlerResult.NextFCntDown.HasValue) { // we got a new framecounter down. Make sure this // gets saved eventually to the twins loRaDevice.SetFcntDown(bundlerResult.NextFCntDown.Value); } } } return(bundlerResult); }