19. 设备配置信息
设备配置信息,是为了动态适配设备功能。
19.1. 获取缓存的配置信息
//Step0. WatchManager是WatchOpImpl的子类,须在1.3配置好sdk
WatchManager watchManager = WatchManager.getInstance();
//Step1. 获取缓存配置信息
WatchConfigure configure = watchManager.getWatchConfigure(watchManager.getConnectedDevice());
WatchConfigure.NecessaryFunc necessaryFunc = configure.getNecessaryFunc(); //必要功能配置
WatchConfigure.SystemSetup systemSetup = configure.getSystemSetup(); //系统配置
WatchConfigure.FunctionOption functionOption = configure.getFunctionOption(); //功能配置
SportHealthConfigure sportHealthConfigure = configure.getSportHealthConfigure(); //运动健康配置
19.2. 请求设备配置信息
//Step0. WatchManager是WatchOpImpl的子类,须在1.3配置好sdk
WatchManager watchManager = WatchManager.getInstance();
//Step1. 调用请求设备信息接口,并等待结果返回
watchManager.requestDeviceConfigure(new OnWatchOpCallback<WatchConfigure>() {
@Override
public void onSuccess(WatchConfigure result) {
//回调成功
WatchConfigure.NecessaryFunc necessaryFunc = result.getNecessaryFunc(); //必要功能配置
WatchConfigure.SystemSetup systemSetup = result.getSystemSetup(); //系统配置
WatchConfigure.FunctionOption functionOption = result.getFunctionOption(); //功能配置
SportHealthConfigure sportHealthConfigure = result.getSportHealthConfigure(); //运动健康配置
}
@Override
public void onFailed(BaseError error) {
//回调失败信息
}
});
19.2.1. NecessaryFunc
必要功能配置
public static class NecessaryFunc {
/**
* 是否支持OTA功能
*/
private boolean isSupportOTA;
/**
* 是否支持资源更新功能
*/
private boolean isSupportResourceUpdate;
/**
* 是否支持表盘操作
*/
private boolean isSupportDialOp;
/**
* 是否支持表盘切换
*/
private boolean isSupportDialSwitch;
/**
* 是否支持表盘预览
*/
private boolean isSupportDialBrowse;
}
19.2.2. SystemSetup
系统配置
public static class SystemSetup {
/**
* 是否支持屏幕设置
*/
private boolean isSupportScreenSetting;
/**
* 是否支持震动强度设置
*/
private boolean isSupportVibrationSetting;
/**
* 是否支持勿扰模式
*/
private boolean isSupportDNDMode;
/**
* 是否支持锻炼设置
*/
private boolean isSupportExerciseSetting;
/**
* 是否支持蓝牙断开提醒
*/
private boolean isSupportBtDisconnectSetting;
}
19.2.3. FunctionOption
功能配置
public static class FunctionOption {
/**
* 是否支持常用联系人
*/
private boolean isSupportContacts;
/**
* 是否文件浏览
*/
private boolean isSupportFileBrowse;
/**
* 是否支持音乐文件传输
*/
private boolean isSupportMusicTransfer;
/**
* 是否支持闹钟设置
*/
private boolean isSupportAlarmSetting;
/**
* 是否支持信息同步
*/
private boolean isSupportMessageSync;
/**
* 是否支持天气同步
*/
private boolean isSupportWeatherSync;
/**
* 是否支持查找设备/手机
*/
private boolean isSupportSearchDevice;
/**
* 是否支持AI云功能
*/
private boolean isSupportAICloud;
/**
* 是否支持AI表盘
*/
private boolean isSupportAIDial;
/**
* 是否支持4G网络模块
*/
private boolean isSupportNetworkModule;
/**
* 是否支持设备表盘拓展信息
*/
private boolean isSupportDialExpandInfo;
}
19.2.4. SportHealthConfigure
运动健康配置
public class SportHealthConfigure {
public static final int CONFIGURE_TYPE_GSENSOR = 0;
public static final int CONFIGURE_TYPE_RATE = 1;
public static final int CONFIGURE_TYPE_BLOOD_OXYGEN = 2;
public static final int CONFIGURE_TYPE_ALTITUDE = 3;
public static final int CONFIGURE_TYPE_GPS = 4;
public static final int CONFIGURE_TYPE_SPORT_MODE = 0xfe;
public static final int CONFIGURE_TYPE_COMBINE_FUNC = 0xff;
private GSensorFunc gSensorFunc; //计步功能
private RateFunc rateFunc; //心率功能
private BloodOxygenFunc bloodOxygenFunc; //血氧功能
private AltitudeFunc altitudeFunc; //海拔功能
private GPSFunc gpsFunc; //GPS功能
private SportModeFunc sportModeFunc; //运动模式
private CombineFunc combineFunc; //综合功能
}