|
SDK for TESAIoT Dev Kit
API reference & tutorials (ModusToolbox)
|
Functions | |
| int | nus_emit_event (const char *json) |
| Send one JSON event frame (no trailing newline — the LF is appended); 0/-1 only. | |
| void | nus_events_push_pending_ack (const char *id) |
| Push a notification id onto the pending-ack FIFO; dedups, evicts oldest when full. | |
| bool | nus_events_drain_pending_ack (const char *id) |
| Remove an id from the FIFO; true if found — the CM55 tap's bento.user.ack path. | |
| size_t | nus_events_pending_ack_count (void) |
| Number of ids in the FIFO; telemetry and host unit tests. No caller anywhere. | |
| void | nus_commands_emit_ack (const char *ack_cmd, size_t ack_cmd_len, const char *ok_true_or_null, const char *error_or_null, int n) |
| Emit a command ack (verb hard-truncated at 32 chars); void — a send failure is invisible. | |
| void | nus_commands_dispatch (const char *json, size_t json_len, const jsmntok_t *toks, int n_toks, const jsmntok_t *t_cmd) |
| Route a top-level "cmd" frame to its handler; internal to the RX path. | |
| void | nus_commands_handle_time_sync (const char *json, const jsmntok_t *toks, int n) |
| Handle the one-shot {"time":[epoch,tz]} frame; no ack is emitted. | |
Seven functions: nus_emit_event, the pending-ack FIFO, and the nus_commands_* dispatch. Compiled only with ENABLE_PAGE_BENTO_BUDDY=1 (default 0, proj_cm33_ns/Makefile:64, :305); rebuild after make getlibs — Flag gate (read first).
Declarations: nus_events.h (nus_emit_event, pending-ack FIFO) and nus_commands.h (nus_commands_*). nus_commands.h includes vendor/jsmn.h, which the dist include set does not carry (Header packaging note); the jsmntok_t parameters are described without relying on it. Implementation nus_events.c / nus_commands.c is archived in libbento_secure.a.
| int nus_emit_event | ( | const char * | json | ) |
Send one JSON event frame (no trailing newline — the LF is appended); 0/-1 only.
| void nus_events_push_pending_ack | ( | const char * | id | ) |
Push a notification id onto the pending-ack FIFO; dedups, evicts oldest when full.
| bool nus_events_drain_pending_ack | ( | const char * | id | ) |
Remove an id from the FIFO; true if found — the CM55 tap's bento.user.ack path.
| size_t nus_events_pending_ack_count | ( | void | ) |
Number of ids in the FIFO; telemetry and host unit tests. No caller anywhere.
| void nus_commands_emit_ack | ( | const char * | ack_cmd, |
| size_t | ack_cmd_len, | ||
| const char * | ok_true_or_null, | ||
| const char * | error_or_null, | ||
| int | n ) |
Emit a command ack (verb hard-truncated at 32 chars); void — a send failure is invisible.
| void nus_commands_dispatch | ( | const char * | json, |
| size_t | json_len, | ||
| const jsmntok_t * | toks, | ||
| int | n_toks, | ||
| const jsmntok_t * | t_cmd ) |
Route a top-level "cmd" frame to its handler; internal to the RX path.
| void nus_commands_handle_time_sync | ( | const char * | json, |
| const jsmntok_t * | toks, | ||
| int | n ) |
Handle the one-shot {"time":[epoch,tz]} frame; no ack is emitted.