[6.4.0] add func of auth cert show

This commit is contained in:
EmArrow
2024-04-08 16:30:05 +08:00
parent afd44e9da7
commit 4e35d90a57
16 changed files with 217 additions and 71 deletions

View File

@@ -11,11 +11,16 @@ object CallerAutopilotCarConfigListenerManager : CallerBase<IMoGoAutopilotCarCon
private var mCarConfigResp: MessagePad.CarConfigResp? = null
@Volatile
private var certFileMsg = "未开启认证"
override fun doSomeAfterAddListener(tag: String, listener: IMoGoAutopilotCarConfigListener) {
mCarConfigResp?.let {
listener.onAutopilotCarConfig(it)
}
listener.onCertificationResult(certFileMsg)
}
/**
* 工控机基础信息回调
* @param carConfigResp
@@ -33,5 +38,17 @@ object CallerAutopilotCarConfigListenerManager : CallerBase<IMoGoAutopilotCarCon
}
}
@Synchronized
fun invokeAutopilotCertFileResult(msg: String) {
certFileMsg = msg
M_LISTENERS.forEach {
val listener = it.value
listener.onCertificationResult(msg)
}
}
fun getCertFileResult(): String {
return certFileMsg
}
}

View File

@@ -41,4 +41,8 @@ object CallerCloudCertManager {
}
return crt
}
fun getCrtFileErrorMsg(): String? {
return certProviderApi.getCrtFileErrorMsg()
}
}

View File

@@ -17,6 +17,12 @@ object CallerCloudListenerManager : CallerBase<IMoGoCloudListener>() {
if (!token.isNullOrEmpty() && !sn.isNullOrEmpty()) {
listener.tokenGot(token!!, sn!!)
}
if(CallerCloudCertManager.getDeviceCrtF()!= null && CallerCloudCertManager.getRootCrtF()!= null){
listener.authCrtFile(CallerCloudCertManager.getDeviceCrtF()!!, CallerCloudCertManager.getRootCrtF()!!)
}
if(CallerCloudCertManager.getCrtFileErrorMsg()!= null){
listener.authCrtError(CallerCloudCertManager.getCrtFileErrorMsg()!!)
}
}
fun invokeCloudCrtFile(deviceCrtFile: String, rootCrtFile: String) {
@@ -26,6 +32,13 @@ object CallerCloudListenerManager : CallerBase<IMoGoCloudListener>() {
}
}
fun invokeCloudCrtError(errorMsg: String){
M_LISTENERS.forEach {
val listener = it.value
listener.authCrtError(errorMsg)
}
}
/**
* 分发获取到的设备sn
*/