![]() |
nRF Connect SDK API 3.3.99
|
| int read_variable_data | ( | enum variable_data_type | data_type, |
| uint8_t * | buf, | ||
| uint32_t * | buf_len ) |
#include <include/bl_storage.h>
Read variable data from OTP.
Variable data starts with variable data collection ID, followed by amount of variable data entries and the variable data entries themselves. [Collection ID][Variable count][Type][Variable data length][Variable data][Type]... 2 bytes 2 bytes 1 byte 1 byte 0-255 bytes
| [in] | data_type | Type of the variable data to read. |
| [out] | buf | Buffer to store the variable data. |
| [in,out] | buf_len | On input, the size of the buffer. On output, the length of the data. |
| 0 | Variable data read successfully, or not found. |
| -EINVAL | No buffer provided. |
| -ENOMEM | Buffer too small. |