|
SDK for TESAIoT Dev Kit
API reference & tutorials (ModusToolbox)
|
Functions | |
| void | nus_protocol_init (void) |
| Internal one-time init — ble_nus_init() does it; never call directly. | |
| void | nus_on_rx_bytes (const uint8_t *buf, size_t len) |
| Feed NUS RX bytes to the framer; newline framed, 4 KB overflow with RESYNC. | |
| void | nus_protocol_tick (uint32_t now_ms) |
| Passive 30 s keepalive watchdog; call at about 10 Hz. No caller anywhere. | |
| void | nus_protocol_send_permission (const char *id, size_t id_len, int decision_approve) |
| Emit the permission frame for a stored prompt id after a human decision. No caller anywhere. | |
| void | nus_protocol_set_link_encrypted (int encrypted) |
| Stack-internal: set from the BTM_ENCRYPTION_STATUS_EVT handler. | |
| int | nus_protocol_get_link_encrypted (void) |
| Read the encrypted-link flag; recovered prototype — bento_secure_undeclared.h. | |
| void | nus_fp_char_begin (const char *json, const jsmntok_t *toks, int n) |
| Folder-push verb char_begin: open the staging folder. Dispatcher-only. | |
| void | nus_fp_file (const char *json, const jsmntok_t *toks, int n) |
| Verb file: start a file inside the staging folder; path validation rejects traversal. | |
| void | nus_fp_chunk (const char *json, const jsmntok_t *toks, int n) |
| Verb chunk: stream the "d" base64 field into LittleFS via the stateful decoder. | |
| void | nus_fp_file_end (const char *json, const jsmntok_t *toks, int n) |
| Verb file_end: flush the decoder carry and close the file. | |
| void | nus_fp_char_end (const char *json, const jsmntok_t *toks, int n) |
| Verb char_end: atomic commit — rename staging to /buddy/<name>/ or delete it. | |
| int | nus_fp_is_active (void) |
| Non-zero between char_begin and char_end; defer heavy side work during a transfer. | |
| int | nus_fp_device_write_bytes (const uint8_t *b, size_t n) |
| The decoder's sink into the open staging file; recovered prototype, not an entry point. | |
| void | nus_b64_init (nus_b64_state_t *s, nus_b64_sink_t sink, void *ctx) |
| Reset a caller-owned decoder state and wire the sink; nothing is buffered whole in RAM. | |
| int | nus_b64_feed (nus_b64_state_t *s, const uint8_t *b64, size_t len) |
| Feed one chunk of base64 text; the state carries a split 4-char quantum across chunks. | |
| int | nus_b64_flush (nus_b64_state_t *s) |
| Flush any trailing carry; call at file_end. | |
Sixteen functions: nus_protocol_* and nus_on_rx_bytes, the folder-push verbs nus_fp_*, and the base64 decoder nus_b64_*. 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_protocol.h, nus_folder_push.h (includes vendor/jsmn.h, absent from the dist include set — Header packaging note), nus_base64.h, and bento_secure_undeclared.h for the two recovered prototypes (nus_protocol_get_link_encrypted, nus_fp_device_write_bytes). Implementation nus_protocol.c / nus_folder_push.c / nus_base64.c is archived in libbento_secure.a. Nearly everything here is the RX pipeline's own plumbing: ble_nus.c feeds bytes into nus_on_rx_bytes(), the protocol layer parses and hands "cmd" frames to nus_commands_dispatch(), and the folder-push verbs are reached only from that dispatcher.
| void nus_protocol_init | ( | void | ) |
Internal one-time init — ble_nus_init() does it; never call directly.
| void nus_on_rx_bytes | ( | const uint8_t * | buf, |
| size_t | len ) |
Feed NUS RX bytes to the framer; newline framed, 4 KB overflow with RESYNC.
| void nus_protocol_tick | ( | uint32_t | now_ms | ) |
Passive 30 s keepalive watchdog; call at about 10 Hz. No caller anywhere.
| void nus_protocol_send_permission | ( | const char * | id, |
| size_t | id_len, | ||
| int | decision_approve ) |
Emit the permission frame for a stored prompt id after a human decision. No caller anywhere.
| void nus_protocol_set_link_encrypted | ( | int | encrypted | ) |
Stack-internal: set from the BTM_ENCRYPTION_STATUS_EVT handler.
|
extern |
Read the encrypted-link flag; recovered prototype — bento_secure_undeclared.h.
| void nus_fp_char_begin | ( | const char * | json, |
| const jsmntok_t * | toks, | ||
| int | n ) |
Folder-push verb char_begin: open the staging folder. Dispatcher-only.
| void nus_fp_file | ( | const char * | json, |
| const jsmntok_t * | toks, | ||
| int | n ) |
Verb file: start a file inside the staging folder; path validation rejects traversal.
| void nus_fp_chunk | ( | const char * | json, |
| const jsmntok_t * | toks, | ||
| int | n ) |
Verb chunk: stream the "d" base64 field into LittleFS via the stateful decoder.
| void nus_fp_file_end | ( | const char * | json, |
| const jsmntok_t * | toks, | ||
| int | n ) |
Verb file_end: flush the decoder carry and close the file.
| void nus_fp_char_end | ( | const char * | json, |
| const jsmntok_t * | toks, | ||
| int | n ) |
Verb char_end: atomic commit — rename staging to /buddy/<name>/ or delete it.
| int nus_fp_is_active | ( | void | ) |
Non-zero between char_begin and char_end; defer heavy side work during a transfer.
|
extern |
The decoder's sink into the open staging file; recovered prototype, not an entry point.
| void nus_b64_init | ( | nus_b64_state_t * | s, |
| nus_b64_sink_t | sink, | ||
| void * | ctx ) |
Reset a caller-owned decoder state and wire the sink; nothing is buffered whole in RAM.
| int nus_b64_feed | ( | nus_b64_state_t * | s, |
| const uint8_t * | b64, | ||
| size_t | len ) |
Feed one chunk of base64 text; the state carries a split 4-char quantum across chunks.
| int nus_b64_flush | ( | nus_b64_state_t * | s | ) |
Flush any trailing carry; call at file_end.