forked from nrfconnect/sdk-nrf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmemfault_ncs.h
55 lines (45 loc) · 1.27 KB
/
memfault_ncs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* Copyright (c) 2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/
/** @file
* @brief Memfault NCS integration
*/
#ifndef _MEMFAULT_NCS_H_
#define _MEMFAULT_NCS_H_
/**
* @defgroup memfault_ncs Memfault integration in NCS
* @brief Convenience functions for using Memfault firmware SDK with nRF Connect SDK.
*
* @{
*/
#include <zephyr/kernel.h>
#ifdef __cplusplus
extern "C" {
#endif
/** @brief Set the Memfault device ID.
*
* @note In order to use this API successfully, CONFIG_MEMFAULT_NCS_DEVICE_ID_RUNTIME
* must be enabled.
*
* @param device_id Pointer to device ID buffer
* @param len Length of device ID. Cannot exceed CONFIG_MEMFAULT_NCS_DEVICE_ID_MAX_LEN.
*
* @return 0 on success, otherwise a negative error code
*/
int memfault_ncs_device_id_set(const char *device_id, size_t len);
/** @brief Trigger NCS metrics collection. Called by default from NCS
* memfault_metrics_heartbeat_collect_data(), but can instead be called
* from user's implementation of
* memfault_metrics_heartbeat_collect_data(), see
* CONFIG_MEMFAULT_NCS_IMPLEMENT_METRICS_COLLECTION Kconfig option.
*/
void memfault_ncs_metrics_collect_data(void);
#ifdef __cplusplus
}
#endif
/**
* @}
*/
#endif /* _MEMFAULT_NCS_H_ */