[680][device]硬件绑定服务修改成仅客户端进行绑定
This commit is contained in:
@@ -49,8 +49,10 @@ object DevicesManager {
|
||||
}
|
||||
|
||||
fun destroy() {
|
||||
serialPortManager.close(DefaultDevices.VERIFICATION.path)
|
||||
serialPortManager.close(DefaultDevices.SPEECH_CX830SE.path)
|
||||
if (serviceBindState == SERVICE_STATE.BIND_SUCCEED) {
|
||||
serialPortManager.close(DefaultDevices.VERIFICATION.path)
|
||||
serialPortManager.close(DefaultDevices.SPEECH_CX830SE.path)
|
||||
}
|
||||
serialPortManager.unbindService()
|
||||
}
|
||||
|
||||
@@ -396,16 +398,18 @@ object DevicesManager {
|
||||
*/
|
||||
@Define.Code
|
||||
fun speechCx830seBroadcast(content: String?): Int {
|
||||
val code = serialPortManager.speechCx830seBroadcastSpeech(
|
||||
DefaultDevices.SPEECH_CX830SE,
|
||||
content
|
||||
)
|
||||
writeChainLogListener?.onWriteChainLog(
|
||||
"车外语音设备",
|
||||
"播报内容=${content ?: " 调用结果=${code}"}"
|
||||
)
|
||||
return code
|
||||
|
||||
if (serviceBindState == SERVICE_STATE.BIND_SUCCEED) {
|
||||
val code = serialPortManager.speechCx830seBroadcastSpeech(
|
||||
DefaultDevices.SPEECH_CX830SE,
|
||||
content
|
||||
)
|
||||
writeChainLogListener?.onWriteChainLog(
|
||||
"车外语音设备",
|
||||
"播报内容=${content ?: " 调用结果=${code}"}"
|
||||
)
|
||||
return code
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -413,12 +417,15 @@ object DevicesManager {
|
||||
* @param device [DefaultDevices.SPEECH_CX830SE] [DefaultDevices.VERIFICATION] [DefaultDevices.VERIFICATION_SK87R] [DefaultDevices.VERIFICATION_Q350]
|
||||
*/
|
||||
fun isDeviceOpen(device: Device): Boolean {
|
||||
if (DefaultDevices.VERIFICATION.equals(device)) {
|
||||
return serialPortManager.isOpen(DefaultDevices.VERIFICATION_SK87R.path) || serialPortManager.isOpen(
|
||||
DefaultDevices.VERIFICATION_Q350.path
|
||||
)
|
||||
if (serviceBindState == SERVICE_STATE.BIND_SUCCEED) {
|
||||
if (DefaultDevices.VERIFICATION.equals(device)) {
|
||||
return serialPortManager.isOpen(DefaultDevices.VERIFICATION_SK87R.path) || serialPortManager.isOpen(
|
||||
DefaultDevices.VERIFICATION_Q350.path
|
||||
)
|
||||
}
|
||||
return serialPortManager.isOpen(device.path)
|
||||
}
|
||||
return serialPortManager.isOpen(device.path)
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user