2021-01-27 10:52:54 +00:00
|
|
|
package com.radio.codec2talkie.protocol;
|
2020-12-04 20:11:37 +00:00
|
|
|
|
2022-07-18 19:24:48 +00:00
|
|
|
import com.radio.codec2talkie.protocol.message.TextMessage;
|
2022-07-02 09:12:07 +00:00
|
|
|
import com.radio.codec2talkie.protocol.position.Position;
|
|
|
|
|
2022-07-03 09:05:00 +00:00
|
|
|
public abstract class ProtocolCallback {
|
2022-07-01 14:18:37 +00:00
|
|
|
// receive
|
2022-07-02 09:12:07 +00:00
|
|
|
abstract protected void onReceivePosition(Position position);
|
2023-12-09 12:27:49 +00:00
|
|
|
abstract protected void onReceivePcmAudio(String src, String dst, short[] pcmFrame);
|
|
|
|
abstract protected void onReceiveCompressedAudio(String src, String dst, byte[] frame);
|
2022-07-18 19:24:48 +00:00
|
|
|
abstract protected void onReceiveTextMessage(TextMessage textMessage);
|
2022-08-19 16:53:43 +00:00
|
|
|
abstract protected void onReceiveData(String src, String dst, String path, byte[] data);
|
2022-07-01 08:51:55 +00:00
|
|
|
abstract protected void onReceiveSignalLevel(short rssi, short snr);
|
2022-12-17 21:58:44 +00:00
|
|
|
abstract protected void onReceiveTelemetry(int batVoltage);
|
2022-07-01 14:39:45 +00:00
|
|
|
abstract protected void onReceiveLog(String logData);
|
2022-07-01 14:18:37 +00:00
|
|
|
|
|
|
|
// transmit
|
2023-12-09 12:27:49 +00:00
|
|
|
abstract protected void onTransmitPcmAudio(String src, String dst, short[] frame);
|
|
|
|
abstract protected void onTransmitCompressedAudio(String src, String dst, byte[] frame);
|
2022-07-18 19:24:48 +00:00
|
|
|
abstract protected void onTransmitTextMessage(TextMessage textMessage);
|
2022-07-31 14:03:31 +00:00
|
|
|
abstract protected void onTransmitPosition(Position position);
|
2022-08-19 16:53:43 +00:00
|
|
|
abstract protected void onTransmitData(String src, String dst, String path, byte[] data);
|
2022-07-01 14:39:45 +00:00
|
|
|
abstract protected void onTransmitLog(String logData);
|
2022-07-01 14:18:37 +00:00
|
|
|
|
|
|
|
// errors
|
2021-10-19 18:20:11 +00:00
|
|
|
abstract protected void onProtocolRxError();
|
2022-07-01 14:18:37 +00:00
|
|
|
abstract protected void onProtocolTxError();
|
2022-06-29 19:23:02 +00:00
|
|
|
}
|