{
//发送获取绑定用户ID
do_ln_http_server_send_data(LN_HTTP_SERVICE_CMD_GET_USER_ID, NULL, 0);
- // // 获取到设备是未绑定状态,但是内部有绑定记录 需要恢复出厂
- // if(bind_status == true && uapi_ln_is_device_bound() == 0)
- // {
- // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "恢复出厂");
- // restore_factory_settings();
- // return;
- // }
// 网络连接成功,调用HTTP服务获取设备Token
// 获取一下OTA 是否有最新版本
int ota = ota_update_boot();
{
if(is_bind == 1)
{
- // 判断是否已经绑定了
- char temp[10] = { 0 };
- (void)UtilsGetValue("bind_status", temp, 10);
- if(strcmp(temp, "1") == 0)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleBindAndUnbind: 已绑定,无需再去绑定");
- return;
- }
- else
+ if(bind_status == false)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleBindAndUnbind: 未绑定,开始绑定");
//存储kv
(void)UtilsSetValue("bind_status", "1");
//绑定成功
- int currentView = ThunderBirdMainView::GetInstance()->GetCurrentView(); //获取当前视图
if(ThunderBirdMainView::GetInstance()){
+ int currentView = ThunderBirdMainView::GetInstance()->GetCurrentView(); //获取当前视图
ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_SPEAKING);
}
+ bind_status = true;
+ return;
}
}
else
{
- // 先判断本地是否有用户数据
- char temp[10] = { 0 };
- (void)UtilsGetValue("bind_status", temp, 10);
- if(strcmp(temp, "1") == 0)
- {
- //解绑
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleBindAndUnbind: 已解绑");
- do_restore_factory_setting();
- }
- else
+ if(bind_status == true)
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleBindAndUnbind: 本地没有用户数据无需解绑");
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "恢复出厂");
+ restore_factory_settings();
+ return;
}
}
}