Create system state entry in dataman - ATTN Anton

Create persistent system state id for data manager to store system state
that will persist across resets.
This commit is contained in:
Jean Cyr
2014-06-08 14:08:22 -04:00
parent 3e66d7e0c9
commit a6cf04a6ff
5 changed files with 136 additions and 13 deletions
+9
View File
@@ -603,6 +603,15 @@ Navigator::task_main()
warnx("Could not clear geofence");
}
#if 0 // *** UNTESTED... Anton, this is for you
/* Get the last offboard mission id */
persistent_system_state_t sys_state;
if (dm_read(DM_KEY_SYSTEM_STATE, 0, &sys_state, sizeof(sys_state)) == sizeof(sys_state)) {
if ((sys_state.current_offboard_waypoint_id >= 0) && (sys_state.current_offboard_waypoint_id <= 1))
_mission.set_offboard_dataman_id(sys_state.current_offboard_waypoint_id);
}
#endif
/*
* do subscriptions
*/