package safeluck.drive.evaluation.viewmodels
|
|
import android.util.Log
|
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.ViewModel
|
import safeluck.drive.evaluation.bean.ExamPlatformData
|
|
/**DriveJudge
|
*
|
*
|
* 蓝牙连接上 时,且权限通过和sn不为空,再设置auth值
|
* Created by lzw on 2020/11/25. 14:53:48
|
* 邮箱:632393724@qq.com
|
* All Rights Saved! Chongqing AnYun Tech co. LTD
|
*/
|
class AuthMapViewmodel :ViewModel(){
|
private val TAG= "AuthMapViewmodel"
|
private var auth:MutableLiveData<Int> = MutableLiveData<Int>()
|
private var flag:Boolean = false;
|
fun getAuthValue():LiveData<Int>{
|
return auth
|
}
|
|
fun setAuthValue(vale:Int){
|
Log.i(TAG,"设置值"+vale)
|
if (ExamPlatformData.getInstance().mcuSN !=null
|
&& ExamPlatformData.getInstance().isCanWriteSD){
|
if (!flag){
|
flag = true
|
auth.postValue(vale)
|
}
|
}
|
}
|
}
|