kopia lustrzana https://github.com/sh123/codec2_talkie
Merge branch 'master' into legacy
commit
16c8bf9056
|
@ -2,7 +2,7 @@
|
|||
![APK](https://img.shields.io/endpoint?url=https://apt.izzysoft.de/fdroid/api/v1/shield/com.radio.codec2talkie)
|
||||
|
||||
# Introduction
|
||||
**Turn your Android phone into real Amateur Radio VHF/UHF APRS enabled Codec2 DV (digital voice) transceiver (requires additional digital radio hardware/software modem)**
|
||||
**Turn your Android phone into real Amateur Radio VHF/UHF APRS enabled Codec2 DV (digital voice) handheld transceiver. Requires additional hardware or software (e.g. Direwolf) radio modem.**
|
||||
|
||||
For more information visit project [Wiki](https://github.com/sh123/codec2_talkie/wiki)
|
||||
|
||||
|
|
|
@ -540,7 +540,6 @@ public class MainActivity extends AppCompatActivity {
|
|||
_appService.startTracking();
|
||||
item.setTitle(R.string.menu_stop_tracking);
|
||||
}
|
||||
updateStatusText(ProtocolFactory.getBaseProtocolType(getApplicationContext()));
|
||||
return true;
|
||||
}
|
||||
else if (itemId == R.id.messages) {
|
||||
|
@ -747,6 +746,10 @@ public class MainActivity extends AppCompatActivity {
|
|||
case EV_TX_ERROR:
|
||||
_btnPtt.setText(R.string.main_status_tx_error);
|
||||
break;
|
||||
case EV_STARTED_TRACKING:
|
||||
case EV_STOPPED_TRACKING:
|
||||
updateStatusText(ProtocolFactory.getBaseProtocolType(getApplicationContext()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.radio.codec2talkie.app;
|
||||
|
||||
public enum AppMessage {
|
||||
// events
|
||||
EV_DISCONNECTED(0),
|
||||
EV_CONNECTED(1),
|
||||
EV_LISTENING(2),
|
||||
|
@ -12,9 +13,14 @@ public enum AppMessage {
|
|||
EV_RX_ERROR(8),
|
||||
EV_TX_ERROR(9),
|
||||
EV_RX_RADIO_LEVEL(10),
|
||||
CMD_SEND_LOCATION(11),
|
||||
CMD_PROCESS(12),
|
||||
CMD_QUIT(13);
|
||||
EV_STARTED_TRACKING(11),
|
||||
EV_STOPPED_TRACKING(12),
|
||||
// commands
|
||||
CMD_SEND_LOCATION(13),
|
||||
CMD_PROCESS(14),
|
||||
CMD_QUIT(15),
|
||||
CMD_START_TRACKING(16),
|
||||
CMD_STOP_TRACKING(17);
|
||||
|
||||
private final int _value;
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ import android.os.IBinder;
|
|||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.Messenger;
|
||||
import android.os.PowerManager;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
@ -80,17 +79,21 @@ public class AppService extends Service {
|
|||
}
|
||||
|
||||
public void sendPosition() {
|
||||
_tracker.sendPosition();
|
||||
Message msg = Message.obtain();
|
||||
msg.what = AppMessage.CMD_SEND_LOCATION.toInt();
|
||||
_onProcess.sendMessage(msg);
|
||||
}
|
||||
|
||||
public void startTracking() {
|
||||
showServiceNotification(R.string.app_service_notif_text_tracking, R.drawable.ic_app_action);
|
||||
_tracker.startTracking();
|
||||
Message msg = Message.obtain();
|
||||
msg.what = AppMessage.CMD_START_TRACKING.toInt();
|
||||
_onProcess.sendMessage(msg);
|
||||
}
|
||||
|
||||
public void stopTracking() {
|
||||
showServiceNotification(R.string.app_service_notif_text_ptt_ready, R.drawable.ic_app_action);
|
||||
_tracker.stopTracking();
|
||||
Message msg = Message.obtain();
|
||||
msg.what = AppMessage.CMD_STOP_TRACKING.toInt();
|
||||
_onProcess.sendMessage(msg);
|
||||
}
|
||||
|
||||
public boolean isTracking() {
|
||||
|
@ -165,7 +168,7 @@ public class AppService extends Service {
|
|||
Log.i(TAG, "Started app worker: " + transportType.toString());
|
||||
|
||||
_appWorker = new AppWorker(transportType,
|
||||
onAudioProcessorStateChanged,
|
||||
_onProcess,
|
||||
getApplicationContext());
|
||||
_appWorker.start();
|
||||
|
||||
|
@ -183,7 +186,7 @@ public class AppService extends Service {
|
|||
}
|
||||
}
|
||||
|
||||
private final Handler onAudioProcessorStateChanged = new Handler(Looper.myLooper()) {
|
||||
private final Handler _onProcess = new Handler(Looper.myLooper()) {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
try {
|
||||
|
@ -203,6 +206,23 @@ public class AppService extends Service {
|
|||
case EV_LISTENING:
|
||||
hideVoiceNotification();
|
||||
break;
|
||||
case CMD_SEND_LOCATION:
|
||||
_tracker.sendPosition();
|
||||
break;
|
||||
case CMD_START_TRACKING:
|
||||
showServiceNotification(R.string.app_service_notif_text_tracking, R.drawable.ic_app_action);
|
||||
_tracker.startTracking();
|
||||
Message startedTrackingMessage = Message.obtain();
|
||||
startedTrackingMessage.what = AppMessage.EV_STARTED_TRACKING.toInt();
|
||||
deliverToParent(startedTrackingMessage);
|
||||
break;
|
||||
case CMD_STOP_TRACKING:
|
||||
showServiceNotification(R.string.app_service_notif_text_ptt_ready, R.drawable.ic_app_action);
|
||||
_tracker.stopTracking();
|
||||
Message stoppedTrackingMessage = Message.obtain();
|
||||
stoppedTrackingMessage.what = AppMessage.EV_STOPPED_TRACKING.toInt();
|
||||
deliverToParent(stoppedTrackingMessage);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue