From c33c20fbd6bff692c233f1a33b081e04dee1d865 Mon Sep 17 00:00:00 2001 From: Gareth Potter Date: Mon, 10 Nov 2025 15:20:14 +0000 Subject: [PATCH 1/2] add thingset_export_subsets_progressively_abort --- include/thingset.h | 11 +++++++++++ src/thingset.c | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/include/thingset.h b/include/thingset.h index 2c74c7d..2cc9c77 100644 --- a/include/thingset.h +++ b/include/thingset.h @@ -1775,6 +1775,17 @@ int thingset_export_subsets_progressively(struct thingset_context *ts, uint8_t * enum thingset_data_format format, unsigned int *index, size_t *len); +/** + * Aborts the export of data to the buffer passed to @ref + * thingset_export_subsets_progressively. Call this method if. + * the export has failed outside ThingSet code. + * + * @param ts Pointer to ThingSet context. + * + * @returns 0 for success + */ +int thingset_export_subsets_progressively_abort(struct thingset_context *ts); + /** * Export id, value and/or name of a single data item. * diff --git a/src/thingset.c b/src/thingset.c index 508b8cf..dad32ce 100644 --- a/src/thingset.c +++ b/src/thingset.c @@ -163,6 +163,12 @@ int thingset_export_subsets_progressively(struct thingset_context *ts, uint8_t * return ret; } +int thingset_export_subsets_progressively_abort(struct thingset_context *ts) +{ + k_sem_give(&ts->lock); + return 0; +} + int thingset_export_subsets(struct thingset_context *ts, uint8_t *buf, size_t buf_size, uint16_t subsets, enum thingset_data_format format) { From ba6ae2baac57298f20de8e8d04a0e4ee4844ac81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= <17674105+martinjaeger@users.noreply.github.com> Date: Mon, 10 Nov 2025 17:42:15 +0100 Subject: [PATCH 2/2] Update include/thingset.h --- include/thingset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/thingset.h b/include/thingset.h index 2cc9c77..2824bd4 100644 --- a/include/thingset.h +++ b/include/thingset.h @@ -1777,7 +1777,7 @@ int thingset_export_subsets_progressively(struct thingset_context *ts, uint8_t * /** * Aborts the export of data to the buffer passed to @ref - * thingset_export_subsets_progressively. Call this method if. + * thingset_export_subsets_progressively. Call this method if * the export has failed outside ThingSet code. * * @param ts Pointer to ThingSet context.