weizhengliang 2 лет назад
Родитель
Сommit
1ba202b43d

+ 1 - 3
app/build.gradle

@@ -7,7 +7,7 @@ android {
     buildToolsVersion rootProject.ext.build_tools_version
 
     defaultConfig {
-        applicationId "com.wdkl.ncs.s433.receiver"
+        applicationId "com.wdkl.ncs.s433.repeater"
         minSdkVersion rootProject.ext.minSdkVersion
         targetSdkVersion rootProject.ext.targetSdkVersion
         versionCode rootProject.ext.versionCode
@@ -78,8 +78,6 @@ dependencies {
 
     implementation project(':serialport')
 
-    implementation project(':listenvision')
-
     /**
      * json
      */

+ 46 - 279
app/src/main/java/com/wdkl/ncs/s433/receiver/MainActivity.java

@@ -1,7 +1,6 @@
 package com.wdkl.ncs.s433.receiver;
 
 import android.app.smdt.SmdtManager;
-import android.app.smdt.SmdtManagerNew;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.SharedPreferences;
@@ -9,8 +8,6 @@ import android.net.ConnectivityManager;
 import android.net.Network;
 import android.net.NetworkRequest;
 import android.os.Bundle;
-import android.os.SystemClock;
-import android.text.TextUtils;
 import android.util.Log;
 import android.view.View;
 import android.widget.Button;
@@ -21,23 +18,13 @@ import androidx.annotation.NonNull;
 import androidx.preference.PreferenceManager;
 
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.wdkl.ncs.s433.receiver.common.Constants;
-import com.wdkl.ncs.s433.receiver.data.TcpAction;
-import com.wdkl.ncs.s433.receiver.data.TcpModel;
-import com.wdkl.ncs.s433.receiver.data.TcpType;
-import com.wdkl.ncs.s433.receiver.led.LedItem;
-import com.wdkl.ncs.s433.receiver.led.LedManagerUtils;
-import com.wdkl.ncs.s433.receiver.media.RingPlayHelper;
 import com.wdkl.ncs.s433.receiver.receiver.NetworkConnectChangedReceiver;
 import com.wdkl.ncs.s433.receiver.data.EventBusModel;
 import com.wdkl.ncs.s433.receiver.settingconfig.SettingConfig;
 import com.wdkl.ncs.s433.receiver.utils.AppUtil;
 import com.wdkl.ncs.s433.receiver.utils.AutoRebootUtil;
-import com.wdkl.ncs.s433.receiver.utils.ByteUtil;
 import com.wdkl.ncs.s433.receiver.utils.NetUtil;
-import com.wdkl.ncs.s433.receiver.utils.SpeechUtil;
 import com.wdkl.ncs.s433.receiver.utils.VoiceManagerUtil;
 
 import org.apache.commons.lang3.ArrayUtils;
@@ -59,13 +46,12 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Random;
-import java.util.TimeZone;
 import java.util.Timer;
 import java.util.TimerTask;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 import java.util.zip.CRC32;
 
-import static android.serialport.SerialPort.DEFAULT_SU_PATH;
-
 public class MainActivity extends SerialPortActivity  {
     String TAG = "MainActivity";
     EditText mReception;
@@ -74,18 +60,18 @@ public class MainActivity extends SerialPortActivity  {
     String macAddress = "";
     String localIP = "";
 
-    String callbackString = "";
-
     private SmdtManager smdtManager;
     private boolean debugShow = false;
 
-    //发送给本机需要处理的消息
-    Map<String,Long> receivedMyCache = new HashMap<>();
     //缓存本机收到的消息和时间
     Map<String,Long> receivedCache = new HashMap<>();
     //调度延迟任务
     Timer timer = new Timer();
 
+    private final ExecutorService send433ThreadPool = Executors.newSingleThreadExecutor();
+    private TransDataThread transDataThread;
+    private ArrayList<String> repeatData = new ArrayList<>();
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -128,7 +114,7 @@ public class MainActivity extends SerialPortActivity  {
         TextView settingInfo = (TextView) findViewById(R.id.setttingInfo);
         StringBuilder sb = new StringBuilder();
         SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
-        String path = sp.getString("serialDeivce", "dev/ttyS7"); //sp.getString("DEVICE", "");
+        String path = sp.getString("serialDeivce", "dev/ttyS2"); //sp.getString("DEVICE", "");
         Log.i("Application", "getSerialPort: " + path);
         int baudrate = Integer.decode(sp.getString("baudRate", "115200")); //Integer.decode(sp.getString("BAUDRATE", "-1"));
         int parity = Integer.decode(sp.getString("parity", "0"));
@@ -164,12 +150,10 @@ public class MainActivity extends SerialPortActivity  {
         }
         VoiceManagerUtil.setMusicVoice(getApplicationContext(), volume*10);
 
-        initCallbackString();
-
         smdtManager = SmdtManager.create(this);
 
         //获取当前IP地址,如果IP不对则设置一下默认IP
-        String defaultIP = SettingConfig.getHostIp(getApplicationContext());
+        /*String defaultIP = SettingConfig.getHostIp(getApplicationContext());
         if (!defaultIP.equals(localIP)) {
             Log.e(TAG, "set default ip: " + defaultIP);
             try {
@@ -177,36 +161,7 @@ public class MainActivity extends SerialPortActivity  {
             } catch (Exception e) {
                 e.printStackTrace();
             }
-        }
-
-        SpeechUtil.getInstance().init(this, null);
-
-        setLedParams(SettingConfig.getLedIp(this), SettingConfig.getLedResolution(this), SettingConfig.getLedFontSize(this));
-
-
-        final String welcomeInfo = "欢迎使用";
-        LedManagerUtils.getInstance().updateProgram(welcomeInfo, 1);
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    Thread.sleep(5000);
-                    SpeechUtil.getInstance().speakSingleText(welcomeInfo);
-
-                    Thread.sleep(5000);
-                    LedManagerUtils.getInstance().updateProgram(welcomeInfo, 2);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        }).start();
-    }
-
-    private void setLedParams(String ledIp, String resolution, int fontSize) {
-        LedItem ledItem = new LedItem(resolution, ledIp, false, fontSize);
-        ArrayList<LedItem> list = new ArrayList<>();
-        list.add(ledItem);
-        LedManagerUtils.getInstance().setLedList(list);
+        }*/
     }
 
     @Override
@@ -220,8 +175,6 @@ public class MainActivity extends SerialPortActivity  {
         super.onDestroy();
         EventBus.getDefault().unregister(this);
         connectivityManager.unregisterNetworkCallback(callback);
-        SpeechUtil.getInstance().release();
-        LedManagerUtils.getInstance().release();
     }
 
     @Override
@@ -293,95 +246,10 @@ public class MainActivity extends SerialPortActivity  {
                     return;
                 }
 
-                TcpModel tcpModel = TcpModel.getModelByJson(tempData);
-                if (tcpModel != null) {
-                    //调试信息,给所有能收到433信号的点阵屏发送,1分钟后清除
-                    if (TcpAction.S433Action.EXIST == tcpModel.getAction()) {
-                        if (debugShow) {
-                            return;
-                        }
+                sendToOthers(data);
 
-                        debugShow = true;
-                        Log.e(TAG, "send 433 data ==>" + callbackString);
-                        sendMsg(callbackString, mOutputStream, 120);
-
-                        //显示调试信息
-                        final String debugInfo = "host IP: " + localIP
-                                + "\nhost mac: " + macAddress
-                                + "\nled IP: " + SettingConfig.getLedIp(getApplicationContext())
-                                + "\napp version: " + BuildConfig.VERSION_NAME;
-                        LedManagerUtils.getInstance().updateProgram(debugInfo, 1);
-                        //1分钟后清除调试信息
-                        new Thread(new Runnable() {
-                            @Override
-                            public void run() {
-                                try {
-                                    Thread.sleep(60000);
-
-                                    debugShow = false;
-                                    LedManagerUtils.getInstance().updateProgram(debugInfo, 2);
-                                } catch (Exception e) {
-                                    e.printStackTrace();
-                                }
-                            }
-                        }).start();
-
-                        return;
-                    }
-
-                    //点阵屏返回的ack信号不进行中继
-                    if (tcpModel.getAction() == TcpAction.S433Action.ACK) {
-                        return;
-                    }
-                }
-
-                if (tcpModel != null) {
-                    if (tcpModel.getData() != null) {
-                        JSONObject tcpData = JSON.parseObject(tcpModel.getData().toString());
-                        if (tcpData.getString("receiverMacs") != null) {
-                            //多个接收设备
-                            JSONArray macs = JSON.parseArray(tcpData.getString("receiverMacs"));
-                            for (int i = 0; i < macs.size(); i++) {
-                                if (macAddress.equalsIgnoreCase(macs.getString(i))) {
-                                    parseTcpData(tcpModel);
-
-                                    //Log.e(TAG, "send 433 data ==>" + callbackString);
-                                    //sendMsg(callbackString, mOutputStream, 120);
-
-                                    sendToOthers(data);
-                                    break;
-                                }
-                            }
-                        } else if (tcpData.getString("receiverMac") != null) {
-                            //单个接收设备
-                            String mac = tcpData.getString("receiverMac");
-                            if (macAddress.equalsIgnoreCase(mac)) {
-                                parseTcpData(tcpModel);
-
-                                Log.e(TAG, "send 433 data ==>" + callbackString);
-                                sendMsg(callbackString, mOutputStream, 120);
-                            } else {
-                                sendToOthers(data);
-                            }
-                        }
-                    }
-                }
-
-
-
-                //如果是发送给本机,则返回ack,并处理点阵屏数据
-                /*if (macAddress.equalsIgnoreCase(mac)) {
-                    if (tcpModel != null) {
-                        Log.e(TAG, "send 433 data ==>" + callbackString);
-                        //回复ack
-                        sendMsg(callbackString, mOutputStream, 120);
-
-                        parseTcpData(tcpModel);
-                    }
-                } else {
-                    //不是给本机的,转发
-                    sendToOthers(data);
-                }*/
+                //repeatData.add(data);
+                //execRepeatData();
 
             }
 
@@ -402,6 +270,38 @@ public class MainActivity extends SerialPortActivity  {
         return result;
     }
 
+    private void execRepeatData() {
+        if (transDataThread == null) {
+            transDataThread = new TransDataThread();
+        }
+        send433ThreadPool.execute(transDataThread);
+    }
+
+    public class TransDataThread implements Runnable {
+        @Override
+        public void run() {
+            if (repeatData.size() > 0) {
+                Iterator<String> iterator = repeatData.iterator();
+                while (iterator.hasNext()) {
+                    try {
+                        String data = iterator.next();
+                        Log.e(TAG, "trans 433 data ==>" + data);
+                        //433数据转发两次
+                        Thread.sleep(200);
+                        sendMsg(data, mOutputStream, 120);
+
+                        Thread.sleep(300);
+                        sendMsg(data, mOutputStream, 120);
+
+                        iterator.remove();
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+    }
+
     //中继发送
     private synchronized void sendToOthers(final String org) {
         //中继实现,每个机器收到一条消息后发出两次,第一次2秒内随机延迟,第二次3-4秒内随机延迟发送。可能会收到很多次。
@@ -420,8 +320,8 @@ public class MainActivity extends SerialPortActivity  {
             }
 
             Random random = new Random();
-            int i = random.nextInt(150) + 1;
-            int j = random.nextInt(100) + 200;
+            int i = random.nextInt(100) + 10;
+            int j = random.nextInt(100) + 150;
             if (!receivedCache.containsKey(org) || (receivedCache.containsKey(org) && ctime - receivedCache.get(org) > 30000)) {
                 receivedCache.put(org, ctime);
                 Integer[] taskTime = new Integer[]{i, j};
@@ -539,137 +439,6 @@ public class MainActivity extends SerialPortActivity  {
         return baKeyword;
     }
 
-
-
-    private void parseTcpData(TcpModel tcpModel) {
-        Log.e("Application", "action: " + tcpModel.getAction() + ", data: " + tcpModel.getData());
-        try {
-            //清理缓存超过15s的消息
-            long curTime = System.currentTimeMillis();
-            Iterator<Map.Entry<String, Long>> iterator = receivedMyCache.entrySet().iterator();
-            while (iterator.hasNext()) {
-                Map.Entry<String, Long> entry = iterator.next();
-                long cacheTime = entry.getValue();
-                String text = entry.getKey();
-                Log.e(TAG, "cache time: " + (curTime - cacheTime) + ", text: " + text);
-                if (curTime - cacheTime > 15000) {
-                    iterator.remove();
-                }
-            }
-
-            if (TcpAction.S433Action.CALL == tcpModel.getAction() || TcpAction.S433Action.SOS_CALL == tcpModel.getAction()) {
-                //显示呼叫
-                JSONObject jsonObject = JSON.parseObject(tcpModel.getData().toString());
-                String text = jsonObject.getString("title");
-
-                if (!TextUtils.isEmpty(text)) {
-                    if (receivedMyCache.containsKey(text)) {
-                        return;
-                    }
-                    receivedMyCache.put(text, curTime);
-
-                    if ("reboot".equals(text)) {
-                        //重启点阵屏
-                        LedManagerUtils.getInstance().removeAllProgram(true);
-                        SpeechUtil.getInstance().stopSpeak();
-
-                        //延迟5s重启Android板
-                        new Thread(new Runnable() {
-                            @Override
-                            public void run() {
-                                try {
-                                    Thread.sleep(5000);
-
-                                    if (smdtManager != null) {
-                                        smdtManager.smdtReboot("reboot");
-                                    }
-                                } catch (Exception e) {
-                                    e.printStackTrace();
-                                }
-                            }
-                        }).start();
-                    } else if (text.startsWith("led")) {
-                        //修改点阵屏IP
-                        int sepIndex = text.indexOf("@");
-                        String ledIP = text.substring(sepIndex+1);
-                        Log.e(TAG, "set led ip: " + ledIP);
-                        SettingConfig.setLedIp(getApplicationContext(), ledIP);
-                        setLedParams(ledIP, SettingConfig.getLedResolution(getApplicationContext()), SettingConfig.getLedFontSize(getApplicationContext()));
-                    } else if (text.startsWith("host")) {
-                        //修改Android控制板IP
-                        int sepIndex = text.indexOf("@");
-                        String hostIP = text.substring(sepIndex+1);
-                        Log.e(TAG, "set host ip: " + hostIP);
-                        try {
-                            smdtManager.smdtSetEthIPAddress(hostIP, "255.255.0.0", "172.28.100.1", "8.8.8.8");
-                            SettingConfig.setHostIp(getApplicationContext(), hostIP);
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        }
-                    } else {
-                        //点阵屏显示
-                        LedManagerUtils.getInstance().updateProgram(text, 1);
-                        //语音播报
-                        String speech = com.wdkl.ncs.s433.receiver.utils.StringUtils.appendSpace(text);
-                        SpeechUtil.getInstance().addSpeech(speech, false);
-                    }
-                }
-            } else if (TcpAction.S433Action.CANCEL == tcpModel.getAction()) {
-                //清除呼叫
-                JSONObject jsonObject = JSON.parseObject(tcpModel.getData().toString());
-                String text = jsonObject.getString("title");
-
-                if (TextUtils.isEmpty(text)) {
-                    //清除所有信息
-                    LedManagerUtils.getInstance().updateProgram("clearAll", 3);
-                    SpeechUtil.getInstance().stopSpeak();
-                } else {
-                    //清除对应呼叫
-                    LedManagerUtils.getInstance().updateProgram(text, 2);
-                    String speech = com.wdkl.ncs.s433.receiver.utils.StringUtils.appendSpace(text);
-                    SpeechUtil.getInstance().removeSpeak(speech);
-                }
-            } else if (TcpAction.S433Action.DATA == tcpModel.getAction()) {
-                //修改屏参
-                //action: DATA, data: {"volume":5,"led_style":"128*32","led_size":16}
-                JSONObject jsonObject = JSON.parseObject(tcpModel.getData().toString());
-                int volume = jsonObject.getIntValue("volume");
-                String ledType = jsonObject.getString("led_style");
-                int ledSize = jsonObject.getIntValue("led_size");
-                Log.e(TAG, "volume: " + volume + ", led type: " + ledType + ", led size: " + ledSize);
-
-                //保存屏参
-                SettingConfig.setLedVoiceVolume(getApplicationContext(), volume);
-                SettingConfig.setLedResolution(getApplicationContext(), ledType);
-                SettingConfig.setLedFontSize(getApplicationContext(), ledSize);
-                setLedParams(SettingConfig.getLedIp(this), ledType, ledSize);
-
-                if (volume > 0 && volume <= 10) {
-                    VoiceManagerUtil.setMusicVoice(getApplicationContext(), volume * 10);
-                }
-            } else if (TcpAction.S433Action.SYNC_TIME == tcpModel.getAction()) {
-                //同步时间
-                //action: SYNC_TIME, data: {"time_zone":"PRC","time":"1683626639"}
-                JSONObject jsonObject = JSON.parseObject(tcpModel.getData().toString());
-                String timezone = jsonObject.getString("time_zone");
-                long time = Long.parseLong(jsonObject.getString("time")) * 1000;
-
-                setSysTime(time, timezone);
-            }
-        } catch (Exception ex) {
-            ex.printStackTrace();
-        }
-    }
-
-    private void initCallbackString() {
-        TcpModel tcpModel = new TcpModel();
-        tcpModel.setType(TcpType.S433);
-        tcpModel.setAction(TcpAction.S433Action.ACK);
-        String tcpData = tcpModel.toJson();
-
-        callbackString = "$" + macAddress + tcpData + "#";
-    }
-
     private void openNetworkDebug() {
         try {
             Process p = Runtime.getRuntime().exec("su");
@@ -765,8 +534,6 @@ public class MainActivity extends SerialPortActivity  {
 
                 Log.e(TAG, "set sys time: " + time);
             }
-
-            LedManagerUtils.getInstance().syncTime();
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 1 - 4
app/src/main/java/com/wdkl/ncs/s433/receiver/MyApplication.java

@@ -8,7 +8,6 @@ import android.util.Log;
 
 import androidx.preference.PreferenceManager;
 
-import com.wdkl.ncs.s433.receiver.led.LedManagerUtils;
 import com.wdkl.ncs.s433.receiver.utils.AnrFcExceptionUtil;
 
 import java.io.IOException;
@@ -26,8 +25,6 @@ public class MyApplication extends android.app.Application {
         super.onCreate();
         context = getApplicationContext();
 
-        LedManagerUtils.getInstance().ledInit(this);
-
         AnrFcExceptionUtil.getInstance(this).initFCException();
     }
 
@@ -42,7 +39,7 @@ public class MyApplication extends android.app.Application {
         if (mSerialPort == null) {
             /* Read serial port parameters */
             SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
-            String path = sp.getString("serialDeivce","dev/ttyS7"); //sp.getString("DEVICE", "");
+            String path = sp.getString("serialDeivce","dev/ttyS2"); //sp.getString("DEVICE", "");
             Log.i("Application", "getSerialPort: " + path);
             int baudrate = Integer.decode(sp.getString("baudRate", "115200")); //Integer.decode(sp.getString("BAUDRATE", "-1"));
             int parity = Integer.decode(sp.getString("parity", "0"));

+ 0 - 566
app/src/main/java/com/wdkl/ncs/s433/receiver/led/LedC2MManager.java

@@ -1,566 +0,0 @@
-package com.wdkl.ncs.s433.receiver.led;
-
-import android.app.Application;
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.listenvision.LedC2M;
-import com.listenvision.model.VoiceModel;
-import com.wdkl.ncs.s433.receiver.MyApplication;
-import com.wdkl.ncs.s433.receiver.common.Constants;
-import com.wdkl.ncs.s433.receiver.settingconfig.SettingConfig;
-
-import java.io.File;
-import java.io.OutputStream;
-import java.net.DatagramPacket;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.SocketException;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.TimerTask;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-public class LedC2MManager extends LedManager {
-    private static final String TAG = "ledC2M";
-
-    private Application application;
-    private LedC2M ledC2M;
-    private static ArrayList<LedItem> ledList = new ArrayList<>();
-    private static List<LedProgram> programTextList = new ArrayList<>();
-    private static List<String> voiceProgramList = new ArrayList<>();
-    private static String voiceText;
-    private static String deleteVoiceText;
-    private static boolean stopVoice = false;
-
-    private static long LED_TIMEOUT = 5*60*1000L;
-
-    private final static Object lockObject = new Object();
-
-    @Override
-    public void init(Application application) {
-        ledC2M = new LedC2M();
-        ledC2M.init(application);
-        this.application = application;
-        File file = new File(Constants.C2M_LED_FONT_PATH);
-        if (file.exists()) {
-            Constants.ledFontExist = true;
-        } else {
-            copyFont();
-        }
-
-        //initScheduledExecutor();
-    }
-
-    @Override
-    public void copyFont() {
-        super.copyFont();
-        if (ledC2M != null) {
-            ledC2M.copyFontFile(new LedC2M.LedFontCheck() {
-                @Override
-                public void onChecked(boolean check) {
-                    Constants.ledFontExist = check;
-                    Log.d(TAG, "led font copy end...");
-                }
-            });
-        }
-    }
-
-    private void initScheduledExecutor() {
-        TimerTask timerTask = new TimerTask() {
-            @Override
-            public void run() {
-                synchronized (lockObject) {
-                    //每分钟查询一次点阵屏节目,超过5分钟的将自动移除
-                    Iterator<LedProgram> iterator = programTextList.iterator();
-                    long curTime = System.currentTimeMillis();
-                    boolean update = false;
-                    while (iterator.hasNext()) {
-                        if (curTime - iterator.next().getTime() > LED_TIMEOUT) {
-                            iterator.remove();
-                            update = true;
-                        }
-                    }
-
-                    if (update) {
-                        sendProgramStart();
-                    }
-                }
-            }
-        };
-        ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
-        executor.scheduleAtFixedRate(timerTask,60,90, TimeUnit.SECONDS);
-    }
-
-    @Override
-    public void initIpList() {
-        getLedDeviceIpList();
-    }
-
-    private void getLedDeviceIpList() {
-        //
-    }
-
-    @Override
-    public void setLedIpList(ArrayList<LedItem> list) {
-        ledList.clear();
-        if (list != null && list.size() > 0) {
-            ledList.addAll(list);
-        }
-
-        powerOnOff(true);
-    }
-
-    @Override
-    public ArrayList<LedItem> getLedList() {
-        return ledList;
-    }
-
-    private final ExecutorService updateThreadPool = Executors.newSingleThreadExecutor();
-    private SendProgramThread programThread;
-
-    //语音节目udp
-    private void sendVoiceUdp(String ip) {
-        int server_port = 9999;
-        String text = "";
-        byte[] data;
-
-        if (stopVoice) {
-            data = VoiceModel.getStopVoiceData();
-        } else {
-            text = voiceText;
-            for (int j = 0; j < 2; j++) {
-                text = text + "," + voiceText;
-            }
-            data = VoiceModel.getVoiceData(text);
-        }
-
-        DatagramSocket s = null;
-        try {
-            s = new DatagramSocket();
-        } catch (SocketException e) {
-            e.printStackTrace();
-        }
-        InetAddress local = null;
-        try {
-            local = InetAddress.getByName(ip);
-        } catch (UnknownHostException e) {
-            e.printStackTrace();
-        }
-
-        if (data != null) {
-            Log.d(TAG, "udp send voice text: " + voiceText + ", voice data hex string: " + VoiceModel.bytesToHexString(data));
-            DatagramPacket p = new DatagramPacket(data, data.length, local,
-                    server_port);
-            try {
-                s.send(p);
-                s.close();
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    //语音节目-tcp
-    private void sendVoiceTcp(String ip) {
-        try {
-            byte[] data;
-            String text = "";
-
-            if (stopVoice) {
-                data = VoiceModel.getStopVoiceData();
-            } else {
-                text = voiceText;
-                int loop = SettingConfig.getLedVoiceTimes(MyApplication.getContext()) - 1;
-                for (int j = 0; j < loop; j++) {
-                    text = text + "," + voiceText;
-                }
-                String volume = Integer.toString(SettingConfig.getLedVoiceVolume(MyApplication.getContext()));
-                text = "[v" + volume +"]" + text;
-                data = VoiceModel.getVoiceData(text);
-            }
-
-            Socket socket = new Socket(ip, 10000);
-            OutputStream outputStream = socket.getOutputStream();
-            Log.d(TAG, "socket connect: " + socket.isConnected());
-
-            if (socket.isConnected() && data != null) {
-                Log.d(TAG, "tcp send voice text: " + voiceText + ", voice data hex string: " + VoiceModel.bytesToHexString(data));
-                outputStream.write(data);
-                socket.close();
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-
-    //文字节目
-    public class SendProgramThread implements Runnable {
-
-        @Override
-        public void run() {
-            //开始组建节目: 如果字体文件不存在则直接返回
-            if (!Constants.ledFontExist) {
-                return;
-            }
-
-            if (ledList.size() == 0) {
-                return;
-            }
-
-            int infoType = SettingConfig.getLedInfoType(application);
-            if (programTextList.size() == 0) {
-                //默认节目
-                for (LedItem ledItem : ledList) {
-                    if (ledItem != null) {
-                        //停止语音
-                        stopVoice = true;
-                        long h = createDefaultProgram(ledItem.getResolution(), ledItem.getFontSize(), infoType, 3);
-                        if (h != 0) {
-                            int result = ledC2M.NetWorkSend(ledItem.getIp(), h);
-                            //语音节目
-                            if (ledItem.getVoiceOn()) {
-                                sendVoiceTcp(ledItem.getIp());
-                            }
-
-                            Log.d(TAG, "send default program to " + ledItem.getIp() + ", result: " + result);
-                            ledC2M.DeleteProgram(h);
-                        }
-                    }
-                }
-            } else {
-                //呼叫信息节目
-                //当前正在播放的语音和将要移除的语音相同
-                if (voiceProgramList.size() > 0) {
-                    voiceText = voiceProgramList.get(0);
-                    if (voiceText.equals(deleteVoiceText)) {
-                        stopVoice = true;
-                    } else {
-                        stopVoice = false;
-                    }
-                    voiceProgramList.remove(voiceText);
-                } else {
-                    stopVoice = true;
-                }
-                Log.d(TAG, "voiceText: " + voiceText + ", deleteVoiceText: " + deleteVoiceText);
-
-                for (LedItem ledItem : ledList) {
-                    if (ledItem != null) {
-                        long h = createCallingProgram(ledItem.getResolution(), ledItem.getFontSize());
-                        if (h != 0) {
-                            int result = ledC2M.NetWorkSend(ledItem.getIp(), h);
-                            //语音节目
-                            if (ledItem.getVoiceOn()) {
-                                sendVoiceTcp(ledItem.getIp());
-                            }
-
-                            Log.d(TAG, "send calling program to " + ledItem.getIp() + ", result: " + result);
-                            ledC2M.DeleteProgram(h);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    private long createDefaultProgram(String ledResolution, int fontSize, int type, int savaType) {
-        long hProgram = 0;
-        String language = "zh";
-        if (type == 0) {
-            //仅显示时间
-            if (LedItem.TYPE_64_16.equals(ledResolution)) {
-                //64x16
-                hProgram = ledC2M.CreateProgram(64, 16, 1,1,savaType);
-                ledC2M.AddProgram(hProgram, 0, 10, 1);
-
-                if (Locale.CHINESE.getLanguage().equals(language)) {
-                    ledC2M.AddDigitalClockArea(hProgram, 0, 1, 0, 0, 64, 16, Constants.C2M_LED_FONT_PATH,
-                            16, 0xff, 0, 0, 0,
-                            0, 0, 0, 0, 1, 1, 0,
-                            0, 0xff, 0, 0xff, 2, 0xff, 1);
-                } else {
-                    ledC2M.AddDigitalClockArea(hProgram, 0, 1, 0, 0, 64, 16, Constants.C2M_LED_FONT_PATH,
-                            16, 0xff, 0, 0, 0,
-                            0, 0, 0, 0, 1, 1, 0,
-                            4, 0xff, 0, 0xff, 2, 0xff, 1);
-                }
-            } else if (LedItem.TYPE_128_16.equals(ledResolution)) {
-                //128x16
-                hProgram = ledC2M.CreateProgram(128, 16, 1,1,savaType);
-                ledC2M.AddProgram(hProgram, 0, 10, 1);
-                ledC2M.AddDigitalClockArea(hProgram, 0, 1, 0, 0, 128, 16, Constants.C2M_LED_FONT_PATH,
-                        16, 0xff, 0, 0, 0,
-                        1, 0, 1, 1, 1, 1, 0,
-                        4, 0xff, 0, 0xff, 2, 0xff, 0);
-            } else {
-                //默认为128x32
-                hProgram = ledC2M.CreateProgram(128, 32, 1,1, savaType);
-                ledC2M.AddProgram(hProgram, 0, 10, 1);
-                if (Locale.CHINESE.getLanguage().equals(language)) {
-                    ledC2M.AddDigitalClockArea(hProgram, 0, 1, 0, 0, 128, 32, Constants.C2M_LED_FONT_PATH,
-                            16, 0xff, 0, 0, 0,
-                            1, 0, 1, 1, 1, 1, 1,
-                            0, 0xff, 0, 0xff, 2, 0xff, 1);
-                } else {
-                    ledC2M.AddDigitalClockArea(hProgram, 0, 1, 0, 0, 128, 32, Constants.C2M_LED_FONT_PATH,
-                            16, 0xff, 0, 0, 0,
-                            1, 0, 1, 1, 1, 1, 1,
-                            4, 0xff, 0, 0xff, 2, 0xff, 1);
-                }
-            }
-        } else if (type == 1) {
-            //显示时间和自定义内容
-            String text = SettingConfig.getLedCustomInfo(application);
-            if (LedItem.TYPE_64_16.equals(ledResolution)) {
-                //64x16
-                hProgram = ledC2M.CreateProgram(64, 16, 1,1,savaType);
-                ledC2M.AddProgram(hProgram, 0, 10, 1);
-                if (Locale.CHINESE.getLanguage().equals(language)) {
-                    ledC2M.AddDigitalClockArea(hProgram, 0, 1, 0, 0, 64, 16, Constants.C2M_LED_FONT_PATH,
-                            16, 0xff, 0, 0, 0,
-                            0, 0, 0, 0, 1, 1, 0,
-                            0, 0xff, 0, 0xff, 2, 0xff, 1);
-                } else {
-                    ledC2M.AddDigitalClockArea(hProgram, 0, 1, 0, 0, 64, 16, Constants.C2M_LED_FONT_PATH,
-                            16, 0xff, 0, 0, 0,
-                            0, 0, 0, 0, 1, 1, 0,
-                            4, 0xff, 0, 0xff, 2, 0xff, 1);
-                }
-
-                if (!TextUtils.isEmpty(text)) {
-                    ledC2M.AddProgram(hProgram, 1, 10, 1);
-                    ledC2M.AddImageTextArea(hProgram, 1, 1, 0, 0, 64, 16, 0);
-                    ledC2M.AddMultiLineTextToImageTextArea(hProgram, 1, 1, 0, text, Constants.C2M_LED_FONT_PATH, 16, 0xff, 0, 0, 0, 4, 5, 3, 1, 1);
-                }
-            } else if (LedItem.TYPE_128_16.equals(ledResolution)){
-                //128x16
-                hProgram = ledC2M.CreateProgram(128, 16, 1,1,savaType);
-                ledC2M.AddProgram(hProgram, 0, 10, 1);
-                ledC2M.AddDigitalClockArea(hProgram, 0, 1, 0, 0, 128, 16, Constants.C2M_LED_FONT_PATH,
-                        16, 0xff, 0, 0, 0,
-                        1, 0, 1, 1, 1, 1, 0,
-                        4, 0xff, 0, 0xff, 2, 0xff, 0);
-                if (!TextUtils.isEmpty(text)) {
-                    ledC2M.AddProgram(hProgram, 1, 10, 1);
-                    ledC2M.AddImageTextArea(hProgram, 1, 1, 0, 0, 128, 16, 0);
-                    ledC2M.AddMultiLineTextToImageTextArea(hProgram, 1, 1, 0, text, Constants.C2M_LED_FONT_PATH, fontSize, 0xff, 0, 0, 0, 4, 5, 3, 1, 1);
-                }
-            } else {
-                //128x32
-                hProgram = ledC2M.CreateProgram(128, 32, 1,1,savaType);
-                ledC2M.AddProgram(hProgram, 0, 10, 1);
-                if (Locale.CHINESE.getLanguage().equals(language)) {
-                    ledC2M.AddDigitalClockArea(hProgram, 0, 1, 0, 0, 128, 32, Constants.C2M_LED_FONT_PATH,
-                            16, 0xff, 0, 0, 0,
-                            1, 0, 1, 1, 1, 1, 1,
-                            0, 0xff, 0, 0xff, 2, 0xff, 1);
-                } else {
-                    ledC2M.AddDigitalClockArea(hProgram, 0, 1, 0, 0, 128, 32, Constants.C2M_LED_FONT_PATH,
-                            16, 0xff, 0, 0, 0,
-                            1, 0, 1, 1, 1, 1, 1,
-                            4, 0xff, 0, 0xff, 2, 0xff, 1);
-                }
-
-                if (!TextUtils.isEmpty(text)) {
-                    ledC2M.AddProgram(hProgram, 1, 10, 1);
-                    ledC2M.AddImageTextArea(hProgram, 1, 1, 0, 0, 128, 32, 0);
-                    ledC2M.AddMultiLineTextToImageTextArea(hProgram, 1, 1, 0, text, Constants.C2M_LED_FONT_PATH, fontSize, 0xff, 0, 0, 0, 4, 5, 3, 1, 1);
-                }
-            }
-        }
-
-        return hProgram;
-    }
-
-    private long createCallingProgram(String ledResolution, int fontSize) {
-        long hProgram = 0;
-        if (LedItem.TYPE_64_16.equals(ledResolution)) {
-            //64x16
-            hProgram = ledC2M.CreateProgram(64, 16, 1, 1, 3);
-            for (int i = 0; i < programTextList.size(); i++) {
-                String text = programTextList.get(i).getText();
-                ledC2M.AddProgram(hProgram, i, SettingConfig.getLedProgramTime(MyApplication.getContext()), 1);
-                ledC2M.AddImageTextArea(hProgram, i, 1, 0, 0, 64, 16, 0);
-                ledC2M.AddMultiLineTextToImageTextArea(hProgram, i, 1, 0, text, Constants.C2M_LED_FONT_PATH, 16, 0xff, 0, 0, 0, 4, 5, 3, 1, 1);
-            }
-        } else if (LedItem.TYPE_128_16.equals(ledResolution)){
-            //128x16
-            hProgram = ledC2M.CreateProgram(128, 16, 1, 1, 3);
-            for (int i = 0; i < programTextList.size(); i++) {
-                ledC2M.AddProgram(hProgram, i, SettingConfig.getLedProgramTime(MyApplication.getContext()), 1);
-                ledC2M.AddImageTextArea(hProgram, i, 1, 0, 0, 128, 16, 0);
-                ledC2M.AddMultiLineTextToImageTextArea(hProgram, i, 1, 0, programTextList.get(i).getText(), Constants.C2M_LED_FONT_PATH, fontSize, 0xff, 0, 0, 0, 4, 5, 3, 1, 1);
-            }
-        } else {
-            //128x32
-            hProgram = ledC2M.CreateProgram(128, 32, 1, 1, 3);
-            for (int i = 0; i < programTextList.size(); i++) {
-                ledC2M.AddProgram(hProgram, i, SettingConfig.getLedProgramTime(MyApplication.getContext()), 1);
-                ledC2M.AddImageTextArea(hProgram, i, 1, 0, 0, 128, 32, 0);
-                ledC2M.AddMultiLineTextToImageTextArea(hProgram, i, 1, 0, programTextList.get(i).getText(), Constants.C2M_LED_FONT_PATH, fontSize, 0xff, 0, 0, 0, 4, 5, 3, 1, 1);
-            }
-        }
-
-        return hProgram;
-    }
-
-
-    //更新节目方法: text -- 节目内容,action -- 方式: 1-发送节目,2-删除节目
-    @Override
-    public synchronized void updateProgram(String text, int action) {
-        synchronized (lockObject) {
-            if (text == null) {
-                return;
-            }
-
-            switch (action) {
-                case 1:
-                    //先查找列表中是否存在该节目,存在则删除
-                    Iterator<LedProgram> iterator = programTextList.iterator();
-                    while (iterator.hasNext()) {
-                        if (text.equals(iterator.next().getText())) {
-                            iterator.remove();
-                        }
-                    }
-
-                    LedProgram ledProgram = new LedProgram(text, System.currentTimeMillis());
-                    programTextList.add(0, ledProgram);
-                    voiceProgramList.add(0, text);
-                    deleteVoiceText = "";
-                    break;
-                case 2:
-                    boolean deleted = false;
-                    Iterator<LedProgram> iterator2 = programTextList.iterator();
-                    while (iterator2.hasNext()) {
-                        if (text.equals(iterator2.next().getText())) {
-                            iterator2.remove();
-                            deleteVoiceText = text;
-                            deleted = true;
-                            break;
-                        }
-                    }
-                    if (!deleted) {
-                        return;
-                    }
-                    break;
-                case 3:
-                    //清屏
-                    programTextList.clear();
-                    break;
-            }
-
-            sendProgramStart();
-        }
-    }
-
-    private void sendProgramStart() {
-        if (programThread == null) {
-            programThread = new SendProgramThread();
-        }
-        updateThreadPool.execute(programThread);
-    }
-
-    private void sendDefaultProgram(final boolean needReboot) {
-        //停止语音
-        stopVoice = true;
-
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (lockObject) {
-                    //如果字体文件不存在则直接返回
-                    if (!Constants.ledFontExist) {
-                        Log.e(TAG, "Nooooooo ledFontExist!");
-                        return;
-                    }
-
-                    if (ledList.size() == 0) {
-                        return;
-                    }
-
-                    int infoType = SettingConfig.getLedInfoType(application);
-                    for (LedItem ledItem : ledList) {
-                        if (ledItem != null) {
-                            long h = createDefaultProgram(ledItem.getResolution(), ledItem.getFontSize(), infoType, 0);
-                            if (h != 0) {
-                                int result = ledC2M.NetWorkSend(ledItem.getIp(), h);
-                                //语音节目
-                                //if (Constants.Companion.getLedVoiceOn() == 1) {
-                                //    sendVoiceTcp(ledItem.getIp());
-                                //}
-
-                                Log.d(TAG, "send default program to " + ledItem.getIp() + ", result: " + result);
-                                ledC2M.DeleteProgram(h);
-                            }
-
-                            if (needReboot) {
-                                ledC2M.PowerOnOff(ledItem.getIp(), 2);
-                            }
-                        }
-                    }
-                }
-            }
-        }).start();
-    }
-
-    @Override
-    public void updateDefaultProgram() {
-        //无呼叫节目时更新默认节目
-        if (programTextList.size() == 0) {
-            sendDefaultProgram(true);
-        }
-    }
-
-    @Override
-    public void removeAllProgram(boolean reboot) {
-        programTextList.clear();
-        sendDefaultProgram(reboot);
-    }
-
-    @Override
-    public void syncTime() {
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (lockObject) {
-                    for (int i = 0; i < ledList.size(); i++) {
-                        ledC2M.AdjustTime(ledList.get(i).getIp());
-                    }
-                }
-            }
-        }).start();
-    }
-
-    @Override
-    public void powerOnOff(final boolean powerOn) {
-        new Thread(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (lockObject) {
-                    if (powerOn) {
-                        for (int i = 0; i < ledList.size(); i++) {
-                            ledC2M.PowerOnOff(ledList.get(i).getIp(), 0);
-                        }
-                    } else {
-                        for (int i = 0; i < ledList.size(); i++) {
-                            ledC2M.PowerOnOff(ledList.get(i).getIp(), 1);
-                        }
-                    }
-                }
-            }
-        }).start();
-    }
-
-    @Override
-    public void release() {
-        programTextList.clear();
-    }
-}

+ 0 - 59
app/src/main/java/com/wdkl/ncs/s433/receiver/led/LedItem.java

@@ -1,59 +0,0 @@
-package com.wdkl.ncs.s433.receiver.led;
-
-public class LedItem {
-    /*
-    * Led点阵屏相关参数:
-    * type:点阵屏类型,128x32代表128x32点阵,64x16代表64x16点阵,默认为128x32
-     */
-
-    public static final String TYPE_128_32 = "128x32";
-    public static final String TYPE_128_16 = "128x16";
-    public static final String TYPE_64_16 = "64x16";
-
-    private String resolution;
-    private String ip;
-    private boolean voiceOn;
-    private int fontSize;
-
-    public LedItem() {
-    }
-
-    public LedItem(String resolution, String ip, boolean voiceOn, int fontSize) {
-        this.resolution = resolution;
-        this.ip = ip;
-        this.voiceOn = voiceOn;
-        this.fontSize = fontSize;
-    }
-
-    public String getResolution() {
-        return resolution;
-    }
-
-    public void setResolution(String resolution) {
-        this.resolution = resolution;
-    }
-
-    public String getIp() {
-        return ip;
-    }
-
-    public void setIp(String ip) {
-        this.ip = ip;
-    }
-
-    public boolean getVoiceOn() {
-        return voiceOn;
-    }
-
-    public void setVoiceOn(boolean voiceOn) {
-        this.voiceOn = voiceOn;
-    }
-
-    public int getFontSize() {
-        return fontSize;
-    }
-
-    public void setFontSize(int fontSize) {
-        this.fontSize = fontSize;
-    }
-}

+ 0 - 51
app/src/main/java/com/wdkl/ncs/s433/receiver/led/LedManager.java

@@ -1,51 +0,0 @@
-package com.wdkl.ncs.s433.receiver.led;
-
-import android.app.Application;
-
-import com.wdkl.ncs.s433.receiver.common.Constants;
-
-import java.io.File;
-import java.util.ArrayList;
-
-public abstract class LedManager {
-
-    //初始化
-    public abstract void init(Application application);
-
-    //获取所有LED屏ip地址
-    public abstract void initIpList();
-
-    public abstract void setLedIpList(ArrayList<LedItem> list);
-
-    //获取点阵屏列表
-    public abstract ArrayList<LedItem> getLedList();
-
-    //更新节目: text -- 节目内容,action -- 方式: 1-发送节目,2-删除节目,3-发送默认节目
-    public abstract void updateProgram(String text, int action);
-
-    //更新默认节目
-    public abstract void updateDefaultProgram();
-
-    public abstract void removeAllProgram(boolean reboot);
-
-    public abstract void syncTime();
-
-    public abstract void powerOnOff(boolean powerOn);
-
-    public abstract void release();
-
-    public long checkLedFont() {
-        File file = new File(Constants.C2M_LED_FONT_PATH);
-        if (file.exists()) {
-            Constants.ledFontExist = true;
-            return file.length();
-        } else {
-            Constants.ledFontExist = false;
-            return -1;
-        }
-    }
-
-    public void copyFont() {
-        //
-    }
-}

+ 0 - 88
app/src/main/java/com/wdkl/ncs/s433/receiver/led/LedManagerUtils.java

@@ -1,88 +0,0 @@
-package com.wdkl.ncs.s433.receiver.led;
-
-import android.app.Application;
-
-import java.util.ArrayList;
-
-public class LedManagerUtils {
-    private static LedManagerUtils instance = null;
-    private LedManager ledManager;
-
-    public static LedManagerUtils getInstance(){
-        if (instance == null){
-            synchronized (LedManagerUtils.class){
-                if (instance == null){
-                    instance = new LedManagerUtils();
-                }
-            }
-        }
-        return instance;
-    }
-
-    public void ledInit(Application application) {
-        //灵信C2M
-        ledManager = new LedC2MManager();
-        ledManager.init(application);
-    }
-
-    public void initIp() {
-        if (ledManager != null) {
-            ledManager.initIpList();
-        }
-    }
-
-    public void setLedList(ArrayList<LedItem> list) {
-        if (ledManager != null) {
-            ledManager.setLedIpList(list);
-        }
-    }
-
-    public void updateProgram(String text, int action) {
-        if (ledManager != null) {
-            ledManager.updateProgram(text, action);
-        }
-    }
-
-    public void updateDefaultProgram() {
-        if (ledManager != null) {
-            ledManager.updateDefaultProgram();
-        }
-    }
-
-    public ArrayList<LedItem> getLedList() {
-        if (ledManager != null) {
-            return ledManager.getLedList();
-        }
-        return new ArrayList<>();
-    }
-
-    public void removeAllProgram(boolean reboot) {
-        if (ledManager != null) {
-            ledManager.removeAllProgram(reboot);
-        }
-    }
-
-    public void syncTime() {
-        if (ledManager != null) {
-            ledManager.syncTime();
-        }
-    }
-
-    public void powerOnOff(boolean powerOn) {
-        if (ledManager != null) {
-            ledManager.powerOnOff(powerOn);
-        }
-    }
-
-    public void copyFont() {
-        if (ledManager != null) {
-            ledManager.copyFont();
-        }
-    }
-
-    public void release() {
-        if (ledManager != null) {
-            ledManager.release();
-        }
-    }
-}

+ 0 - 28
app/src/main/java/com/wdkl/ncs/s433/receiver/led/LedProgram.java

@@ -1,28 +0,0 @@
-package com.wdkl.ncs.s433.receiver.led;
-
-public class LedProgram {
-
-    private String text;
-    private long time;
-
-    public LedProgram(String text, long time) {
-        this.text = text;
-        this.time = time;
-    }
-
-    public String getText() {
-        return text;
-    }
-
-    public void setText(String text) {
-        this.text = text;
-    }
-
-    public long getTime() {
-        return time;
-    }
-
-    public void setTime(long time) {
-        this.time = time;
-    }
-}

+ 0 - 11
app/src/main/java/com/wdkl/ncs/s433/receiver/settingconfig/SettingConfig.java

@@ -3,8 +3,6 @@ package com.wdkl.ncs.s433.receiver.settingconfig;
 import android.content.Context;
 import android.content.SharedPreferences;
 
-import com.wdkl.ncs.s433.receiver.led.LedItem;
-
 public class SettingConfig {
 
     private static final String SP_NAME = "SP_FUNCTION";
@@ -112,15 +110,6 @@ public class SettingConfig {
         getEditor(context).putString(KEY_SP_LED_CUSTOM_INFO, value).apply();
     }
 
-    //点阵屏规格
-    public static String getLedResolution(Context context) {
-        return getSP(context).getString(KEY_SP_LED_RESOLUTION, LedItem.TYPE_128_16);
-    }
-
-    public static void setLedResolution(Context context, String value) {
-        getEditor(context).putString(KEY_SP_LED_RESOLUTION, value).apply();
-    }
-
     //点阵屏字体大小
     public static int getLedFontSize(Context context) {
         return getSP(context).getInt(KEY_SP_LED_FONT_SIZE, 16);

+ 1 - 1
app/src/main/res/values/strings.xml

@@ -1,5 +1,5 @@
 <resources>
-    <string name="app_name">433无线接收器</string>
+    <string name="app_name">433无线中继</string>
     <string name="error_configuration">请配置串口号</string>
     <string name="error_security">无法读取串口</string>
     <string name="error_unknown">串口无法打开</string>

+ 1 - 1
app/src/main/res/xml/root_preferences.xml

@@ -4,7 +4,7 @@
 
 
         <ListPreference
-            app:defaultValue="/dev/ttyS7"
+            app:defaultValue="/dev/ttyS2"
             app:key="serialDeivce"
             app:title="@string/serial_deivce"
             app:useSimpleSummaryProvider="true" />

+ 2 - 2
build.gradle

@@ -31,6 +31,6 @@ ext {
     minSdkVersion = 24
     targetSdkVersion = 28
 
-    versionCode = 2
-    versionName = "1.0.2"
+    versionCode = 1
+    versionName = "1.0.1"
 }

+ 1 - 2
settings.gradle

@@ -1,4 +1,3 @@
-rootProject.name = "433_receiver"
+rootProject.name = "433_repeater"
 include ':app'
 include ':serialport'
-include ':listenvision'