aboutsummaryrefslogtreecommitdiff
path: root/src/modules/dataman/dataman.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/dataman/dataman.h')
-rw-r--r--src/modules/dataman/dataman.h26
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