mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
AndroidGCS: Make the tablet load the appropriate UAVO file based on the description
from the assets. Rename the uavobjects.jar to match the uavo hash. Conflicts: androidgcs/assets/875bbaadee717b2f.jar
This commit is contained in:
parent
76785cad57
commit
df6d7eb11d
@ -9,6 +9,7 @@ import java.util.Observer;
|
||||
import org.openpilot.uavtalk.Telemetry;
|
||||
import org.openpilot.uavtalk.TelemetryMonitor;
|
||||
import org.openpilot.uavtalk.UAVObject;
|
||||
import org.openpilot.uavtalk.UAVObjectField;
|
||||
import org.openpilot.uavtalk.UAVObjectManager;
|
||||
import org.openpilot.uavtalk.UAVTalk;
|
||||
import org.openpilot.uavtalk.uavobjects.TelemObjectsInitialize;
|
||||
@ -96,9 +97,21 @@ public abstract class TelemetryTask implements Runnable {
|
||||
@Override
|
||||
public void update(Observable observable, Object data) {
|
||||
Log.d(TAG, "Received firmware IAP Updated message");
|
||||
telemService.loadUavobjects("uavobjects.jar", objMngr);
|
||||
|
||||
UAVObject obj = objMngr.getObject("FirmwareIAPObj");
|
||||
UAVObjectField description = obj.getField("Description");
|
||||
if(description == null || description.getNumElements() < 100) {
|
||||
telemService.toastMessage("Failed to determine UAVO set");
|
||||
} else {
|
||||
final int HASH_SIZE_USED = 8;
|
||||
String jarName = new String();
|
||||
for(int i = 0; i < HASH_SIZE_USED; i++)
|
||||
jarName += Integer.toHexString((int) description.getDouble(i+60));
|
||||
jarName += ".jar";
|
||||
Log.d(TAG, "Attempting to load: " + jarName);
|
||||
telemService.loadUavobjects(jarName, objMngr);
|
||||
}
|
||||
|
||||
obj.removeUpdatedObserver(this);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user