Initiate a Barometer Calibration

The Pinnacle SDK provides a method called “startBarocalUpload” for the app to direct the SDK to perform data collection for barometer calibration purposes when the app determines the most appropriate time and location. More information on the most suitable time and location to perform barometer sensor calibration is described in the “App Note — NextNav Pinnacle Service Best Practices” document on the NextNav Developer Portal. When “startBarocalUpload” method is called, the SDK collects pressure and location data directly from the device to facilitate the barometer calibration process. 

The following method is used to initiate baro-calibration process: 

public static func startBarocalUpload(handler: @escaping NNSDKCompletionHandler)

The SDK also supports a mode where the app can provide the 2D location to the SDK for the baro-calibration process by calling the “setAltitude” function. When this function is called along before the “startBarocalUpload” function, the SDK uses the 2D location provided by the App and does NOT read it directly from the device. The SDK reads the pressure data directly from the device. 

The host App needs to use the following method to set up the location before calling the above method: 

public static func setAltitude(location: CLLocation? = nil, pressure: Double? = nil)

Note: using nil for parameter pressure to set up 2D location only