|
Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
|
TDF data logger API . More...
Macros | |
| #define | TDF_DATA_LOGGER_LOG(logger_mask, tdf_id, tdf_time, data) |
| Type safe wrapper around tdf_data_logger_log. | |
| #define | TDF_DATA_LOGGER_LOG_ARRAY(logger_mask, tdf_id, tdf_num, tdf_time, period, data) |
| Type safe wrapper around tdf_data_logger_log_array. | |
Enumerations | |
| enum | tdf_data_logger_mask { TDF_DATA_LOGGER_FLASH = BIT(_TDF_DATA_LOGGER_FLASH_OFFSET) , TDF_DATA_LOGGER_REMOVABLE = BIT(_TDF_DATA_LOGGER_REMOVABLE_OFFSET) , TDF_DATA_LOGGER_SERIAL = BIT(_TDF_DATA_LOGGER_SERIAL_OFFSET) , TDF_DATA_LOGGER_UDP = BIT(_TDF_DATA_LOGGER_UDP_OFFSET) , TDF_DATA_LOGGER_BT_ADV = BIT(_TDF_DATA_LOGGER_BT_ADV_OFFSET) , TDF_DATA_LOGGER_BT_PERIPHERAL = BIT(_TDF_DATA_LOGGER_BT_PERIPHERAL_OFFSET) } |
| TDF data logger backends. More... | |
Functions | |
| int | tdf_data_logger_log_core_dev (const struct device *dev, uint16_t tdf_id, uint8_t tdf_len, uint8_t tdf_num, enum tdf_data_format format, uint64_t time, uint32_t idx_period, const void *data) |
| Add multiple TDFs to a data logger. | |
| void | tdf_data_logger_log_core (uint8_t logger_mask, uint16_t tdf_id, uint8_t tdf_len, uint8_t tdf_num, enum tdf_data_format format, uint64_t time, uint32_t idx_period, const void *data) |
| Add multiple TDFs to multiple data loggers. | |
| static int | tdf_data_logger_log_array_dev (const struct device *dev, uint16_t tdf_id, uint8_t tdf_len, uint8_t tdf_num, uint64_t time, uint32_t period, const void *data) |
| Add multiple TDFs to a data logger. | |
| static void | tdf_data_logger_log_array (uint8_t logger_mask, uint16_t tdf_id, uint8_t tdf_len, uint8_t tdf_num, uint64_t time, uint32_t period, const void *data) |
| Add multiple TDFs to multiple data loggers. | |
| static int | tdf_data_logger_log_dev (const struct device *dev, uint16_t tdf_id, uint8_t tdf_len, uint64_t time, const void *data) |
| Add a single TDF to a data logger. | |
| static void | tdf_data_logger_log (uint8_t logger_mask, uint16_t tdf_id, uint8_t tdf_len, uint64_t time, const void *data) |
| Add a single TDF to multiple data loggers. | |
| int | tdf_data_logger_block_bytes_pending (const struct device *dev) |
| Query the number of bytes pending on the current block. | |
| int | tdf_data_logger_block_bytes_remaining (const struct device *dev) |
| Query the number of bytes remaining until the logger block will be flushed. | |
| int | tdf_data_logger_flush_dev (const struct device *dev) |
| Flush any pending TDFs to backend. | |
| void | tdf_data_logger_flush (uint8_t logger_mask) |
| Flush any pending TDFs to multiple backends. | |
| int | tdf_data_logger_remote_id_set (const struct device *dev, uint64_t remote_id) |
| Set the remote ID associated with the logger. | |
TDF data logger API .
| #define TDF_DATA_LOGGER_LOG | ( | logger_mask, | |
| tdf_id, | |||
| tdf_time, | |||
| data ) |
#include <infuse/data_logger/high_level/tdf.h>
Type safe wrapper around tdf_data_logger_log.
Adds compile-time validation that the passed pointer matches the type associated with tdf_id.
| logger_mask | Bitmask of loggers to write to (tdf_data_logger_mask) |
| tdf_id | TDF sensor ID |
| tdf_time | Epoch time associated with the TDF. 0 for no timestamp. |
| data | TDF data |
| #define TDF_DATA_LOGGER_LOG_ARRAY | ( | logger_mask, | |
| tdf_id, | |||
| tdf_num, | |||
| tdf_time, | |||
| period, | |||
| data ) |
#include <infuse/data_logger/high_level/tdf.h>
Type safe wrapper around tdf_data_logger_log_array.
Adds compile-time validation that the passed pointer matches the type associated with tdf_id.
| logger_mask | Bitmask of loggers to write to (tdf_data_logger_mask) |
| tdf_id | TDF sensor ID |
| tdf_num | Number of TDFs to add |
| tdf_time | Epoch time associated with the TDF. 0 for no timestamp. |
| period | Time period between the TDF samples |
| data | TDF data |
| enum tdf_data_logger_mask |
#include <infuse/data_logger/high_level/tdf.h>
TDF data logger backends.
| int tdf_data_logger_block_bytes_pending | ( | const struct device * | dev | ) |
#include <infuse/data_logger/high_level/tdf.h>
Query the number of bytes pending on the current block.
| dev | Data logger |
| int tdf_data_logger_block_bytes_remaining | ( | const struct device * | dev | ) |
#include <infuse/data_logger/high_level/tdf.h>
Query the number of bytes remaining until the logger block will be flushed.
| dev | Data logger |
| void tdf_data_logger_flush | ( | uint8_t | logger_mask | ) |
#include <infuse/data_logger/high_level/tdf.h>
Flush any pending TDFs to multiple backends.
| logger_mask | Bitmask of loggers to flush (tdf_data_logger_mask) |
| int tdf_data_logger_flush_dev | ( | const struct device * | dev | ) |
#include <infuse/data_logger/high_level/tdf.h>
Flush any pending TDFs to backend.
| dev | Data logger |
| 0 | On success (Or no data to flush) |
| -errno | Error code from data_logger_block_write |
|
inlinestatic |
#include <infuse/data_logger/high_level/tdf.h>
Add a single TDF to multiple data loggers.
| logger_mask | Bitmask of loggers to write to (tdf_data_logger_mask) |
| tdf_id | TDF sensor ID |
| tdf_len | Length of a single TDF |
| time | Epoch time associated with the TDF. 0 for no timestamp. |
| data | TDF data |
|
inlinestatic |
#include <infuse/data_logger/high_level/tdf.h>
Add multiple TDFs to multiple data loggers.
| logger_mask | Bitmask of loggers to write to (tdf_data_logger_mask) |
| tdf_id | TDF sensor ID |
| tdf_len | Length of a single TDF |
| tdf_num | Number of TDFs to add |
| time | Epoch time associated with the first TDF. 0 for no timestamp. |
| period | Time period between the TDF samples |
| data | TDF data array |
|
inlinestatic |
#include <infuse/data_logger/high_level/tdf.h>
Add multiple TDFs to a data logger.
| dev | Data logger |
| tdf_id | TDF sensor ID |
| tdf_len | Length of a single TDF |
| tdf_num | Number of TDFs to add |
| time | Epoch time associated with the first TDF. 0 for no timestamp. |
| period | Time period between the TDF samples |
| data | TDF data array |
| 0 | On success |
| -errno | Error code from tdf_add or tdf_data_logger_flush on error |
| void tdf_data_logger_log_core | ( | uint8_t | logger_mask, |
| uint16_t | tdf_id, | ||
| uint8_t | tdf_len, | ||
| uint8_t | tdf_num, | ||
| enum tdf_data_format | format, | ||
| uint64_t | time, | ||
| uint32_t | idx_period, | ||
| const void * | data ) |
#include <infuse/data_logger/high_level/tdf.h>
Add multiple TDFs to multiple data loggers.
| logger_mask | Bitmask of loggers to write to (tdf_data_logger_mask) |
| tdf_id | TDF sensor ID |
| tdf_len | Length of a single TDF |
| tdf_num | Number of TDFs to add |
| format | TDF data encoding format |
| time | Epoch time associated with the first TDF. 0 for no timestamp. |
| idx_period | Index of first sample if format == TDF_DATA_FORMAT_IDX_ARRAY Epoch time between tdfs when tdf_num > 0 otherwise. |
| data | TDF data array |
| int tdf_data_logger_log_core_dev | ( | const struct device * | dev, |
| uint16_t | tdf_id, | ||
| uint8_t | tdf_len, | ||
| uint8_t | tdf_num, | ||
| enum tdf_data_format | format, | ||
| uint64_t | time, | ||
| uint32_t | idx_period, | ||
| const void * | data ) |
#include <infuse/data_logger/high_level/tdf.h>
Add multiple TDFs to a data logger.
| dev | Data logger |
| tdf_id | TDF sensor ID |
| tdf_len | Length of a single TDF |
| tdf_num | Number of TDFs to add |
| format | TDF data encoding format |
| time | Epoch time associated with the first TDF. 0 for no timestamp. |
| idx_period | Index of first sample if format == TDF_DATA_FORMAT_IDX_ARRAY Epoch time between tdfs when tdf_num > 0 otherwise. |
| data | TDF data array |
| 0 | On success |
| -errno | Error code from tdf_add or tdf_data_logger_flush on error |
|
inlinestatic |
#include <infuse/data_logger/high_level/tdf.h>
Add a single TDF to a data logger.
| dev | Data logger |
| tdf_id | TDF sensor ID |
| tdf_len | Length of a single TDF |
| time | Epoch time associated with the TDF. 0 for no timestamp. |
| data | TDF data |
| 0 | On success |
| -errno | Error code from tdf_add or tdf_data_logger_flush on error |
| int tdf_data_logger_remote_id_set | ( | const struct device * | dev, |
| uint64_t | remote_id ) |
#include <infuse/data_logger/high_level/tdf.h>
Set the remote ID associated with the logger.
If the logger was previously logging a different remote ID, any pending data will be flushed.
| dev | TDF logger to update |
| remote_id | ID of the remote device |
| 0 | on success |
| -EINVAL | Logger is not a remote TDF logger |