Skip to content

Commit 6400d71

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 0.43.2 (Build 2071)
1 parent 79611f2 commit 6400d71

File tree

5 files changed

+33
-3
lines changed

5 files changed

+33
-3
lines changed

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### Changes between Memfault SDK 0.43.2 and 0.43.1 - May 3, 2023
2+
3+
#### :chart_with_upwards_trend: Improvements
4+
5+
- Fix a bug 🐛 where metrics accumulated with `memfault_metrics_heartbeat_add()`
6+
would no longer be included in the serialized heartbeat data. This regression
7+
occurred in `0.42.0`.
8+
19
### Changes between Memfault SDK 0.43.1 and 0.43.0 - April 26, 2023
210

311
#### :chart_with_upwards_trend: Improvements

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
BUILD ID: 2030
2-
GIT COMMIT: 6bca4dee8
1+
BUILD ID: 2071
2+
GIT COMMIT: b1c0f7c97

components/include/memfault/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ typedef struct {
1919
uint8_t patch;
2020
} sMfltSdkVersion;
2121

22-
#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 43, .patch = 1 }
22+
#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 43, .patch = 2 }
2323

2424
#ifdef __cplusplus
2525
}

components/metrics/src/memfault_metrics.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,9 @@ int memfault_metrics_heartbeat_add(MemfaultMetricId key, int32_t amount) {
649649
memfault_lock();
650650
{
651651
rv = prv_find_key_and_add(key, amount);
652+
if(rv == 0) {
653+
prv_read_write_is_value_set(key, true);
654+
}
652655
}
653656
memfault_unlock();
654657
return rv;

tests/src/test_memfault_heartbeat_metrics_debug.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,23 @@ TEST(MemfaultHeartbeatMetricsDebug, Test_DebugPrints) {
150150
MEMFAULT_ARRAY_SIZE(heartbeat_debug_print_reset));
151151
memfault_metrics_heartbeat_debug_print();
152152
mock().checkExpectations();
153+
154+
// Finally test that memfault_metrics_heartbeat_add by itself sets the metric
155+
// to is_set
156+
const char *heartbeat_add_non_null[] = {
157+
"Heartbeat keys/values:",
158+
" MemfaultSdkMetric_IntervalMs: 0",
159+
" MemfaultSdkMetric_UnexpectedRebootCount: null",
160+
" MemfaultSdkMetric_UnexpectedRebootDidOccur: 0",
161+
" test_key_unsigned: 123",
162+
" test_key_signed: null",
163+
" test_key_timer: 0",
164+
" test_key_string: \"\"",
165+
};
166+
prv_debug_print_expectations(kMemfaultPlatformLogLevel_Debug, heartbeat_add_non_null,
167+
MEMFAULT_ARRAY_SIZE(heartbeat_add_non_null));
168+
// call add on this metric alone and confirm it is set
169+
memfault_metrics_heartbeat_add(MEMFAULT_METRICS_KEY(test_key_unsigned), 123);
170+
memfault_metrics_heartbeat_debug_print();
171+
mock().checkExpectations();
153172
}

0 commit comments

Comments
 (0)