Skip to content

Commit

Permalink
Memfault Firmware SDK 0.43.2 (Build 2071)
Browse files Browse the repository at this point in the history
  • Loading branch information
Memfault Inc committed May 3, 2023
1 parent 79611f2 commit 6400d71
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### Changes between Memfault SDK 0.43.2 and 0.43.1 - May 3, 2023

#### :chart_with_upwards_trend: Improvements

- Fix a bug 🐛 where metrics accumulated with `memfault_metrics_heartbeat_add()`
would no longer be included in the serialized heartbeat data. This regression
occurred in `0.42.0`.

### Changes between Memfault SDK 0.43.1 and 0.43.0 - April 26, 2023

#### :chart_with_upwards_trend: Improvements
Expand Down
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
BUILD ID: 2030
GIT COMMIT: 6bca4dee8
BUILD ID: 2071
GIT COMMIT: b1c0f7c97
2 changes: 1 addition & 1 deletion components/include/memfault/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ typedef struct {
uint8_t patch;
} sMfltSdkVersion;

#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 43, .patch = 1 }
#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 43, .patch = 2 }

#ifdef __cplusplus
}
Expand Down
3 changes: 3 additions & 0 deletions components/metrics/src/memfault_metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,9 @@ int memfault_metrics_heartbeat_add(MemfaultMetricId key, int32_t amount) {
memfault_lock();
{
rv = prv_find_key_and_add(key, amount);
if(rv == 0) {
prv_read_write_is_value_set(key, true);
}
}
memfault_unlock();
return rv;
Expand Down
19 changes: 19 additions & 0 deletions tests/src/test_memfault_heartbeat_metrics_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,23 @@ TEST(MemfaultHeartbeatMetricsDebug, Test_DebugPrints) {
MEMFAULT_ARRAY_SIZE(heartbeat_debug_print_reset));
memfault_metrics_heartbeat_debug_print();
mock().checkExpectations();

// Finally test that memfault_metrics_heartbeat_add by itself sets the metric
// to is_set
const char *heartbeat_add_non_null[] = {
"Heartbeat keys/values:",
" MemfaultSdkMetric_IntervalMs: 0",
" MemfaultSdkMetric_UnexpectedRebootCount: null",
" MemfaultSdkMetric_UnexpectedRebootDidOccur: 0",
" test_key_unsigned: 123",
" test_key_signed: null",
" test_key_timer: 0",
" test_key_string: \"\"",
};
prv_debug_print_expectations(kMemfaultPlatformLogLevel_Debug, heartbeat_add_non_null,
MEMFAULT_ARRAY_SIZE(heartbeat_add_non_null));
// call add on this metric alone and confirm it is set
memfault_metrics_heartbeat_add(MEMFAULT_METRICS_KEY(test_key_unsigned), 123);
memfault_metrics_heartbeat_debug_print();
mock().checkExpectations();
}

0 comments on commit 6400d71

Please sign in to comment.