|
@@ -249,6 +249,29 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ override fun setTcpServerHost(tcpSeverDTO: TcpSeverDTO) {
|
|
|
|
+ Constant.TCP_SERVER_URL = tcpSeverDTO.localIp
|
|
|
|
+ Constant.TCP_PORT = tcpSeverDTO.tcpPort
|
|
|
|
+ Constant.TCP_HEART_BEAT = tcpSeverDTO.readerIdleTime
|
|
|
|
+
|
|
|
|
+ //开启TCP连接
|
|
|
|
+ startTcp()
|
|
|
|
+ showMessage("tcp开始连接...host: " + Constant.TCP_SERVER_URL + ", port: " + Constant.TCP_PORT)
|
|
|
|
+
|
|
|
|
+ Thread(Runnable {
|
|
|
|
+ while (!initialized) {
|
|
|
|
+ runOnUiThread(Runnable {
|
|
|
|
+ initDevice()
|
|
|
|
+ })
|
|
|
|
+ try {
|
|
|
|
+ Thread.sleep(8000)
|
|
|
|
+ } catch (e: Exception) {
|
|
|
|
+ //
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }).start()
|
|
|
|
+ }
|
|
|
|
+
|
|
//显示设备信息
|
|
//显示设备信息
|
|
override fun showDeviceInfo(deviceInfo: BedDeviceInfoVO) {
|
|
override fun showDeviceInfo(deviceInfo: BedDeviceInfoVO) {
|
|
Constant.SIP_ID = deviceInfo.sipId
|
|
Constant.SIP_ID = deviceInfo.sipId
|
|
@@ -316,29 +339,6 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
updateSettings(true)
|
|
updateSettings(true)
|
|
}
|
|
}
|
|
|
|
|
|
- override fun setTcpServerHost(tcpSeverDTO: TcpSeverDTO) {
|
|
|
|
- Constant.TCP_SERVER_URL = tcpSeverDTO.localIp
|
|
|
|
- Constant.TCP_PORT = tcpSeverDTO.tcpPort
|
|
|
|
- Constant.TCP_HEART_BEAT = tcpSeverDTO.readerIdleTime
|
|
|
|
-
|
|
|
|
- //开启TCP连接
|
|
|
|
- startTcp()
|
|
|
|
- showMessage("tcp开始连接...host: " + Constant.TCP_SERVER_URL + ", port: " + Constant.TCP_PORT)
|
|
|
|
-
|
|
|
|
- Thread(Runnable {
|
|
|
|
- while (!initialized) {
|
|
|
|
- runOnUiThread(Runnable {
|
|
|
|
- initDevice()
|
|
|
|
- })
|
|
|
|
- try {
|
|
|
|
- Thread.sleep(8000)
|
|
|
|
- } catch (e: Exception) {
|
|
|
|
- //
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }).start()
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
override fun updateNurseConfig(list: List<NurseConfigDto>) {
|
|
override fun updateNurseConfig(list: List<NurseConfigDto>) {
|
|
if (list.isNotEmpty()) {
|
|
if (list.isNotEmpty()) {
|
|
for ((index, e) in list.withIndex()) {
|
|
for ((index, e) in list.withIndex()) {
|
|
@@ -1068,9 +1068,8 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
if (intent.action == Intent.ACTION_TIME_TICK
|
|
if (intent.action == Intent.ACTION_TIME_TICK
|
|
|| intent.action == Intent.ACTION_TIME_CHANGED
|
|
|| intent.action == Intent.ACTION_TIME_CHANGED
|
|
|| intent.action == Intent.ACTION_TIMEZONE_CHANGED) {
|
|
|| intent.action == Intent.ACTION_TIMEZONE_CHANGED) {
|
|
- //设备完成初始化才刷新
|
|
|
|
|
|
+ updateNetState()
|
|
if (initialized) {
|
|
if (initialized) {
|
|
- updateNetState()
|
|
|
|
updateSettings(false)
|
|
updateSettings(false)
|
|
updateTcpState()
|
|
updateTcpState()
|
|
|
|
|
|
@@ -1083,10 +1082,13 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
if (Constant.LATER_RESTART && Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
if (Constant.LATER_RESTART && Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
AppUpdateHelper.restartApp(activity)
|
|
AppUpdateHelper.restartApp(activity)
|
|
}
|
|
}
|
|
|
|
+ } else if (TextUtils.isEmpty(Constant.TCP_SERVER_URL)) {
|
|
|
|
+ //还未连接tcp服务器
|
|
|
|
+ presenter.loadTcpServerHost()
|
|
}
|
|
}
|
|
} else if (intent.action == ConnectivityManager.CONNECTIVITY_ACTION) {
|
|
} else if (intent.action == ConnectivityManager.CONNECTIVITY_ACTION) {
|
|
|
|
+ updateNetState()
|
|
if (initialized) {
|
|
if (initialized) {
|
|
- updateNetState()
|
|
|
|
if (NetHelper.getInstance().networkAvailable()) {
|
|
if (NetHelper.getInstance().networkAvailable()) {
|
|
if (!Constant.TCP_CONNECTED) {
|
|
if (!Constant.TCP_CONNECTED) {
|
|
TcpClient.getInstance().doConnect()
|
|
TcpClient.getInstance().doConnect()
|