本文整理汇总了Java中com.o3dr.services.android.lib.drone.attribute.AttributeEvent.WARNING_NO_GPS属性的典型用法代码示例。如果您正苦于以下问题:Java AttributeEvent.WARNING_NO_GPS属性的具体用法?Java AttributeEvent.WARNING_NO_GPS怎么用?Java AttributeEvent.WARNING_NO_GPS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.o3dr.services.android.lib.drone.attribute.AttributeEvent
的用法示例。
在下文中一共展示了AttributeEvent.WARNING_NO_GPS属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDroneEvent
@Override
public void onDroneEvent(String event, Bundle extras) {
switch (event) {
case AttributeEvent.STATE_CONNECTED:
handleDroneConnected();
break;
case AttributeEvent.STATE_DISCONNECTED:
handleDroneDisconnected();
break;
case AttributeEvent.STATE_UPDATED:
break;
case AttributeEvent.STATE_ARMING:
if (startMission) {
DroneStateApi.setVehicleMode(drone, VehicleMode.COPTER_GUIDED);
GuidedApi.takeoff(drone, TAKEOFF_ALTITUDE);
}
break;
case AttributeEvent.STATE_VEHICLE_MODE:
break;
case AttributeEvent.HOME_UPDATED:
break;
case AttributeEvent.TYPE_UPDATED:
case AttributeEvent.ATTITUDE_UPDATED:
case AttributeEvent.ALTITUDE_UPDATED:
Altitude altitude = drone.getAttribute(AttributeType.ALTITUDE);
if (startMission) {
startAutoPilotWhenTakeOffFinished(altitude);
} else if (endMissionWhenLanded) {
if (altitude != null && altitude.getAltitude() < 1) {
missionListener.onMissionFinished();
endMissionWhenLanded = false;
}
}
break;
case AttributeEvent.SPEED_UPDATED:
break;
case AttributeEvent.BATTERY_UPDATED:
handleBatteryStateChange();
break;
case AttributeEvent.GPS_POSITION:
case AttributeEvent.GPS_FIX:
case AttributeEvent.GPS_COUNT:
case AttributeEvent.WARNING_NO_GPS:
handleGpsStateChange();
break;
case AttributeEvent.AUTOPILOT_MESSAGE:
Log.i("DRONE_EVENT", extras.getString(AttributeEventExtra.EXTRA_AUTOPILOT_MESSAGE));
default:
break;
}
}