OTA Service
The OTA service package provides classes to update local data based on OTA area.
Please see the API reference for the main classes related to OTA Service.
The OtaService currently only supports home area update and sub region area update. Other types of OTA areas may be supported in the future. The HomeAreaClient currently supports 5 requests (Estimate, Update, Status, LatestUpdateStatus, and Reset). And the SubRegionAreaClient currently supports 6 requests (Query, Estimate, Update, Status, LatestUpdateStatus, and Reset). Note that the EstimateRequest & UpdateRequest will take several minutes to tens of minutes. All other requests are expected to be very fast.
Query
This API gives a complete list of all pre-defined sub region areas that are currently available. It should be called when user wishes to know details of the whole sub region areas picture.
Key methods
Method | Details |
---|---|
Sample code
1 2 |
|
1 2 |
|
Response example
1 2 3 4 5 6 7 8 9 10 |
|
Estimate
This API gives a rough estimate of the total size of all OTA data that an UpdateRequest with the exact same parameters must download, as well as the total time needed to finish the whole downloading. It can be called when user wishes to get an overall estimate of next OTA update's result before an UpdateRequest is called.
Key methods
Method | Details |
---|---|
setCurrentLocation(double latitude, double longitude) | The user's current location using geographic coordinates of latitude and longitude |
setTimeout(Integer timeout) | The time limit to wait for OTA data update estimate. If the estimate job does not finish within this time, it would be aborted and the final status is reported as failure |
addSubRegionId(String id) | The id of the sub region area that user explicitly specifies to update |
Sample code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
Note: The synchronous interface execute() is not allowed for EstimateRequest as it usually cannot finish instaneously.
Response example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
Update
This API performs the major function of the OTA service. It collects all the information pertaining to local area data as well as user profile, and sends it to the Telenav cloud. Then according to the response from the cloud, it downloads data packages for different components (a.k.a. layers) and notifies the navigation components to update their data being locally used. It should be called whenever user changes their work/home addresses so that a new home area is needed, or switches to another sub region area, or just wishes to check if there is any latest data update for an existing home/sub region area.
Key methods
Method | Details |
---|---|
setCurrentLocation(double latitude, double longitude) | The user's current location using geographic coordinates of latitude and longitude |
setTimeout(Integer timeout) | The time limit to wait for OTA data update. If the update does not finish within this time, it would be aborted and the final status is reported as failure |
addSubRegionId(String id) | The id of the sub region area that user explicitly specifies to update |
Sample code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
Note: The synchronous interface execute() is not allowed for UpdateRequest as it usually takes too much time to execute.
Response example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Status
This API reveals the real-time details of the OTA areas' being-used OTA data, including the geometry(for HomeArea only), data size, created time and last updated time. It can be called whenever there is a live OTA service instance, so user could always use it to check the current OTA areas' status. And while there is an on-going update job, this API refreshes each area's/layer's OTA data status if and only if the corresponding component notifies an change. That being said, sometimes one area's/layer's status can remain the same before and after an OTA update, especially when the relevant component supports roll-back from a failed update.
Sample code
1 2 3 |
|
1 2 3 |
|
Response example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
LatestUpdateStatus
This API returns real-time details of the latest updae to the OTA areas, including the geometry(for HomeArea only), data size, updated time and current update status (ongoing, success or failure with reasons). It can be called at any time via a live OTA service instance. So user could use it to check the update progress of each individual component when an update is ongoing, or recall the final result of a previous update otherwise.
Sample code
1 2 3 |
|
1 2 3 |
|
Response example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Reset
This API clears local OTA data of the specified areas(if user explicitly set sub region area ids) or all areas(by default) and reverts to use the original data. It should be called when user wishes to remove some or all OTA areas data.
Sample code
1 2 3 |
|
1 2 3 |
|
Response example
1 2 3 4 |
|