|
SDK for TESAIoT Dev Kit
API reference & tutorials (ModusToolbox)
|
Functions | |
| void | nus_agent_reset (void) |
| Clear the in-flight ask id and the accumulator; no init, no locking, no return. | |
| void | nus_agent_note_ask (const char *id) |
| Record the in-flight ask id; a NULL or empty id resets the agent. No caller anywhere. | |
| int | nus_agent_handle_token (const char *json, const jsmntok_t *toks, int n_toks) |
| Append a "delta" to the accumulator; -1 on id mismatch (silently dropped). | |
| int | nus_agent_handle_done (const char *json, const jsmntok_t *toks, int n_toks) |
| Forward the final text to the CM55 page over IPC and reset; "text" is authoritative. | |
| int | nus_agent_handle_tool_call (const char *json, const jsmntok_t *toks, int n_toks) |
| Observability only — a short hint-text IPC so the CM55 marquee shows which tool runs. | |
| size_t | nus_agent_buffer_len (void) |
| Bytes buffered for the in-flight ask; a telemetry probe, not a synchronisation primitive. | |
Six functions: the nus_agent_* stream handlers. 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_agent.h (includes vendor/jsmn.h, absent from the dist include set — Header packaging note). Implementation nus_agent.c is archived in libbento_secure.a. Module state is a single in-flight ask owned by one NUS RX task (nus_agent.c:44): token frames whose id does not match the latest ask are silently dropped; the accumulator is bounded at 256 chars and overflow truncates.
| void nus_agent_reset | ( | void | ) |
Clear the in-flight ask id and the accumulator; no init, no locking, no return.
| void nus_agent_note_ask | ( | const char * | id | ) |
Record the in-flight ask id; a NULL or empty id resets the agent. No caller anywhere.
| int nus_agent_handle_token | ( | const char * | json, |
| const jsmntok_t * | toks, | ||
| int | n_toks ) |
Append a "delta" to the accumulator; -1 on id mismatch (silently dropped).
| int nus_agent_handle_done | ( | const char * | json, |
| const jsmntok_t * | toks, | ||
| int | n_toks ) |
Forward the final text to the CM55 page over IPC and reset; "text" is authoritative.
| int nus_agent_handle_tool_call | ( | const char * | json, |
| const jsmntok_t * | toks, | ||
| int | n_toks ) |
Observability only — a short hint-text IPC so the CM55 marquee shows which tool runs.
| size_t nus_agent_buffer_len | ( | void | ) |
Bytes buffered for the in-flight ask; a telemetry probe, not a synchronisation primitive.