EPO文件更新
11.1功能概述
EPO是辅助全球卫星定位系统,指的是一种GPS的运行方式。它可以利用手机基地站的资讯,配合传统GPS卫星,让定位的速度更快。需要注意的是EPO文件更新:手环连接App15秒后,查询GPS状态未运行更新EPO文件,否则会导致更新失败。
11.2对应功能表
//EPO funcTable
__IDO_FUNCTABLE__.funcTable34Model.supportAirohaGpsChip
11.3获取GPS状态
=>获取GPS状态
11.4 EPO更新方法
Objc:
// Step 1, determine the functionTable and see if it supports EPO upgrade
if (!__IDO_FUNCTABLE__.funcTable34Model.supportAirohaGpsChip) {
NSLog(@"This device does not support EPO upgrades");
return;
}
// Step 2, check if the EPO update exceeds 24 hours, and if it exceeds 24 hours, an update is required
//The general EPO update time is more than 24 hours before it needs to be updated
// gpsManager.updateTime = 24; default
IDOGpsManager*gpsManager = [IDOGpsManager shareInstance];
if (![gpsManager startCheckoutOnlineAgpsEPOIsNeedUpdate]) {
NSLog(@"EPO files cannot be operated during this time period");
return;
}
// Step 3, download the EPO upgrade file
[gpsManager downLoadEPOFile:^(IDOGpsUpgradeType status, NSString * _Nonnull epoFileFolder) {
if (status == IDOGpsUpgradeTypeSucc) {
self.filePathFolder = epoFileFolder;
NSLog(@"download successfully");
}else{
self.filePathFolder = nil;
NSLog(@"download failed");
}
}];
//Step 4, make the downloaded files from Step 3 into EPO files that can be upgraded
if(self.filePathFolder.length <= 0){
NSLog(@"download EPO file");
return;
}
self.epofilePath = [IDOGpsManager getMakeGpsZipFileWithFilePath:self.filePathFolder];
//Step 5, transfer the EPO file to the watch device
initTransferManager().transferType = IDO_DATA_FILE_TRAN_DIAL_TYPE;
initTransferManager().compressionType = IDO_DATA_TRAN_COMPRESSION_NO_USE_TYPE;
initTransferManager().fileName = @"EPO.DAT";
initTransferManager().isSetConnectParam = YES;
initTransferManager().isQueryWriteState = NO;
initTransferManager().filePath = self.epofilePath;
__weak typeof(self) weakSelf = self;
initTransferManager().addDetection(^(int errorCode) {
if errorCode == 0{
//Detection succeeded before update
}else {
//Detect errors before updating
}
}).addProgress(^(int progress) {
//Update file progress(0-100)
}).addTransfer(^(int errorCode,int value) {
if errorCode == 0 {
//File transfer succeeded
}else {
//file transfer failed
}
//Step 6, after the EPO upgrade is successful, update the EPO update time
if (errorCode == 0) {
self.filePathFolder = nil;
[[IDOGpsManager shareInstance] updateAgpsEPOFileUpdateTimeNow];
}
});
[IDOTransferFileManager startTransfer];