Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
|
Algorithm runner API . More...
Data Structures | |
struct | algorithm_runner_common_config |
struct | algorithm_runner_algorithm |
Typedefs | |
typedef void(* | algorithm_run_fn) (const struct zbus_channel *chan, const void *config, void *data) |
Algorithm implementation. | |
Functions | |
void | algorithm_runner_init (void) |
Initialise the algorithm runner. | |
void | algorithm_runner_register (struct algorithm_runner_algorithm *algorithm) |
Register an algorithm with the runner. | |
bool | algorithm_runner_unregister (struct algorithm_runner_algorithm *algorithm) |
Unregister an algorithm from the runner. | |
void | algorithm_runner_tdf_log (const struct algorithm_runner_common_config *config, uint8_t tdf_mask, uint16_t tdf_id, uint8_t tdf_len, uint64_t time, const void *data) |
Log a single TDF as requested by algorithm configuration. | |
Algorithm runner API .
typedef void(* algorithm_run_fn) (const struct zbus_channel *chan, const void *config, void *data) |
#include <infuse/algorithm_runner/runner.h>
Algorithm implementation.
chan | Channel pointer corresponding to zbus_channel in algorithm_runner_common_config. Value is NULL on the very first call to initialise data structures. |
config | Pointer to the constant algorithm configuration |
data | Pointer to the mutable algorithm state |
void algorithm_runner_init | ( | void | ) |
#include <infuse/algorithm_runner/runner.h>
Initialise the algorithm runner.
Can be called multiple times to clear the list of registered algorithms.
void algorithm_runner_register | ( | struct algorithm_runner_algorithm * | algorithm | ) |
#include <infuse/algorithm_runner/runner.h>
Register an algorithm with the runner.
chan == NULL
to provide an opportunity to initialise runtime state.algorithm | Algorithm to register |
void algorithm_runner_tdf_log | ( | const struct algorithm_runner_common_config * | config, |
uint8_t | tdf_mask, | ||
uint16_t | tdf_id, | ||
uint8_t | tdf_len, | ||
uint64_t | time, | ||
const void * | data ) |
#include <infuse/algorithm_runner/runner.h>
Log a single TDF as requested by algorithm configuration.
config | Common algorithm configuration |
tdf_mask | Single TDF mask that corresponds to tdf_id |
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 array |
bool algorithm_runner_unregister | ( | struct algorithm_runner_algorithm * | algorithm | ) |
#include <infuse/algorithm_runner/runner.h>
Unregister an algorithm from the runner.
algorithm | Algorithm to unregister |
true | Algorithm was found and unregistered |
false | Algorithm was not registered with the runner |