kopia lustrzana https://github.com/N0BOY/FT8CN
TrUSDXRig: Remove dead comments
rodzic
8bbcc2be6f
commit
1f09f61e8d
|
@ -434,7 +434,7 @@ public class FT8TransmitSignal {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log.d(TAG, "playFT8Signal: 退出网络音频发送。");
|
Log.d(TAG, "playFT8Signal: transmitting over CAT is finished.");
|
||||||
afterPlayAudio();
|
afterPlayAudio();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,6 @@ public class TrUSDXRig extends BaseRig {
|
||||||
private static final int txSampling = 11520;
|
private static final int txSampling = 11520;
|
||||||
private final StringBuilder buffer = new StringBuilder();
|
private final StringBuilder buffer = new StringBuilder();
|
||||||
private final ByteArrayOutputStream rxStreamBuffer = new ByteArrayOutputStream();
|
private final ByteArrayOutputStream rxStreamBuffer = new ByteArrayOutputStream();
|
||||||
//private final Resample rxResample = new Resample(Resample.ConverterType.SRC_LINEAR, 1, rxSampling, 12000);
|
|
||||||
//private final Resample txResample = new Resample(Resample.ConverterType.SRC_SINC_FASTEST, 1, 48000, txSampling);
|
|
||||||
|
|
||||||
private Timer readFreqTimer = new Timer();
|
private Timer readFreqTimer = new Timer();
|
||||||
private int swr=0;
|
private int swr=0;
|
||||||
|
@ -117,7 +115,6 @@ public class TrUSDXRig extends BaseRig {
|
||||||
public void onReceiveData(byte[] data) {
|
public void onReceiveData(byte[] data) {
|
||||||
byte[] remain = data;
|
byte[] remain = data;
|
||||||
String s = new String(data);
|
String s = new String(data);
|
||||||
Log.d(TAG, "data received: " + s);
|
|
||||||
while (s.contains(";")) { // ;
|
while (s.contains(";")) { // ;
|
||||||
// TODO apply effective way
|
// TODO apply effective way
|
||||||
int idx = s.indexOf(";");
|
int idx = s.indexOf(";");
|
||||||
|
@ -138,7 +135,6 @@ public class TrUSDXRig extends BaseRig {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String cmd=yaesu3Command.getCommandID();
|
String cmd=yaesu3Command.getCommandID();
|
||||||
Log.i(TAG, "command: " + cmd);
|
|
||||||
if (cmd.equalsIgnoreCase("FA")) {//频率
|
if (cmd.equalsIgnoreCase("FA")) {//频率
|
||||||
long tempFreq=Yaesu3Command.getFrequency(yaesu3Command);
|
long tempFreq=Yaesu3Command.getFrequency(yaesu3Command);
|
||||||
if (tempFreq!=0) {//如果tempFreq==0,说明频率不正常
|
if (tempFreq!=0) {//如果tempFreq==0,说明频率不正常
|
||||||
|
@ -241,8 +237,6 @@ public class TrUSDXRig extends BaseRig {
|
||||||
float[] wave = GenerateFT8.generateFt8(message, GeneralVariables.getBaseFrequency()
|
float[] wave = GenerateFT8.generateFt8(message, GeneralVariables.getBaseFrequency()
|
||||||
// ,txSampling);
|
// ,txSampling);
|
||||||
, 24000);
|
, 24000);
|
||||||
// ,48000);
|
|
||||||
//Log.i(TAG, String.format("wave length: %d", wave.length));
|
|
||||||
if (wave == null){
|
if (wave == null){
|
||||||
setPTT(false);
|
setPTT(false);
|
||||||
return;
|
return;
|
||||||
|
@ -252,9 +246,6 @@ public class TrUSDXRig extends BaseRig {
|
||||||
byte[] resampled = txResample.processCopy(pcm16);
|
byte[] resampled = txResample.processCopy(pcm16);
|
||||||
txResample.close();
|
txResample.close();
|
||||||
byte[] pcm8 = toWaveSamples16To8(resampled);
|
byte[] pcm8 = toWaveSamples16To8(resampled);
|
||||||
//byte[] pcm8 = resampled;
|
|
||||||
//byte[] pcm8 = toWaveFloatToPCM8(wave);
|
|
||||||
Log.i(TAG, String.format("pcm8 length: %d", pcm8.length));
|
|
||||||
for (int i = 0; i < pcm8.length; i++) {
|
for (int i = 0; i < pcm8.length; i++) {
|
||||||
if (pcm8[i] == 0x3B) pcm8[i] = 0x3A; // ; to :
|
if (pcm8[i] == 0x3B) pcm8[i] = 0x3A; // ; to :
|
||||||
}
|
}
|
||||||
|
@ -267,19 +258,6 @@ public class TrUSDXRig extends BaseRig {
|
||||||
pcm8 = Arrays.copyOfRange(pcm8, 256, pcm8.length);
|
pcm8 = Arrays.copyOfRange(pcm8, 256, pcm8.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
for (int i = 0; i < pcm8.length; i += 64) {
|
|
||||||
if (!isPttOn()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
getConnector().sendData(Arrays.copyOfRange(pcm8, i, Math.min(i + 64, pcm8.length)));
|
|
||||||
//try {
|
|
||||||
// Thread.sleep(1);
|
|
||||||
//} catch (InterruptedException e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static byte[] toWaveSamples8To16(byte[] in) {
|
private static byte[] toWaveSamples8To16(byte[] in) {
|
||||||
|
|
Ładowanie…
Reference in New Issue