|
@@ -123,7 +123,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/ttyS2"); //sp.getString("DEVICE", "");
|
|
|
+ String path = sp.getString("serialDeivce", "dev/ttyS7"); //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"));
|
|
@@ -168,7 +168,7 @@ public class MainActivity extends SerialPortActivity {
|
|
|
if (!defaultIP.equals(localIP)) {
|
|
|
Log.e(TAG, "set default ip: " + defaultIP);
|
|
|
try {
|
|
|
- smdtManager.smdtSetEthIPAddress(defaultIP, "255.255.0.0", "172.28.100.1", "8.8.8.8");
|
|
|
+ smdtManager.smdtSetEthIPAddress(defaultIP, "255.255.0.0", "192.168.1.1", "8.8.8.8");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -179,20 +179,22 @@ public class MainActivity extends SerialPortActivity {
|
|
|
setLedParams(SettingConfig.getLedIp(this), SettingConfig.getLedResolution(this), SettingConfig.getLedFontSize(this));
|
|
|
|
|
|
|
|
|
- /*final String welcomeInfo = "欢迎使用";
|
|
|
+ final String welcomeInfo = "欢迎使用";
|
|
|
LedManagerUtils.getInstance().updateProgram(welcomeInfo, 1);
|
|
|
new Thread(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
try {
|
|
|
- Thread.sleep(15000);
|
|
|
+ Thread.sleep(5000);
|
|
|
+ SpeechUtil.getInstance().speakSingleText(welcomeInfo);
|
|
|
|
|
|
+ Thread.sleep(5000);
|
|
|
LedManagerUtils.getInstance().updateProgram(welcomeInfo, 2);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
- }).start();*/
|
|
|
+ }).start();
|
|
|
}
|
|
|
|
|
|
private void setLedParams(String ledIp, String resolution, int fontSize) {
|
|
@@ -260,7 +262,7 @@ public class MainActivity extends SerialPortActivity {
|
|
|
//$8C:FC:A0:F1:01:A7{"action":"SOS_CALL","type":"S433","data":{"title":"12房紧急呼叫"}}#
|
|
|
Log.e("Application", "receiveData: " + data);
|
|
|
|
|
|
- if (BuildConfig.DEBUG) {
|
|
|
+ /*if (BuildConfig.DEBUG) {
|
|
|
runOnUiThread(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
@@ -270,7 +272,7 @@ public class MainActivity extends SerialPortActivity {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
try {
|
|
|
//去掉'$'起始符和‘#’结束符
|
|
@@ -326,11 +328,11 @@ public class MainActivity extends SerialPortActivity {
|
|
|
//如果是发送给本机,则返回ack,并处理点阵屏数据
|
|
|
if (macAddress.equalsIgnoreCase(mac)) {
|
|
|
if (tcpModel != null) {
|
|
|
+ Log.e(TAG, "send 433 data ==>" + callbackString);
|
|
|
+ sendMsg(callbackString, mOutputStream, 120);
|
|
|
+
|
|
|
parseTcpData(tcpModel);
|
|
|
}
|
|
|
-
|
|
|
- Log.e(TAG, "send 433 data ==>" + callbackString);
|
|
|
- sendMsg(callbackString, mOutputStream, 120);
|
|
|
}
|
|
|
|
|
|
}
|