EPO file update

11.1Functional Overview

EPO is the Assisted Global Positioning System, which refers to the operation mode of GPS. It can use the information of the mobile phone base station and cooperate with the traditional GPS satellite to make the positioning speed faster. It should be noted that the EPO file is updated: 15 seconds after the bracelet is connected to the App, the query of the GPS status does not run to update the EPO file, otherwise the update will fail.

11.2 Corresponding function table

//EPO funcTable
__IDO_FUNCTABLE__.funcTable34Model.supportAirohaGpsChip

11.3 Get GPS status

=>Get GPS status

11.4 EPO update method

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];

11.5 DemoAGPS Update function entry

Copyright © 2015-2020 IDO. All rights reserved. all right reserved,powered by GitbookModify Date: 2023-12-18 10:04:13

results matching ""

    No results matching ""