|
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
|
|
import android.app.AlarmManager;
|
|
import android.app.AlarmManager;
|
|
import android.app.PendingIntent;
|
|
import android.app.PendingIntent;
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
|
|
+import android.content.DialogInterface;
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
import android.content.SharedPreferences;
|
|
import android.content.SharedPreferences;
|
|
import android.net.ConnectivityManager;
|
|
import android.net.ConnectivityManager;
|
|
@@ -12,11 +13,16 @@ import android.net.wifi.WifiManager;
|
|
import android.os.CountDownTimer;
|
|
import android.os.CountDownTimer;
|
|
import android.os.Handler;
|
|
import android.os.Handler;
|
|
import android.os.Message;
|
|
import android.os.Message;
|
|
|
|
+import android.support.v7.app.AlertDialog;
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
import android.util.Log;
|
|
import android.util.Log;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
|
+import android.view.Window;
|
|
|
|
+import android.view.WindowManager;
|
|
|
|
+import android.widget.Button;
|
|
import android.widget.RadioButton;
|
|
import android.widget.RadioButton;
|
|
import android.widget.RadioGroup;
|
|
import android.widget.RadioGroup;
|
|
|
|
+import android.widget.SeekBar;
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
@@ -63,6 +69,7 @@ import java.util.ArrayList;
|
|
|
|
|
|
import okhttp3.Call;
|
|
import okhttp3.Call;
|
|
|
|
|
|
|
|
+import static com.wdkl.tradition.common.Constants.DEFAULT_VOLUME;
|
|
import static com.wdkl.tradition.common.Constants.EVENT_BROADCAST;
|
|
import static com.wdkl.tradition.common.Constants.EVENT_BROADCAST;
|
|
import static com.wdkl.tradition.common.Constants.EVENT_CALL_OUT;
|
|
import static com.wdkl.tradition.common.Constants.EVENT_CALL_OUT;
|
|
import static com.wdkl.tradition.common.Constants.EVENT_EMERGENCY_CALL;
|
|
import static com.wdkl.tradition.common.Constants.EVENT_EMERGENCY_CALL;
|
|
@@ -76,6 +83,7 @@ import static com.wdkl.tradition.common.Constants.EVENT_SIP_REGISTER_STATUS;
|
|
import static com.wdkl.tradition.common.Constants.EVENT_UDP;
|
|
import static com.wdkl.tradition.common.Constants.EVENT_UDP;
|
|
import static com.wdkl.tradition.common.Constants.isConversation;
|
|
import static com.wdkl.tradition.common.Constants.isConversation;
|
|
import static com.wdkl.tradition.common.Constants.isMacRegister;
|
|
import static com.wdkl.tradition.common.Constants.isMacRegister;
|
|
|
|
+import static com.wdkl.tradition.service.SerialSignalTypeEnum.MCU_MSG_DEVICEID_INFO;
|
|
import static com.wdkl.tradition.util.ethernetwifiwithsipconnectstatus.WifiBindSipStatusConnector.ethernetStatus;
|
|
import static com.wdkl.tradition.util.ethernetwifiwithsipconnectstatus.WifiBindSipStatusConnector.ethernetStatus;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -94,6 +102,7 @@ public class TraditionActivity extends BaseActivity implements ISerialPortListen
|
|
RadioButton rbDualMode, rbSingleMode;
|
|
RadioButton rbDualMode, rbSingleMode;
|
|
|
|
|
|
TextView version_tv;
|
|
TextView version_tv;
|
|
|
|
+ Button btnVolumeSet;
|
|
|
|
|
|
private InitDataEntity initDataEntity;
|
|
private InitDataEntity initDataEntity;
|
|
private RoomEntity roomEntity;
|
|
private RoomEntity roomEntity;
|
|
@@ -155,6 +164,13 @@ public class TraditionActivity extends BaseActivity implements ISerialPortListen
|
|
tvSerialReceive = findViewById(R.id.activity_tradition_layout_tv_serial_receive);
|
|
tvSerialReceive = findViewById(R.id.activity_tradition_layout_tv_serial_receive);
|
|
tvSerialSend = findViewById(R.id.activity_tradition_layout_tv_serial_send);
|
|
tvSerialSend = findViewById(R.id.activity_tradition_layout_tv_serial_send);
|
|
tvVersionname = findViewById(R.id.activity_tradition_layout_tv_versionname);
|
|
tvVersionname = findViewById(R.id.activity_tradition_layout_tv_versionname);
|
|
|
|
+ btnVolumeSet = findViewById(R.id.btn_volume_set);
|
|
|
|
+ btnVolumeSet.setOnClickListener(new View.OnClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
+ showTraditionVolumeSettingsDialog();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
|
|
|
|
|
|
groupCallMode = findViewById(R.id.group_calling_mode);
|
|
groupCallMode = findViewById(R.id.group_calling_mode);
|
|
@@ -250,7 +266,7 @@ public class TraditionActivity extends BaseActivity implements ISerialPortListen
|
|
netRefresh();
|
|
netRefresh();
|
|
CallVoiceShowProgress();
|
|
CallVoiceShowProgress();
|
|
|
|
|
|
- SerialPortService.getInstance().sendRegMode(0);
|
|
|
|
|
|
+ SerialPortService.getInstance().sendRegMode(0); //
|
|
}
|
|
}
|
|
|
|
|
|
private void CallVoiceShowProgress() {
|
|
private void CallVoiceShowProgress() {
|
|
@@ -292,6 +308,256 @@ public class TraditionActivity extends BaseActivity implements ISerialPortListen
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void showTraditionVolumeSettingsDialog() {
|
|
|
|
+ AlertDialog.Builder builder = new AlertDialog.Builder(TraditionActivity.this);
|
|
|
|
+ final AlertDialog dialog = builder.create();
|
|
|
|
+ dialog.setCanceledOnTouchOutside(false);
|
|
|
|
+ View dialogView = View.inflate(TraditionActivity.this, R.layout.dialog_volume_setting, null);
|
|
|
|
+ final TextView tvMainMic1 = dialogView.findViewById(R.id.tv_main_mic1);
|
|
|
|
+ final TextView tvMainMic2 = dialogView.findViewById(R.id.tv_main_mic2);
|
|
|
|
+ final TextView tvMainSpeak1 = dialogView.findViewById(R.id.tv_main_speak1);
|
|
|
|
+ final TextView tvMainSpeak2 = dialogView.findViewById(R.id.tv_main_speak2);
|
|
|
|
+ final TextView tvSubMic1 = dialogView.findViewById(R.id.tv_sub_mic1);
|
|
|
|
+ final TextView tvSubMic2 = dialogView.findViewById(R.id.tv_sub_mic2);
|
|
|
|
+ final TextView tvSubSpeak1 = dialogView.findViewById(R.id.tv_sub_speaker1);
|
|
|
|
+ final TextView tvSubSpeak2 = dialogView.findViewById(R.id.tv_sub_speaker2);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ final SeekBar mainMicBar1 = dialogView.findViewById(R.id.sb_main_mic1);
|
|
|
|
+ mainMicBar1.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
|
|
+ tvMainMic1.setText(String.valueOf(progress));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStartTrackingTouch(SeekBar seekBar) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStopTrackingTouch(SeekBar seekBar) {
|
|
|
|
+ Constants.TRADITION_VOLUMES[0] = seekBar.getProgress();
|
|
|
|
+ SerialPortService.getInstance().setMCUVolumes(Constants.TRADITION_VOLUMES);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.MainMic1, Constants.TRADITION_VOLUMES[0]);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ final SeekBar mainSpeakBar1 = dialogView.findViewById(R.id.sb_main_speak1);
|
|
|
|
+ mainSpeakBar1.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
|
|
+ tvMainSpeak1.setText(String.valueOf(progress));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStartTrackingTouch(SeekBar seekBar) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStopTrackingTouch(SeekBar seekBar) {
|
|
|
|
+ Constants.TRADITION_VOLUMES[1] = seekBar.getProgress();
|
|
|
|
+ SerialPortService.getInstance().setMCUVolumes(Constants.TRADITION_VOLUMES);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.MainSpeaker1, Constants.TRADITION_VOLUMES[1]);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ final SeekBar subMicBar1 = dialogView.findViewById(R.id.sb_sub_mic1);
|
|
|
|
+ subMicBar1.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
|
|
+ tvSubMic1.setText(String.valueOf(progress));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStartTrackingTouch(SeekBar seekBar) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStopTrackingTouch(SeekBar seekBar) {
|
|
|
|
+ Constants.TRADITION_VOLUMES[2] = seekBar.getProgress();
|
|
|
|
+ SerialPortService.getInstance().setMCUVolumes(Constants.TRADITION_VOLUMES);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.SubMic1, Constants.TRADITION_VOLUMES[2]);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ final SeekBar subSpeakerBar1 = dialogView.findViewById(R.id.sb_sub_speaker1);
|
|
|
|
+ subSpeakerBar1.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
|
|
+ tvSubSpeak1.setText(String.valueOf(progress));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStartTrackingTouch(SeekBar seekBar) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStopTrackingTouch(SeekBar seekBar) {
|
|
|
|
+ Constants.TRADITION_VOLUMES[3] = seekBar.getProgress();
|
|
|
|
+ SerialPortService.getInstance().setMCUVolumes(Constants.TRADITION_VOLUMES);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.SubSpeaker1, Constants.TRADITION_VOLUMES[3]);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ final SeekBar mainMicBar2 = dialogView.findViewById(R.id.sb_main_mic2);
|
|
|
|
+ mainMicBar2.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
|
|
+ tvMainMic2.setText(String.valueOf(progress));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStartTrackingTouch(SeekBar seekBar) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStopTrackingTouch(SeekBar seekBar) {
|
|
|
|
+ Constants.TRADITION_VOLUMES[4] = seekBar.getProgress();
|
|
|
|
+ SerialPortService.getInstance().setMCUVolumes(Constants.TRADITION_VOLUMES);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.MainMic2, Constants.TRADITION_VOLUMES[4]);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ final SeekBar mainSpeakBar2 = dialogView.findViewById(R.id.sb_main_speak2);
|
|
|
|
+ mainSpeakBar2.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
|
|
+ tvMainSpeak2.setText(String.valueOf(progress));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStartTrackingTouch(SeekBar seekBar) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStopTrackingTouch(SeekBar seekBar) {
|
|
|
|
+ Constants.TRADITION_VOLUMES[5] = seekBar.getProgress();
|
|
|
|
+ SerialPortService.getInstance().setMCUVolumes(Constants.TRADITION_VOLUMES);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.MainSpeaker2, Constants.TRADITION_VOLUMES[5]);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ final SeekBar subMicBar2 = dialogView.findViewById(R.id.sb_sub_mic2);
|
|
|
|
+ subMicBar2.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
|
|
+ tvSubMic2.setText(String.valueOf(progress));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStartTrackingTouch(SeekBar seekBar) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStopTrackingTouch(SeekBar seekBar) {
|
|
|
|
+ Constants.TRADITION_VOLUMES[6] = seekBar.getProgress();
|
|
|
|
+ SerialPortService.getInstance().setMCUVolumes(Constants.TRADITION_VOLUMES);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.SubMic2, Constants.TRADITION_VOLUMES[6]);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ final SeekBar subSpeakerBar2 = dialogView.findViewById(R.id.sb_sub_speaker2);
|
|
|
|
+ subSpeakerBar2.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
|
|
+ tvSubSpeak2.setText(String.valueOf(progress));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStartTrackingTouch(SeekBar seekBar) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStopTrackingTouch(SeekBar seekBar) {
|
|
|
|
+ Constants.TRADITION_VOLUMES[7] = seekBar.getProgress();
|
|
|
|
+ SerialPortService.getInstance().setMCUVolumes(Constants.TRADITION_VOLUMES);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.SubSpeaker2, Constants.TRADITION_VOLUMES[7]);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ Button btnSubmit = dialogView.findViewById(R.id.btn_submit);
|
|
|
|
+ btnSubmit.setOnClickListener(new View.OnClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
+ dialog.dismiss();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ Button btnRestore = dialogView.findViewById(R.id.btn_restore);
|
|
|
|
+ btnRestore.setOnClickListener(new View.OnClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
+ restoreVolumeSettings();
|
|
|
|
+
|
|
|
|
+ //更新UI
|
|
|
|
+ mainMicBar1.setProgress(DEFAULT_VOLUME);
|
|
|
|
+ mainSpeakBar1.setProgress(DEFAULT_VOLUME);
|
|
|
|
+ subMicBar1.setProgress(DEFAULT_VOLUME);
|
|
|
|
+ subSpeakerBar1.setProgress(DEFAULT_VOLUME);
|
|
|
|
+ mainMicBar2.setProgress(DEFAULT_VOLUME);
|
|
|
|
+ mainSpeakBar2.setProgress(DEFAULT_VOLUME);
|
|
|
|
+ subMicBar2.setProgress(DEFAULT_VOLUME);
|
|
|
|
+ subSpeakerBar2.setProgress(DEFAULT_VOLUME);
|
|
|
|
+
|
|
|
|
+ dialog.dismiss();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ dialog.setView(dialogView);
|
|
|
|
+ dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onShow(DialogInterface dialog) {
|
|
|
|
+ mainMicBar1.setProgress(Constants.TRADITION_VOLUMES[0]);
|
|
|
|
+ mainSpeakBar1.setProgress(Constants.TRADITION_VOLUMES[1]);
|
|
|
|
+ subMicBar1.setProgress(Constants.TRADITION_VOLUMES[2]);
|
|
|
|
+ subSpeakerBar1.setProgress(Constants.TRADITION_VOLUMES[3]);
|
|
|
|
+ mainMicBar2.setProgress(Constants.TRADITION_VOLUMES[4]);
|
|
|
|
+ mainSpeakBar2.setProgress(Constants.TRADITION_VOLUMES[5]);
|
|
|
|
+ subMicBar2.setProgress(Constants.TRADITION_VOLUMES[6]);
|
|
|
|
+ subSpeakerBar2.setProgress(Constants.TRADITION_VOLUMES[7]);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ dialog.show();
|
|
|
|
+
|
|
|
|
+ //设置dialog显示宽度
|
|
|
|
+ try {
|
|
|
|
+ Window window = dialog.getWindow();
|
|
|
|
+ WindowManager.LayoutParams lp = window.getAttributes();
|
|
|
|
+ lp.width = 960;
|
|
|
|
+ lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
|
|
|
+ window.setAttributes(lp);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void restoreVolumeSettings() {
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.MainMic1, DEFAULT_VOLUME);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.MainSpeaker1, DEFAULT_VOLUME);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.SubMic1, DEFAULT_VOLUME);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.SubSpeaker1, DEFAULT_VOLUME);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.MainMic2, DEFAULT_VOLUME);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.MainSpeaker2, DEFAULT_VOLUME);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.SubMic2, DEFAULT_VOLUME);
|
|
|
|
+ SharedPreferencesUtil.putIntSp(MyApplication.getAppContext(), Constants.MSG_SP, SharedPreferencesUtil.SubSpeaker2, DEFAULT_VOLUME);
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < Constants.TRADITION_VOLUMES.length; i++) {
|
|
|
|
+ Constants.TRADITION_VOLUMES[i] = DEFAULT_VOLUME;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ SerialPortService.getInstance().setMCUVolumes(Constants.TRADITION_VOLUMES);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
private void initSip() {
|
|
private void initSip() {
|
|
//=============================================SIP启动服务===================================//
|
|
//=============================================SIP启动服务===================================//
|
|
@@ -501,6 +767,7 @@ public class TraditionActivity extends BaseActivity implements ISerialPortListen
|
|
getRoomInfo();
|
|
getRoomInfo();
|
|
getSystemInfo();
|
|
getSystemInfo();
|
|
|
|
|
|
|
|
+ //SerialPortService.getInstance().checkDeviceId();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -664,7 +931,12 @@ public class TraditionActivity extends BaseActivity implements ISerialPortListen
|
|
}
|
|
}
|
|
|
|
|
|
String uartAddr = SerialPortService.getUAddr(model.getSlaveAddH(), model.getSlaveAddL());
|
|
String uartAddr = SerialPortService.getUAddr(model.getSlaveAddH(), model.getSlaveAddL());
|
|
- LogUtil.d("onSerialReceived", "addr==" + uartAddr);
|
|
|
|
|
|
+ LogUtil.d("wzl", "addr==" + uartAddr + ", serialSignalTypeEnum==" + serialSignalTypeEnum);
|
|
|
|
+ if (serialSignalTypeEnum == MCU_MSG_DEVICEID_INFO) {
|
|
|
|
+ //LogUtil.d("wzl", "data: " + new String(model.getData()));
|
|
|
|
+ LogUtil.d("wzl", "data: " + SerialPortService.bytesToHexString(model.getData()) + ", id: " + new String(model.getData()));
|
|
|
|
+ SerialPortService.getInstance().checkDeviceId();
|
|
|
|
+ }
|
|
if (isMacRegister) {
|
|
if (isMacRegister) {
|
|
switch (serialSignalTypeEnum) {
|
|
switch (serialSignalTypeEnum) {
|
|
case MCU_MSG_CALLIN_REQ:
|
|
case MCU_MSG_CALLIN_REQ:
|
|
@@ -947,6 +1219,8 @@ public class TraditionActivity extends BaseActivity implements ISerialPortListen
|
|
sbMainCallingVoiceSet.setProgress(voiceSys);
|
|
sbMainCallingVoiceSet.setProgress(voiceSys);
|
|
SharedPreferencesUtil.putIntSp(TraditionActivity.this, Constants.MSG_SP, SharedPreferencesUtil.SbCallingVoice, voiceSys);
|
|
SharedPreferencesUtil.putIntSp(TraditionActivity.this, Constants.MSG_SP, SharedPreferencesUtil.SbCallingVoice, voiceSys);
|
|
VoiceManagerUtil.setCallVoice(MyApplication.getAppContext(), voiceSys);
|
|
VoiceManagerUtil.setCallVoice(MyApplication.getAppContext(), voiceSys);
|
|
|
|
+ VoiceManagerUtil.setSystemVoice(MyApplication.getAppContext(), voiceSys);
|
|
|
|
+ VoiceManagerUtil.setMusicVoice(MyApplication.getAppContext(), voiceSys);
|
|
break;
|
|
break;
|
|
case "call_mode_change_tradition_system": //护士主机改变传统转接盒的通话模式
|
|
case "call_mode_change_tradition_system": //护士主机改变传统转接盒的通话模式
|
|
if (Constants.HOST_ID.equals(udpEntity.getNurseHostID())) {
|
|
if (Constants.HOST_ID.equals(udpEntity.getNurseHostID())) {
|
|
@@ -958,7 +1232,8 @@ public class TraditionActivity extends BaseActivity implements ISerialPortListen
|
|
break;
|
|
break;
|
|
case "tradition_check":
|
|
case "tradition_check":
|
|
String netState = ethernetStatus ? "1" : "0";
|
|
String netState = ethernetStatus ? "1" : "0";
|
|
- UdpSendUtil.sendTraditionState(netState, sipState);
|
|
|
|
|
|
+ String regState = isMacRegister ? "1" : "0";
|
|
|
|
+ UdpSendUtil.sendTraditionState(netState, sipState, regState);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|