package ru.r2cloud.satellite.decoder;

import ru.r2cloud.jradio.Ax25G3ruhBeaconSource;
import ru.r2cloud.jradio.Beacon;
import ru.r2cloud.jradio.BeaconSource;
import ru.r2cloud.jradio.FloatInput;
import ru.r2cloud.model.ObservationRequest;
import ru.r2cloud.predict.PredictOreKit;
import ru.r2cloud.util.Configuration;

public class FskAx25G3ruhDecoder extends TelemetryDecoder {

	private final int baudRate;
	private final Class<? extends Beacon> beacon;

	public FskAx25G3ruhDecoder(PredictOreKit predict, Configuration config, int baudRate, Class<? extends Beacon> beacon) {
		super(predict, config);
		this.baudRate = baudRate;
		this.beacon = beacon;
	}

	@Override
	public BeaconSource<? extends Beacon> createBeaconSource(FloatInput source, ObservationRequest req) {
		GmskDemodulator demodulator = new GmskDemodulator(source, baudRate, req.getBandwidth(), 0.175f * 3, 0.02f, 1, 2000);
		return new Ax25G3ruhBeaconSource<>(demodulator, beacon);
	}

	@Override
	public Class<? extends Beacon> getBeaconClass() {
		return beacon;
	}

}

@@ -189,16 +189,63 @@
 tInput;%0A
+import ru.r2cloud.jradio.demod.FskDemodulator;%0A
 import r
@@ -817,18 +817,17 @@
 eq) %7B%0A%09%09
-Gm
+F
 skDemodu
@@ -854,10 +854,9 @@
 new 
-Gm
+F
 skDe
@@ -887,54 +887,18 @@
 te, 
-req.getBandwidth(), 0.175f * 3, 0.02f, 1, 2000
+0.175f * 3
 );%0A%09

use FskDemodulator for ax25 generic decoders