|
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 struct algorithm_runner_common_config *common, const void *args, 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 kv_algorithm_logging *logging, 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 struct algorithm_runner_common_config *common, const void *args, void *data) |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/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. |
| common | Pointer to common algorithm config |
| args | Pointer to algorithm specific arguments |
| data | Pointer to the mutable algorithm state |
| void algorithm_runner_init | ( | void | ) |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/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 </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/algorithm_runner/runner.h>
Register an algorithm with the runner.
| algorithm | Algorithm to register |
| void algorithm_runner_tdf_log | ( | const struct kv_algorithm_logging * | logging, |
| uint8_t | tdf_mask, | ||
| uint16_t | tdf_id, | ||
| uint8_t | tdf_len, | ||
| uint64_t | time, | ||
| const void * | data ) |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/algorithm_runner/runner.h>
Log a single TDF as requested by algorithm configuration.
| logging | Algorithm logging 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 </__w/infuse-sdk/infuse-sdk/infuse-sdk/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 |