From fb3c58d85f0ea53f878bf6b121c9c7bd7b9ed4c0 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 7 Jan 2018 16:35:08 +0100 Subject: [PATCH] Param interface: Publish instance count This helps subscribers to understand if they should update their parameters or not. We will extend this with other flags such as the current save status and alike. --- msg/parameter_update.msg | 2 +- src/modules/systemlib/param/param.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/msg/parameter_update.msg b/msg/parameter_update.msg index 0fc1e74370..d7e88320f0 100644 --- a/msg/parameter_update.msg +++ b/msg/parameter_update.msg @@ -1,3 +1,3 @@ # This message is used to notify the system about one or more parameter changes -uint32 dummy # unused +uint32 instance # Instance count - constantly incrementing diff --git a/src/modules/systemlib/param/param.c b/src/modules/systemlib/param/param.c index be3be7b188..585db04d52 100644 --- a/src/modules/systemlib/param/param.c +++ b/src/modules/systemlib/param/param.c @@ -149,6 +149,7 @@ FLASH_PARAMS_EXPOSE const UT_icd param_icd = {sizeof(struct param_wbuf_s), NU #if !defined(PARAM_NO_ORB) /** parameter update topic handle */ static orb_advert_t param_topic = NULL; +static unsigned int param_instance = 0; #endif static void param_set_used_internal(param_t param); @@ -302,7 +303,7 @@ _param_notify_changes(void) #if !defined(PARAM_NO_ORB) struct parameter_update_s pup = { .timestamp = hrt_absolute_time(), - .dummy = 0 + .instance = param_instance++, }; /*