private async Task <TelemetryRow> GetTelemetryRowForDemodedData(ObservationEntry observationEntry, ObservationEntry.DemodDataEntry demodedData)
        {
            HttpContent httpContents = await satnogsNetworkApi.GetObservationData(observationEntry.Id, demodedData.ResourceName);

            byte[] data = await httpContents.ReadAsByteArrayAsync();

            var fecResult     = FecHelpers.DecodePayload(data, 16, 0, false);
            var beaconDecoded = BeaconDecoder.DecodeBeacon(fecResult.PayloadCorrected ?? fecResult.PayloadUncorrected);

            return(new TelemetryRow()
            {
                Observation = observationEntry,
                DemodData = demodedData,
                FecDecodeResult = fecResult,
                Acrux1Beacon = beaconDecoded
            });
        }
Exemple #2
0
        public IActionResult DecodePost(DecodeViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(viewModel));
            }

            // Preamble length is 16 because beacons have an Ax25 frame in the first 16 bytes which does not participate
            // in the FEC block.
            //
            var fecResult     = FecHelpers.DecodePayload(viewModel.HexPayloadOriginal, 16, 0, false);
            var beaconDecoded = BeaconDecoder.DecodeBeacon(fecResult.PayloadCorrected ?? fecResult.PayloadUncorrected);

            viewModel.FecDecodeResult = fecResult;
            viewModel.Acrux1Beacon    = beaconDecoded;

            return(View(viewModel));
        }