remove test code
This commit is contained in:
@@ -47,7 +47,7 @@ class FuncConfigCenter : IMogoOnMessageListener<FuncConfig>, IMoGoAutopilotCarCo
|
||||
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
|
||||
if (!carConfigResp.macAddress.isNullOrEmpty()) {
|
||||
UiThreadHandler.post {
|
||||
funcConfigNetWorkModel.requestFuncConfig({
|
||||
funcConfigNetWorkModel.requestFuncConfig(carConfigResp.macAddress, {
|
||||
SPUtils.getInstance("biz_config").put("config", GsonUtils.toJson(it))
|
||||
refreshConfig(it)
|
||||
}, {
|
||||
|
||||
@@ -21,6 +21,7 @@ class FuncConfigNetWorkModel {
|
||||
private var error: ((String) -> Unit)? = null
|
||||
|
||||
fun requestFuncConfig(
|
||||
mac:String,
|
||||
onSuccess: ((FuncConfig) -> Unit)? = null,
|
||||
onError: ((String) -> Unit)? = null
|
||||
) {
|
||||
@@ -34,11 +35,8 @@ class FuncConfigNetWorkModel {
|
||||
error = onError
|
||||
}
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
// map["sn"] = "X20202203105S688HZ"
|
||||
map["mac"] = DeviceUtils.getMacAddress()
|
||||
// map["mac"] = "48:b0:2d:3a:bc:78"
|
||||
map["mac"] = mac
|
||||
map["channelVersion"] = FuncConfigConst.getChannelCode()
|
||||
// map["channelVersion"] = 1
|
||||
}
|
||||
loader {
|
||||
apiCall {
|
||||
@@ -51,7 +49,7 @@ class FuncConfigNetWorkModel {
|
||||
} else {
|
||||
if (retryTime < 3) {
|
||||
retryTime += 1
|
||||
requestFuncConfig()
|
||||
requestFuncConfig(mac)
|
||||
} else {
|
||||
error?.invoke("FuncConfig error msg is null")
|
||||
}
|
||||
@@ -60,7 +58,7 @@ class FuncConfigNetWorkModel {
|
||||
onError {
|
||||
if (retryTime < 3) {
|
||||
retryTime += 1
|
||||
requestFuncConfig()
|
||||
requestFuncConfig(mac)
|
||||
} else if (it.message != null) {
|
||||
error?.invoke(it.message ?: "FuncConfig error msg is null")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user