fix bug of func config
This commit is contained in:
@@ -35,9 +35,9 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
}
|
||||
|
||||
override fun initBiz() {
|
||||
bizConfigCenter.init(mContext!!)
|
||||
// FuncConfigImpl.init()
|
||||
traceManager.init(mContext!!)
|
||||
bizConfigCenter.init(mContext!!)
|
||||
FuncConfigImpl.init()
|
||||
MogoLogCatchManager.init(mContext!!)
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,11 @@ class FuncConfigCenter : IMogoOnMessageListener<FuncConfig>, IMoGoAutopilotCarCo
|
||||
MogoAiCloudSocketManager.getInstance(AbsMogoApplication.getApp().applicationContext)
|
||||
.registerOnMessageListener(FUNC_CONFIG_TYPE, this)
|
||||
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
|
||||
|
||||
//未连接到工控,默认配置
|
||||
val bizJson = SPUtils.getInstance("biz_config")
|
||||
.getString("config", GsonUtils.toJson(defaultFuncConfig()))
|
||||
refreshConfig(GsonUtils.fromJson(bizJson, FuncConfig::class.java))
|
||||
}
|
||||
|
||||
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
|
||||
@@ -49,12 +54,7 @@ class FuncConfigCenter : IMogoOnMessageListener<FuncConfig>, IMoGoAutopilotCarCo
|
||||
UiThreadHandler.post {
|
||||
funcConfigNetWorkModel.requestFuncConfig(carConfigResp.macAddress, {
|
||||
SPUtils.getInstance("biz_config").put("config", GsonUtils.toJson(it))
|
||||
refreshConfig(it)
|
||||
}, {
|
||||
val bizJson = SPUtils.getInstance("biz_config")
|
||||
.getString("config", GsonUtils.toJson(defaultFuncConfig()))
|
||||
refreshConfig(GsonUtils.fromJson(bizJson, FuncConfig::class.java))
|
||||
})
|
||||
refreshConfig(it) }, {})
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showLong("未获取到域控mac信息")
|
||||
|
||||
@@ -15,7 +15,7 @@ object FuncConfigImpl {
|
||||
|
||||
fun init() {
|
||||
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(FOUNDATION,
|
||||
TAG,
|
||||
TAG,false,
|
||||
object : IMoGoDevaToolsFuncConfigListener {
|
||||
override fun updateBizData(
|
||||
type: String,
|
||||
|
||||
@@ -34,9 +34,13 @@ class FuncConfigNetWorkModel {
|
||||
if (error == null) {
|
||||
error = onError
|
||||
}
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["mac"] = DeviceUtils.getMacAddress()
|
||||
map["channelVersion"] = FuncConfigConst.getChannelCode()
|
||||
//todo test
|
||||
// map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["sn"] = "X20202203105S688HZ"
|
||||
// map["mac"] = DeviceUtils.getMacAddress()
|
||||
map["mac"] = "48:b0:2d:3a:bc:78"
|
||||
// map["channelVersion"] = FuncConfigConst.getChannelCode()
|
||||
map["channelVersion"] = 1
|
||||
}
|
||||
loader {
|
||||
apiCall {
|
||||
|
||||
Reference in New Issue
Block a user