MetaWear C++ API
0.18.0
C++ implementation of the MetaWear protocol
|
Controls the onboard logging system. More...
#include <stdint.h>
#include "data.h"
#include "datasignal_fwd.h"
#include "logging_fwd.h"
#include "metawearboard_fwd.h"
#include "metawear/platform/dllmarker.h"
Go to the source code of this file.
Classes | |
struct | MblMwLogDownloadHandler |
Callback functions for handling notifications from the logger. More... | |
struct | MblMwRawLogDownloadHandler |
Callback functions for handling notifications from the logger. More... | |
Functions | |
METAWEAR_API void | mbl_mw_logging_start (const MblMwMetaWearBoard *board, uint8_t overwrite) |
Starts data logging. More... | |
METAWEAR_API void | mbl_mw_logging_stop (const MblMwMetaWearBoard *board) |
Stops data logging. More... | |
METAWEAR_API void | mbl_mw_logging_clear_entries (const MblMwMetaWearBoard *board) |
Clear the logger of saved entries. More... | |
METAWEAR_API void | mbl_mw_logging_download (MblMwMetaWearBoard *board, uint8_t n_notifies, const MblMwLogDownloadHandler *handler) |
Downloads the log data. More... | |
METAWEAR_API uint8_t | mbl_mw_logger_get_id (const MblMwDataLogger *logger) |
Retrieves the id value identifying the logger. More... | |
METAWEAR_API MblMwDataSignal * | mbl_mw_logger_get_signal (const MblMwDataLogger *logger) |
Retrieves the data signal the logger is recording data for. More... | |
METAWEAR_API MblMwDataLogger * | mbl_mw_logger_lookup_id (const MblMwMetaWearBoard *board, uint8_t id) |
Looks up the MblMwDataLogger object corresponding to the id. More... | |
METAWEAR_API void | mbl_mw_logger_remove (MblMwDataLogger *logger) |
Removes the logger from the board. More... | |
METAWEAR_API void | mbl_mw_logger_subscribe (MblMwDataLogger *logger, void *context, MblMwFnData received_data) |
Subscribes to responses from the data logger. More... | |
METAWEAR_API const char * | mbl_mw_logger_generate_identifier (const MblMwDataLogger *logger) |
Generates a string identifying the data chain the logger is receiving data from. More... | |
METAWEAR_API MblMwDataSignal * | mbl_mw_logging_get_length_data_signal (const MblMwMetaWearBoard *board) |
Retrieves a data signal representing the length of the log, including timestamps. More... | |
METAWEAR_API MblMwDataSignal * | mbl_mw_logging_get_time_data_signal (const MblMwMetaWearBoard *board) |
Retrieves a data signal representing the current logger time state. More... | |
METAWEAR_API uint8_t | mbl_mw_logging_get_latest_reset_uid (const MblMwMetaWearBoard *board) |
Get the latest reset_uid read duing connection. More... | |
METAWEAR_API int64_t | mbl_mw_logging_get_reference_time (const MblMwMetaWearBoard *board, uint8_t reset_uid) |
Get the device boot time for a given reset_uid. More... | |
METAWEAR_API void | mbl_mw_logging_set_reference_time (const MblMwMetaWearBoard *board, uint8_t reset_uid, int64_t reference_epoch) |
Set the device boot time for a given reset_uid. More... | |
METAWEAR_API void | mbl_mw_logging_raw_download (MblMwMetaWearBoard *board, uint8_t n_notifies, const MblMwRawLogDownloadHandler *handler) |
Downloads the raw log data. More... | |
Controls the onboard logging system.
METAWEAR_API const char* mbl_mw_logger_generate_identifier | ( | const MblMwDataLogger * | logger | ) |
Generates a string identifying the data chain the logger is receiving data from.
This string is matched with the output of mbl_mw_anonymous_datasignal_get_identifier. The memory allocated by the function must be freed by calling mbl_mw_memory_free.
logger | Calling object |
METAWEAR_API uint8_t mbl_mw_logger_get_id | ( | const MblMwDataLogger * | logger | ) |
Retrieves the id value identifying the logger.
logger | Logger to lookup |
METAWEAR_API MblMwDataSignal* mbl_mw_logger_get_signal | ( | const MblMwDataLogger * | logger | ) |
Retrieves the data signal the logger is recording data for.
logger | Logger to lookup |
METAWEAR_API MblMwDataLogger* mbl_mw_logger_lookup_id | ( | const MblMwMetaWearBoard * | board, |
uint8_t | id | ||
) |
Looks up the MblMwDataLogger object corresponding to the id.
board | Board to search on |
id | Numerical id to lookup |
METAWEAR_API void mbl_mw_logger_remove | ( | MblMwDataLogger * | logger | ) |
Removes the logger from the board.
logger | logger to remove |
METAWEAR_API void mbl_mw_logger_subscribe | ( | MblMwDataLogger * | logger, |
void * | context, | ||
MblMwFnData | received_data | ||
) |
Subscribes to responses from the data logger.
logger | Logger to subscribe to |
context | Pointer to additional data for the callback function |
received_data | Callback function to handle data received from the logger |
METAWEAR_API void mbl_mw_logging_clear_entries | ( | const MblMwMetaWearBoard * | board | ) |
Clear the logger of saved entries.
board | Board to remove entries from |
METAWEAR_API void mbl_mw_logging_download | ( | MblMwMetaWearBoard * | board, |
uint8_t | n_notifies, | ||
const MblMwLogDownloadHandler * | handler | ||
) |
Downloads the log data.
board | Board to download the log data from |
n_notifies | How many progress updates to send |
handler | Handler for processing logger responses |
METAWEAR_API uint8_t mbl_mw_logging_get_latest_reset_uid | ( | const MblMwMetaWearBoard * | board | ) |
Get the latest reset_uid read duing connection.
board | Board to get reset_uid from |
METAWEAR_API MblMwDataSignal* mbl_mw_logging_get_length_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Retrieves a data signal representing the length of the log, including timestamps.
board | Board to get reset_uid from |
METAWEAR_API int64_t mbl_mw_logging_get_reference_time | ( | const MblMwMetaWearBoard * | board, |
uint8_t | reset_uid | ||
) |
Get the device boot time for a given reset_uid.
This reference time is automatically calulated at connection time.
board | Board to use |
reset_uid | Reset id |
METAWEAR_API MblMwDataSignal* mbl_mw_logging_get_time_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Retrieves a data signal representing the current logger time state.
This includes the reset_uid and time of boot.
board | Board to get time from |
METAWEAR_API void mbl_mw_logging_raw_download | ( | MblMwMetaWearBoard * | board, |
uint8_t | n_notifies, | ||
const MblMwRawLogDownloadHandler * | handler | ||
) |
Downloads the raw log data.
board | Board to download the log data from |
n_notifies | How many progress updates to send |
handler | Handler for processing logger responses |
METAWEAR_API void mbl_mw_logging_set_reference_time | ( | const MblMwMetaWearBoard * | board, |
uint8_t | reset_uid, | ||
int64_t | reference_epoch | ||
) |
Set the device boot time for a given reset_uid.
This reference time is used to calcuated real timestamps from logged data.
board | Board to use |
reset_uid | Reset id |
reference_epoch | New reference epoch (in milliseconds) to use |
METAWEAR_API void mbl_mw_logging_start | ( | const MblMwMetaWearBoard * | board, |
uint8_t | overwrite | ||
) |
Starts data logging.
board | Board to log data on |
overwrite | Non-zero if older entries will be overwritten |
METAWEAR_API void mbl_mw_logging_stop | ( | const MblMwMetaWearBoard * | board | ) |
Stops data logging.
board | Board to stop logging |