diff options
author | Jean Cyr <jcyr@dillobits.com> | 2014-06-08 14:08:22 -0400 |
---|---|---|
committer | Jean Cyr <jcyr@dillobits.com> | 2014-06-08 14:08:22 -0400 |
commit | a6cf04a6ff623b7d39a97c70f837198b6c064f5b (patch) | |
tree | 085638467d1b1c7d7fc0f44fb47146a56775aed2 /src/modules/dataman/dataman.h | |
parent | 3e66d7e0c9eaa61caf427f38ba4b7a1ab86b1ff3 (diff) | |
download | px4-firmware-a6cf04a6ff623b7d39a97c70f837198b6c064f5b.tar.gz px4-firmware-a6cf04a6ff623b7d39a97c70f837198b6c064f5b.tar.bz2 px4-firmware-a6cf04a6ff623b7d39a97c70f837198b6c064f5b.zip |
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.
Diffstat (limited to 'src/modules/dataman/dataman.h')
-rw-r--r-- | src/modules/dataman/dataman.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/modules/dataman/dataman.h b/src/modules/dataman/dataman.h index 1dfb26f73..f2b6cd4d3 100644 --- a/src/modules/dataman/dataman.h +++ b/src/modules/dataman/dataman.h @@ -53,6 +53,7 @@ extern "C" { DM_KEY_WAYPOINTS_OFFBOARD_0, /* Mission way point coordinates sent over mavlink */ DM_KEY_WAYPOINTS_OFFBOARD_1, /* (alernate between 0 and 1) */ DM_KEY_WAYPOINTS_ONBOARD, /* Mission way point coordinates generated onboard */ + DM_KEY_SYSTEM_STATE, /* Persistent system state storage */ DM_KEY_NUM_KEYS /* Total number of item types defined */ } dm_item_t; @@ -62,7 +63,8 @@ extern "C" { DM_KEY_FENCE_POINTS_MAX = GEOFENCE_MAX_VERTICES, DM_KEY_WAYPOINTS_OFFBOARD_0_MAX = NUM_MISSIONS_SUPPORTED, DM_KEY_WAYPOINTS_OFFBOARD_1_MAX = NUM_MISSIONS_SUPPORTED, - DM_KEY_WAYPOINTS_ONBOARD_MAX = NUM_MISSIONS_SUPPORTED + DM_KEY_WAYPOINTS_ONBOARD_MAX = NUM_MISSIONS_SUPPORTED, + DM_KEY_SYSTEM_STATE_MAX = 1 }; /** Data persistence levels */ @@ -101,6 +103,18 @@ extern "C" { size_t buflen /* Length in bytes of data to retrieve */ ); + /** Lock all items of this type */ + __EXPORT void + dm_lock( + dm_item_t item /* The item type to clear */ + ); + + /** Unlock all items of this type */ + __EXPORT void + dm_unlock( + dm_item_t item /* The item type to clear */ + ); + /** Erase all items of this type */ __EXPORT int dm_clear( @@ -113,6 +127,16 @@ extern "C" { dm_reset_reason restart_type /* The last reset type */ ); + /* NOTE: The following structure defines the persistent system state data stored in the single + entry DM_KEY_SYSTEM_STATE_KEY item type. It contains global system state information that + needs to survive restarts. This definition is application specific so it doesn't really belong + in this header, but till I find it a better home here it is */ + + typedef struct { + char current_offboard_waypoint_id; /* the index of the active offboard waypoint data */ + /* (DM_KEY_WAYPOINTS_OFFBOARD_n) or -1 for none */ + } persistent_system_state_t; + #ifdef __cplusplus } #endif |