13#ifndef CDC_BADGE_HOST_API_H
14#define CDC_BADGE_HOST_API_H
28#define HOST_API_LEVEL_MAJOR 0
29#define HOST_API_LEVEL_MINOR 8
30#define HOST_API_LEVEL_STR "0.8"
31#define HOST_API_LEVEL_PACKED (((uint32_t)HOST_API_LEVEL_MAJOR << 16) | HOST_API_LEVEL_MINOR)
38#define HOST_ERR_GENERIC -1
39#define HOST_ERR_INVALID_ARG -2
40#define HOST_ERR_NO_CAPABILITY -3
41#define HOST_ERR_NOT_FOUND -4
42#define HOST_ERR_TIMEOUT -5
43#define HOST_ERR_NO_MEMORY -6
44#define HOST_ERR_BUSY -7
45#define HOST_ERR_NOT_SUPPORTED -8
46#define HOST_ERR_RMEM_FULL -9
58#define LOG_LEVEL_ERROR 0
59#define LOG_LEVEL_WARN 1
60#define LOG_LEVEL_INFO 2
61#define LOG_LEVEL_DEBUG 3
62#define LOG_LEVEL_VERBOSE 4
65void host_log (uint8_t level,
const char* tag,
const char* msg);
68void host_log_hex(
const char* tag,
const char* label,
const uint8_t* data,
size_t len);
115#define POWER_SRC_UNKNOWN 0
116#define POWER_SRC_BATTERY 1
117#define POWER_SRC_USB 2
119#define CHARGE_NOT_CHARGING 0
120#define CHARGE_PRE_CHARGE 1
123#define CHARGE_FAULT 4
171int host_sha256 (
const uint8_t* data,
size_t len, uint8_t out[32]);
175 const uint8_t* data,
size_t dlen, uint8_t out[32]);
187 const uint8_t* aad,
size_t aad_len,
188 const uint8_t* pt,
size_t pt_len,
189 uint8_t* ct, uint8_t tag[16]);
201 const uint8_t* aad,
size_t aad_len,
202 const uint8_t* ct,
size_t ct_len,
203 const uint8_t tag[16], uint8_t* pt);
218int host_hex_encode (
const uint8_t* in,
size_t in_len,
char* out,
size_t out_size);
221int host_hex_decode (
const char* in,
size_t in_len, uint8_t* out,
size_t out_size);
236#define ECC_CURVE_P256 0
237#define ECC_CURVE_ED25519 1
249#define HOST_RMEM_NAME_MAX 15
281#define HOST_ECC_NAME_MAX 15
338int host_http_open (uint8_t method,
const char* url, uint32_t timeout_ms);
380#define HOST_SOCK_TCP 0
381#define HOST_SOCK_UDP 1
391int host_socket_open(uint8_t proto,
const char* host, uint16_t port, uint32_t timeout_ms);
397int host_socket_write(
int handle,
const uint8_t* data,
size_t len, uint32_t timeout_ms);
403int host_socket_read(
int handle, uint8_t* out,
size_t cap, uint32_t timeout_ms);
527#define BLE_PROP_READ 0x02
528#define BLE_PROP_WRITE_NO_RSP 0x04
529#define BLE_PROP_WRITE 0x08
530#define BLE_PROP_NOTIFY 0x10
531#define BLE_PROP_INDICATE 0x20
643int host_ble_discover (uint32_t conn,
const uint8_t uuid[16], uint32_t action_id);
665 const uint8_t* data,
size_t len, uint8_t with_response);
832#define UI_ICON_NONE 0
833#define UI_ICON_SUCCESS 2
834#define UI_ICON_ERROR 1
835#define UI_ICON_HEART 3
836#define UI_ICON_DIAMOND 4
837#define UI_ICON_CLUB 5
838#define UI_ICON_SPADE 6
839#define UI_ICON_BULLET 7
840#define UI_ICON_INVERSE_BULLET 8
841#define UI_ICON_CIRCLE 9
842#define UI_ICON_INVERSE_CIRCLE 0x0A
843#define UI_ICON_MALE 0x0B
844#define UI_ICON_FEMALE 0x0C
845#define UI_ICON_MUSIC 0x0D
846#define UI_ICON_NOTES 0x0E
847#define UI_ICON_SUN 0x0F
848#define UI_ICON_PLAY 0x10
849#define UI_ICON_REVERSE_PLAY 0x11
850#define UI_ICON_UPDOWN 0x12
851#define UI_ICON_ALERT 0x13
852#define UI_ICON_PARAGRAPH 0x14
853#define UI_ICON_SECTION 0x15
854#define UI_ICON_BAR 0x16
855#define UI_ICON_UPDOWN_BAR 0x17
856#define UI_ICON_ARROW_UP 0x18
857#define UI_ICON_ARROW_DOWN 0x19
858#define UI_ICON_ARROW_RIGHT 0x1A
859#define UI_ICON_ARROW_LEFT 0x1B
860#define UI_ICON_ANGLE 0x1C
861#define UI_ICON_LEFTRIGHT 0x1D
862#define UI_ICON_TRIANGLE_UP 0x1E
863#define UI_ICON_TRIANGLE_DOWN 0x1F
867#define UI_ICON_INFO UI_ICON_CIRCLE
868#define UI_ICON_TASK UI_ICON_PLAY
869#define UI_ICON_REMOVE UI_ICON_INVERSE_BULLET
870#define UI_ICON_LIGHT UI_ICON_SUN
871#define UI_ICON_COVER UI_ICON_UPDOWN
872#define UI_ICON_SENSOR UI_ICON_BAR
873#define UI_ICON_SWITCH UI_ICON_PLAY
874#define UI_ICON_SCENE UI_ICON_NOTES
875#define UI_ICON_BACK UI_ICON_REVERSE_PLAY
925 uint32_t select_action_id);
936 uint16_t max_len, uint32_t action_id);
945 uint16_t max_len, uint32_t action_id);
961 int32_t step,
const char* unit, uint32_t action_id);
980int host_ui_push_time (
const char* title, uint8_t h, uint8_t m, uint32_t action_id);
990 uint32_t select_action_id, uint32_t menu_action_id);
998 uint32_t select_action_id, uint32_t menu_action_id);
1100#define CANVAS_WIDGET_CHANGED 1
1101#define CANVAS_WIDGET_COMMITTED 2
1102#define CANVAS_WIDGET_CANCELLED 3
1112 uint32_t widget_action_id);
1124#define HOST_CANVAS_CLEAR_KEEP_SPRITES 0x01
1145#define HOST_FONT_BUILTIN 0
1146#define HOST_FONT_BOLD_9PT 1
1147#define HOST_FONT_BOLD_12PT 2
1148#define HOST_FONT_BOLD_18PT 3
1149#define HOST_FONT_BOLD_24PT 4
1150#define HOST_FONT_COUNT 5
1182 const uint8_t* candidates, uint32_t count,
1183 uint8_t* out_font_id);
1207 const char* text, uint8_t align);
1223 int16_t x2, int16_t y2,
bool filled);
1227 int16_t r,
bool filled);
1239 const uint8_t* data, uint32_t len);
1345 uint16_t* w, uint16_t* h);
1348#define HOST_CANVAS_ANIM_REFRESH_AUTO 0
1350#define HOST_CANVAS_ANIM_REFRESH_LIGHT 1
1409 const char* text, uint16_t step_px,
1414 int32_t initial, int32_t step);
1478#define HOST_ANIM_MAX 16
1480#define HOST_ANIM_REPEAT_FOREVER 0xFFFF
1483#define HOST_EASE_LINEAR 0
1484#define HOST_EASE_QUAD_IN 1
1485#define HOST_EASE_QUAD_OUT 2
1486#define HOST_EASE_QUAD_IN_OUT 3
1487#define HOST_EASE_CUBIC_IN 4
1488#define HOST_EASE_CUBIC_OUT 5
1489#define HOST_EASE_CUBIC_IN_OUT 6
1490#define HOST_EASE_OVERSHOOT 7
1491#define HOST_EASE_BOUNCE 8
1492#define HOST_EASE_STEP 9
1493#define HOST_EASE_ELASTIC 10
1496#define HOST_ANIM_FLAG_FROM_CURRENT 0x01
1498#define HOST_ANIM_FLAG_YOYO 0x02
1499#define HOST_ANIM_FLAG_HIDE_DONE 0x04
1500#define HOST_ANIM_FLAG_SHOW_START 0x08
1542#define HOST_ANIM_STATE_DELAYED 0
1543#define HOST_ANIM_STATE_RUNNING 1
1544#define HOST_ANIM_STATE_PAUSED 2
1565int host_anim_blink(uint32_t elem_id, uint16_t period_ms, uint16_t count,
1566 uint32_t done_action_id);
1634#define HOST_LANG_EN 0
1635#define HOST_LANG_DE 1
1669#define EVENT_KEY_PRESSED (1u << 0)
1670#define EVENT_KEY_RELEASED (1u << 1)
1671#define EVENT_KEY_LONG_PRESS (1u << 2)
1672#define EVENT_POWER_USB_CONN (1u << 3)
1673#define EVENT_POWER_USB_DISCONN (1u << 4)
1674#define EVENT_POWER_CHARGING (1u << 5)
1675#define EVENT_POWER_BATT_LOW (1u << 6)
1676#define EVENT_POWER_BATT_CRIT (1u << 7)
1677#define EVENT_SYSTEM_UNLOCK (1u << 8)
1678#define EVENT_SYSTEM_LOCK (1u << 9)
1679#define EVENT_SYSTEM_SLEEP (1u << 10)
1680#define EVENT_SYSTEM_WAKE (1u << 11)
1681#define EVENT_BLE_CONNECTED (1u << 12)
1682#define EVENT_BLE_DISCONNECTED (1u << 13)
1683#define EVENT_TIMER_TICK (1u << 14)
1684#define EVENT_MODULE_EVENT (1u << 15)
1688#define EVENT_DISPLAY_REFRESH (1u << 16)
1814#define HOST_MSG_PAYLOAD_MAX 4096
1816#define HOST_MSG_MIME_MAX 64
1827#define HOST_MSG_FLAG_PERSIST 0x01
1861int host_msg_consume(uint8_t* buf,
size_t buf_size,
char* mime_out,
size_t mime_size);
1892int host_msg_send(
const uint8_t addr[6], uint8_t addr_type,
const char* mime_type,
1893 const uint8_t* data,
size_t len, uint32_t
flags);
1923#define HOST_EXT_FEATURE_NAME_MAX 33
1925#define HOST_EXT_FEATURE_PAYLOAD_MAX 32768
1927#define HOST_EXT_FEATURE_STATUS_DONE 0
1929#define HOST_EXT_FEATURE_STATUS_ERROR 1
1958 uint32_t status_action_id);
1986 char* feature_out,
size_t feature_size);
2014#define HOST_VCARD_MAX_LEN 768
2101int host_qr_measure(
const char* data, uint8_t max_version, uint8_t ecc,
2102 uint16_t* out_modules);
2122 uint8_t scale, uint8_t quiet_modules,
2123 uint8_t* out,
size_t out_size,
2124 uint16_t* out_stride_bytes, uint16_t* out_height_px);
2147int host_image_info(
const uint8_t* data,
size_t len, uint16_t* out_w, uint16_t* out_h);
2162 uint8_t* out,
size_t out_size,
2163 uint16_t* out_stride_bytes, uint16_t* out_height_px);
2185#define HOST_SURFACE_MAX_PER_PLUGIN 2
2187#define HOST_SURFACE_MAX_BYTES 65536
2224 const char* text, uint8_t align);
2232 uint16_t* out_w, uint16_t* out_h);
2250 int16_t x1, int16_t y1, int16_t x2, int16_t y2,
2255 int16_t w, int16_t h, int16_t r, uint8_t filled);
2268 int16_t w, int16_t h,
const uint8_t* data, uint32_t len);
2277 uint16_t* out_stride_bytes);
2288 uint8_t* out,
size_t out_size, uint32_t* out_len);
2328#define HOST_SPRITE_MAX_PER_CANVAS 8
2330#define HOST_SPRITE_MAX_FRAMES 32
2332#define HOST_SPRITE_ARENA_BYTES 65536
2335#define HOST_SPRITE_ONCE 0
2336#define HOST_SPRITE_LOOP 1
2337#define HOST_SPRITE_PING_PONG 2
2340#define HOST_SPRITE_FLAG_OPAQUE 0x01
2341#define HOST_SPRITE_FLAG_FLIP_H 0x02
2342#define HOST_SPRITE_FLAG_FLIP_V 0x04
2343#define HOST_SPRITE_FLAG_ROT_90 0x08
2360 const uint8_t* frames, uint32_t len);
2373 uint16_t frame_h, uint16_t frame_count);
2395 uint16_t target_w, uint16_t frame_h);
2438 uint16_t repeat, uint32_t done_action_id);
2467#define HOST_STR_TARGET_CP437 0
2468#define HOST_STR_TARGET_LATIN1 1
2505#define GPIO_DIR_IN 0
2506#define GPIO_DIR_OUT 1
2507#define GPIO_DIR_OUT_OD 2
2509#define GPIO_PULL_NONE 0
2510#define GPIO_PULL_UP 1
2511#define GPIO_PULL_DOWN 2
2545int host_adc_read (uint8_t pin, uint16_t* raw, uint16_t* millivolt);
2548int host_i2c_write (uint8_t bus, uint8_t addr,
const uint8_t* data,
size_t len);
2551int host_i2c_read (uint8_t bus, uint8_t addr, uint8_t* data,
size_t len);
2555 const uint8_t* wr,
size_t wr_len,
2556 uint8_t* rd,
size_t rd_len);
2562int host_i2c_scan (uint8_t bus, uint8_t* found_addrs,
size_t* count);
2583#define PIXEL_FORMAT_GRB 0
2584#define PIXEL_FORMAT_RGB 1
2585#define PIXEL_FORMAT_GRBW 2
2586#define PIXEL_FORMAT_RGBW 3
char name[cdc::hal::ISecureElement::RMEM_NAME_LEN]
int host_ble_consume_write(uint32_t char_handle, uint8_t *buf, size_t buf_size)
Pull the next queued inbound write for char_handle.
int host_ble_scan_start(uint32_t duration_ms)
Start a central scan for duration_ms milliseconds.
int host_ble_connect(const uint8_t addr[6], uint8_t addr_type)
Connect to a peer. Completion arrives as a BLE_CONNECTED event; read the resulting handle with host_b...
int host_ble_subscribe(uint32_t conn, uint16_t cccd_handle, uint32_t action_id)
Subscribe to notifications on a peer characteristic (by CCCD handle). Each notification fires action_...
int host_ble_send_notification(uint32_t char_handle, const uint8_t *data, size_t len)
Notify subscribers of a value on one of the plugin's characteristics.
int host_ble_discover(uint32_t conn, const uint8_t uuid[16], uint32_t action_id)
Discover the characteristics of one service on a connected peer. Completion fires action_id; read ent...
bool host_ble_scan_done(void)
True when the scan started by host_ble_scan_start() has finished.
int host_ble_read_char(uint32_t conn, uint16_t value_handle, uint32_t action_id)
Start reading a peer characteristic by value handle. Completion fires action_id; read the value with ...
int host_ble_disconnect(uint32_t conn)
Disconnect a connection.
uint16_t host_ble_get_mtu(uint32_t conn)
Usable ATT payload of the current connection (negotiated MTU - 3).
int host_ble_device_name(char *out, size_t out_size)
Copy the local BLE device name into out.
int8_t host_ble_rssi(void)
Signal strength of the active BLE link in dBm, or 0 when idle.
int host_ble_unregister_service(uint32_t service_handle)
Tear down the plugin's registered GATT service.
int host_ble_scan_results(ble_scan_result_t *out, size_t *count)
Read results from the last central scan.
int host_ble_on_write_complete(uint32_t action_id)
Register an action fired on every completed central write.
int host_ble_send_indication(uint32_t char_handle, const uint8_t *data, size_t len)
Indicate (acknowledged notify) a value on a plugin characteristic.
bool host_ble_is_enabled(void)
True when the BLE stack is initialised and advertising or connectable.
int host_ble_consume_notification(uint16_t *value_handle_out, uint8_t *buf, size_t buf_size)
Pull the next queued inbound notification.
int host_ble_subscribe_char(uint32_t conn, uint16_t value_handle, uint32_t action_id)
Subscribe to notifications on a peer characteristic by VALUE handle.
int host_ble_register_service(ble_service_def_t *def, ble_char_def_t *chars, uint32_t num_chars)
Register the plugin's GATT service and its characteristics.
int host_ble_write_char(uint32_t conn, uint16_t value_handle, const uint8_t *data, size_t len, uint8_t with_response)
Write a value to a peer characteristic by value handle.
int host_ble_consume_discovery(ble_remote_char_t *out, size_t *count)
Pull discovered characteristics after a discovery action fires.
int host_ble_mac(uint8_t out[6])
Read the local BLE MAC address.
int host_ble_consume_read(uint8_t *buf, size_t buf_size)
Pull the value delivered by the last read action.
uint32_t host_ble_conn_handle(void)
Current connection handle (central or peripheral), or 0 when idle.
int host_anim_pause(uint32_t handle, bool paused)
Pause (paused != 0) or resume a tween; delay time freezes too.
int host_anim_blink(uint32_t elem_id, uint16_t period_ms, uint16_t count, uint32_t done_action_id)
Convenience: blink an element.
int host_anim_active_count(void)
Number of live tweens plus playing sprites (>= 0).
int host_anim_start(const host_anim_t *cfg)
Start (or queue, when start_after != 0) a tween on an element.
int host_anim_cancel(uint32_t handle)
Cancel a tween and its chained successors; handle 0 cancels all of the canvas's tweens....
int host_anim_state(uint32_t handle)
Query a tween's state.
int host_cmd_consume(char *out, size_t out_size)
Copy the pending command string into out, clearing it.
int host_hex_encode(const uint8_t *in, size_t in_len, char *out, size_t out_size)
Lowercase-hex-encode in into NUL-terminated out.
int host_random_strict(uint8_t *buf, size_t len)
Fill buf with hardware-RNG bytes only; fails without TRNG.
int host_base64_decode(const char *in, size_t in_len, uint8_t *out, size_t out_size)
Base64-decode in into raw bytes in out.
int host_base32_encode(const uint8_t *in, size_t in_len, char *out, size_t out_size)
Base32-encode in into NUL-terminated out.
int host_random(uint8_t *buf, size_t len)
Fill buf with hardware-RNG bytes; may fall back to PRNG.
int host_aes_gcm_decrypt(const uint8_t *key, const uint8_t *iv, const uint8_t *aad, size_t aad_len, const uint8_t *ct, size_t ct_len, const uint8_t tag[16], uint8_t *pt)
AES-256-GCM decrypt and verify.
int host_base64_encode(const uint8_t *in, size_t in_len, char *out, size_t out_size)
Base64-encode in into NUL-terminated out.
int host_aes_gcm_encrypt(const uint8_t *key, const uint8_t *iv, const uint8_t *aad, size_t aad_len, const uint8_t *pt, size_t pt_len, uint8_t *ct, uint8_t tag[16])
AES-256-GCM encrypt.
int host_sha256(const uint8_t *data, size_t len, uint8_t out[32])
SHA-256 hash of data into the 32-byte out.
int host_hmac_sha256(const uint8_t *key, size_t klen, const uint8_t *data, size_t dlen, uint8_t out[32])
HMAC-SHA-256 of data under key into the 32-byte out.
int host_base32_decode(const char *in, size_t in_len, uint8_t *out, size_t out_size)
Base32-decode in into raw bytes in out.
int host_hex_decode(const char *in, size_t in_len, uint8_t *out, size_t out_size)
Hex-decode in (case-insensitive) into raw bytes in out.
int host_event_publish(uint32_t module_event_subtype, uint32_t value)
Publish an EVENT_MODULE_EVENT carrying subtype and value.
int host_event_unsubscribe(uint32_t subscription_id)
Cancel a subscription returned by host_event_subscribe.
int host_event_subscribe(uint32_t event_mask, uint32_t action_id)
Subscribe to one or more events.
int host_ext_feature_register_handler(const char *feature, uint32_t action_id)
Register this plugin as the live handler for a feature it provides.
int host_ext_feature_result(int32_t status_code)
Report the outcome of the job this provider is currently handling.
int host_ext_feature_use(const char *feature, const uint8_t *data, size_t len, uint32_t status_action_id)
Invoke feature with a payload; the provider runs in the foreground.
int host_ext_feature_consume(uint8_t *buf, size_t buf_size, char *feature_out, size_t feature_size)
Pull the payload of the job that fired the current handler action.
int host_ext_feature_available(const char *feature)
Check whether an installed plugin provides feature.
int host_i2c_write(uint8_t bus, uint8_t addr, const uint8_t *data, size_t len)
I2C write transaction.
int host_adc_read(uint8_t pin, uint16_t *raw, uint16_t *millivolt)
Single-shot ADC read.
int host_i2c_scan(uint8_t bus, uint8_t *found_addrs, size_t *count)
Scan the I2C bus for responding addresses.
int host_gpio_write(uint8_t pin, bool level)
Drive a digital output high/low.
int host_gpio_set_direction(uint8_t pin, uint8_t direction)
Configure pin direction (one of GPIO_DIR_*).
int host_gpio_set_pull(uint8_t pin, uint8_t pull)
Configure internal pull resistor (one of GPIO_PULL_*).
int host_sao_eeprom_write(uint16_t offset, const uint8_t *buf, size_t len)
Write to the SAO addon EEPROM at byte offset.
int host_gpio_pwm_start(uint8_t pin, uint32_t freq_hz, uint16_t duty_per_mille)
Start LEDC PWM on pin.
int host_gpio_read(uint8_t pin, bool *level)
Sample a digital input.
int host_i2c_write_read(uint8_t bus, uint8_t addr, const uint8_t *wr, size_t wr_len, uint8_t *rd, size_t rd_len)
I2C write-then-read transaction with repeated start.
int host_gpio_pwm_set_duty(uint8_t pin, uint16_t duty_per_mille)
Update PWM duty without restarting the timer.
int host_gpio_release(uint8_t pin)
Release the pin claim so other plugins can use it.
int host_gpio_pwm_stop(uint8_t pin)
Stop PWM and release the LEDC channel.
int host_sao_eeprom_read(uint16_t offset, uint8_t *buf, size_t len)
Read from the SAO addon EEPROM at byte offset.
int host_i2c_read(uint8_t bus, uint8_t addr, uint8_t *data, size_t len)
I2C read transaction.
int host_http_close(int handle)
Release a request handle.
int host_http_read_chunk(int handle, uint8_t *buf, size_t buf_size, size_t *out_len)
Stream one response chunk into buf.
int host_http_set_body(int handle, const uint8_t *body, size_t len)
Stage a request body before perform().
int host_http_status(int handle)
HTTP response status code, or negative on error.
int host_http_perform(int handle)
Send the request and read response headers.
size_t host_http_content_length(int handle)
Response Content-Length, or 0 when unknown / chunked.
int host_http_set_header(int handle, const char *key, const char *value)
Add a request header before perform().
int host_http_open(uint8_t method, const char *url, uint32_t timeout_ms)
Open an HTTP request.
uint8_t host_i18n_current_language(void)
Active language code (HOST_LANG_*).
int host_i18n_tr_core(const char *key, char *out, uint32_t out_cap)
Translate a core.* key from the firmware string table.
int host_i18n_tr_meta(const char *field, char *out, uint32_t out_cap)
Read a metadata field (name, description, ...) from the plugin manifest.
int host_i18n_tr_key(const char *key, char *out, uint32_t out_cap)
Translate a plugin-local key into the current language.
int host_image_info(const uint8_t *data, size_t len, uint16_t *out_w, uint16_t *out_h)
Decode only the image header to get its dimensions.
int host_image_render(const uint8_t *data, size_t len, uint16_t target_w, uint8_t *out, size_t out_size, uint16_t *out_stride_bytes, uint16_t *out_height_px)
Decode, scale to target_w (aspect preserved) and dither to 1-bpp.
int host_key_consume_next(uint8_t *out_key)
Pop the next queued key press, if any.
bool host_key_pressed(uint8_t key)
True while key is currently held down.
int host_set_resident(bool resident)
Request (true) or drop (false) background residency. Needs the background or autoload capability to h...
int host_lockscreen_alert(const char *text, uint8_t icon, uint32_t action_id)
Raise a persistent Y/N alert over whatever is on screen, lock screen included, that stays until the u...
int host_lockscreen_register_action(const char *label_key, uint32_t action_id)
Publish (or replace) the plugin's lockscreen quick-action.
int host_lockscreen_unregister_action(void)
Remove the plugin's lockscreen quick-action.
void host_log_hex(const char *tag, const char *label, const uint8_t *data, size_t len)
Write a labelled hex dump of a binary buffer at debug level.
void host_log(uint8_t level, const char *tag, const char *msg)
Write a single log line at the given level.
int host_msg_send(const uint8_t addr[6], uint8_t addr_type, const char *mime_type, const uint8_t *data, size_t len, uint32_t flags)
Send a typed payload directly to a known peer address (no picker).
int host_msg_unregister_handler(const char *mime_type)
Drop a previously registered handler.
int host_msg_send_interactive(const char *mime_type, const uint8_t *data, size_t len, uint32_t flags)
Send a typed payload via the firmware-owned interactive peer picker.
int host_msg_consume(uint8_t *buf, size_t buf_size, char *mime_out, size_t mime_size)
Pull the payload delivered by the most recent inbound message action.
int host_msg_register_handler(const char *mime_type, uint32_t action_id)
Register that this plugin handles an incoming MIME type.
int host_net_accept(void)
Take the next accepted connection as a socket handle for host_socket_read/write/close.
int host_net_listen(uint16_t port, uint32_t action_id)
Start a TCP listener on port; fires action_id while clients wait.
int host_net_close(uint16_t port)
Stop the listener (pass 0 or the listening port). Closes pending un-accepted connections.
int host_nvs_list_keys(char *out, size_t *out_len)
Enumerate the keys in the plugin's namespace.
int host_nvs_erase(const char *key)
Delete a single key.
int host_nvs_set_u32(const char *key, uint32_t value)
Write a uint32 value.
int host_nvs_get_blob(const char *key, uint8_t *buf, size_t *len)
Read a binary blob from NVS.
int host_nvs_get_str(const char *key, char *buf, size_t buf_size)
Read a NUL-terminated string.
int host_nvs_get_u32(const char *key, uint32_t *out)
Read a uint32 value.
int host_nvs_erase_all(void)
Erase every key in the plugin's namespace.
int host_nvs_set_blob(const char *key, const uint8_t *buf, size_t len)
Write a binary blob to NVS.
int host_nvs_set_str(const char *key, const char *value)
Write a NUL-terminated string.
int host_pixel_strip_refresh(void)
Push the strip buffer out over the RMT bus.
int host_pixel_strip_clear(void)
Clear every pixel to off (0, 0, 0).
uint16_t host_pixel_strip_length(void)
Number of pixels the strip was initialised with.
int host_pixel_strip_fill(uint8_t r, uint8_t g, uint8_t b)
Fill every pixel with the same RGB colour.
int host_pixel_strip_set(uint16_t index, uint8_t r, uint8_t g, uint8_t b)
Set one pixel's RGB colour in the strip buffer.
int host_pixel_strip_init(uint8_t gpio_pin, uint16_t num_pixels, uint8_t format)
Initialise or reconfigure the global pixel strip.
int host_pixel_strip_deinit(void)
Tear down the global pixel strip.
bool host_pixel_strip_ready(void)
True when the strip has been successfully initialised.
uint8_t host_charge_status(void)
Charger state machine value - one of CHARGE_*.
uint8_t host_power_source(void)
Active power source - one of POWER_SRC_*.
bool host_is_battery_low(void)
True when battery has crossed the low-warning threshold.
bool host_is_battery_critical(void)
True when battery has crossed the critical-shutdown threshold.
void host_set_sleep_inhibit(uint32_t on)
Hold or release a light-sleep inhibitor for the calling plugin. While any inhibitor is held the badge...
bool host_is_usb_connected(void)
True when USB VBUS is detected.
uint16_t host_battery_mv(void)
Battery voltage in millivolts.
uint8_t host_battery_pct(void)
Battery state of charge as 0..100 percent.
int host_qr_render_bitmap(const char *data, uint8_t max_version, uint8_t ecc, uint8_t scale, uint8_t quiet_modules, uint8_t *out, size_t out_size, uint16_t *out_stride_bytes, uint16_t *out_height_px)
Encode data into a packed 1-bpp QR raster.
int host_qr_measure(const char *data, uint8_t max_version, uint8_t ecc, uint16_t *out_modules)
Measure the QR module count for data without rendering.
int host_ecc_delete(const char *name)
Erase the named ECC key and free its pool slot.
int host_se_fw_version(uint8_t *riscv, uint8_t *spect)
Read TROPIC01 firmware versions for the RISC-V CPU and SPECT core.
int host_se_chip_id(uint8_t *serial, size_t *len)
Read the TROPIC01 chip serial / identity blob.
int host_rmem_read_named(const char *name, uint8_t *buf, size_t *len)
Read a named retained-memory slot.
int host_rmem_write_named(const char *name, const uint8_t *buf, size_t len)
Write up to host_rmem_slot_size() bytes into a named rmem slot.
uint16_t host_rmem_slot_size(void)
Maximum payload bytes per rmem slot.
int host_ecc_pubkey(const char *name, uint8_t *pub, uint8_t curve)
Export the public key for the named slot.
int host_ecdsa_sign(const char *name, const uint8_t *msg, size_t len, uint8_t sig[64])
ECDSA-sign msg with the P-256 named key; writes 64-byte raw sig.
bool host_rmem_name_used(const char *name)
True if the named rmem slot currently holds data.
int host_eddsa_sign(const char *name, const uint8_t *msg, size_t len, uint8_t sig[64])
Ed25519-sign msg with the named key; writes 64-byte signature.
int host_rmem_erase_named(const char *name)
Erase the contents of a named rmem slot.
int host_ecc_generate(const char *name, uint8_t curve)
Generate a fresh ECC key for the named slot.
int host_ecc_import(const char *name, const uint8_t *priv, uint8_t curve)
Import an externally-generated private key for the named slot.
bool host_ecc_exists(const char *name)
True when the named ECC key currently holds a key.
int host_socket_read(int handle, uint8_t *out, size_t cap, uint32_t timeout_ms)
Read bytes from the stream / receive a datagram from the connected peer.
int host_socket_close(int handle)
Close a socket handle.
int host_socket_write(int handle, const uint8_t *data, size_t len, uint32_t timeout_ms)
Write bytes to the stream / send a datagram to the connected peer.
int host_socket_open(uint8_t proto, const char *host, uint16_t port, uint32_t timeout_ms)
Open an outbound connection to a single remote endpoint.
int host_sprite_create(uint16_t frame_w, uint16_t frame_h, uint16_t frame_count, const uint8_t *frames, uint32_t len)
Create a sprite from a packed 1-bpp frame sheet in plugin memory.
int host_sprite_set_frame(uint32_t sprite, uint16_t frame)
Jump to a frame. A running playback continues from it.
int host_sprite_play(uint32_t sprite, uint8_t mode, uint16_t frame_ms, uint16_t repeat, uint32_t done_action_id)
Start host-driven playback from frame 0.
int host_sprite_create_from_image(const uint8_t *data, uint32_t len, uint16_t target_w, uint16_t frame_h)
Create a sprite straight from an encoded PNG/JPEG.
int host_sprite_destroy(uint32_t sprite)
Destroy a sprite and reclaim its arena bytes. Recorded draw-sprite commands referencing it are skippe...
int host_sprite_set_frame_durations(uint32_t sprite, const uint16_t *ms, uint16_t count)
Optional per-frame durations in milliseconds.
int host_sprite_set_scale(uint32_t sprite, uint8_t scale)
Integer upscale factor applied whenever the sprite is drawn.
int host_sprite_set_flags(uint32_t sprite, uint8_t flags)
Replace the sprite's flag set (HOST_SPRITE_FLAG_*).
int host_sprite_stop(uint32_t sprite)
Stop playback, keeping the current frame on screen.
int host_sprite_set_mask(uint32_t sprite, const uint8_t *mask, uint32_t len)
Attach a transparency mask plane (same sheet layout and size as the frame data). Mask bit set = pixel...
int host_sprite_create_from_surface(uint32_t surface, uint16_t frame_w, uint16_t frame_h, uint16_t frame_count)
Create a sprite by slicing a surface into a row-major grid of frame_w x frame_h cells.
int host_sprite_get_frame(uint32_t sprite, uint16_t *out)
Read the currently displayed frame index.
int host_str_to_utf8(const char *in, char *out, size_t out_size)
Convert CP437 display bytes in in to a UTF-8 string in out.
int host_str_to_display(const char *in, char *out, size_t out_size, uint32_t target)
Decode HTML entities + UTF-8 in in into single-byte display characters in out.
int host_surface_set_font(uint32_t surface, uint8_t font_id)
Select the font for subsequent text calls (HOST_FONT_* id).
int host_surface_draw_text(uint32_t surface, int16_t x, int16_t y, const char *text)
Draw UTF-8 text with the current font/size at (x, y) baseline-top.
int host_surface_draw_bitmap(uint32_t surface, int16_t x, int16_t y, int16_t w, int16_t h, const uint8_t *data, uint32_t len)
Blit a packed 1-bpp bitmap (MSB-first, set bit = black) at (x, y).
int host_surface_vline(uint32_t surface, int16_t x, int16_t y, int16_t h)
Draw a vertical line of height h.
int host_surface_draw_pixel(uint32_t surface, int16_t x, int16_t y)
Draw a pixel (current shade decides ink: shade > 0 draws black).
int host_surface_draw_sprite(uint32_t surface, int16_t x, int16_t y, uint32_t sprite)
Stamp a sprite's current frame onto a surface at (x, y).
int host_surface_measure_text(uint32_t surface, const char *text, uint16_t *out_w, uint16_t *out_h)
Measure UTF-8 text with the surface's current font/size.
int host_surface_destroy(uint32_t surface)
Destroy a surface and free its memory.
int host_surface_draw_line(uint32_t surface, int16_t x0, int16_t y0, int16_t x1, int16_t y1)
Draw a line.
int host_surface_draw_text_aligned(uint32_t surface, int16_t x, int16_t y, int16_t w, const char *text, uint8_t align)
Draw UTF-8 text aligned within a w-wide box starting at x.
int host_surface_draw_rect(uint32_t surface, int16_t x, int16_t y, int16_t w, int16_t h, uint8_t filled)
Draw a rectangle; filled ones use the current shade.
int host_surface_draw_circle(uint32_t surface, int16_t x, int16_t y, int16_t r, uint8_t filled)
Draw a circle centered at (x, y); filled ones use the current shade.
int host_surface_set_text_color(uint32_t surface, uint8_t inverted)
Draw text white-on-black (inverted != 0) or black-on-white.
int host_surface_draw_triangle(uint32_t surface, int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t filled)
Draw a triangle; filled ones use the current shade.
int host_surface_export(uint32_t surface, uint8_t *out, size_t out_size, uint16_t *out_stride_bytes)
Copy the surface's packed pixel rows into out.
int host_surface_set_shade(uint32_t surface, uint8_t shade)
Set the fill shade for filled shapes: 0 white .. 255 solid black.
int host_surface_clear(uint32_t surface)
Clear a surface to white.
int host_surface_create(uint16_t w, uint16_t h)
Create a w x h surface, cleared to white.
int host_surface_set_text_size(uint32_t surface, uint8_t size)
Set the integer text scale (1..4) for subsequent text calls.
int host_surface_hline(uint32_t surface, int16_t x, int16_t y, int16_t w)
Draw a horizontal line of width w.
int host_surface_draw_round_rect(uint32_t surface, int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint8_t filled)
Draw a rounded rectangle with corner radius r.
int host_surface_export_jpg(uint32_t surface, uint8_t quality, uint8_t *out, size_t out_size, uint32_t *out_len)
Encode the surface as a grayscale JPEG.
int host_get_build_profile(char *out, size_t out_size)
Copy the build profile name (e.g. "release", "debug") into out.
uint8_t host_cpu_load(void)
Aggregate CPU load across all cores as 0..100 percent. Sampled on demand from FreeRTOS run-time stats...
bool host_feature_enabled(uint16_t feature_id)
True when the firmware was built with the given feature id enabled.
int host_get_firmware_version(char *out, size_t out_size)
Copy the firmware semver string into out.
int host_local_time(struct host_tm *out)
Fill out with the current local time broken into fields.
bool host_is_time_set(void)
True when the RTC has been synchronised at least once.
uint64_t host_uptime_ms(void)
Monotonic milliseconds since boot.
int64_t host_unix_time(void)
Current Unix timestamp in seconds, or 0 if RTC not set.
int32_t host_timezone_offset(void)
Configured timezone offset from UTC in seconds.
int host_view_canvas_clear_ex(uint32_t flags)
Clear with options: like host_view_canvas_clear, but HOST_CANVAS_CLEAR_KEEP_SPRITES keeps the sprite ...
int host_view_canvas_get_value(uint32_t widget_id, int32_t *out)
Read the integer value of a slider widget.
int host_view_canvas_elem_show(uint32_t elem_id, bool visible)
Show or hide an element (hidden elements are skipped on replay).
int host_view_canvas_draw_round_rect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, bool filled)
Draw a rounded rectangle outline or filled, corner radius r.
int host_view_canvas_elem_set_offset(uint32_t elem_id, int16_t ox, int16_t oy)
Set an element's replay offset relative to its recorded coordinates.
int host_view_canvas_elem_remove(uint32_t elem_id)
Remove an element and all draw commands recorded under it.
int host_view_canvas_push(const char *title, uint32_t key_action_id, uint32_t widget_action_id)
Push a new canvas view.
int host_view_canvas_get_focus(uint32_t *out)
Read the currently focused widget id, 0 if none.
int host_view_canvas_hline(int16_t x, int16_t y, int16_t w)
Draw a horizontal line.
int host_view_canvas_vline(int16_t x, int16_t y, int16_t h)
Draw a vertical line.
int host_view_canvas_clear(void)
Clear all draw state and widgets. Equals host_view_canvas_clear_ex(0).
int host_view_canvas_draw_rect(int16_t x, int16_t y, int16_t w, int16_t h, bool filled)
Draw a rectangle outline or filled rectangle.
int host_view_canvas_set_ink(bool white)
Draw subsequent shapes in white instead of black.
int host_view_canvas_elem_move(uint32_t elem_id, int16_t dx, int16_t dy)
Shift an element's replay offset by a delta.
int host_view_canvas_elem_begin(uint32_t elem_id)
Start recording draw calls under element elem_id.
int host_view_canvas_set_text_color(bool inverted)
Switch between normal and inverted (white on black) text.
int host_view_canvas_set_font(uint8_t font_id)
Switch the canvas font to one of the canonical HOST_FONT_* ids.
int host_view_canvas_draw_bitmap(int16_t x, int16_t y, int16_t w, int16_t h, const uint8_t *data, uint32_t len)
Draw a 1-bpp bitmap; set bits render black, unset bits are transparent.
int host_view_canvas_add_button(uint32_t widget_id)
Add a focusable button widget bound to widget_id.
int host_view_canvas_draw_pixel(int16_t x, int16_t y)
Draw a single pixel.
int host_view_canvas_draw_circle(int16_t x, int16_t y, int16_t r, bool filled)
Draw a circle outline or filled circle of radius r centred at (x, y).
int host_view_canvas_marquee(int16_t x, int16_t y, int16_t window_w, const char *text, uint16_t step_px, uint16_t frame_ms)
Record a host-driven text marquee (ticker).
int host_view_canvas_set_focus(uint32_t widget_id)
Move keyboard focus to the given widget.
int host_view_canvas_get_text(uint32_t widget_id, char *out, size_t cap)
Read the text of a text-input widget.
int host_view_canvas_set_text_size(uint8_t size)
Set text size multiplier (Adafruit-GFX semantics).
int host_view_canvas_elem_get_offset(uint32_t elem_id, int16_t *ox, int16_t *oy)
Read an element's current replay offset.
int host_view_canvas_set_key_repeat(uint16_t initial_ms, uint16_t repeat_ms)
Configure key auto-repeat timing for the canvas.
int host_view_canvas_elem_get_bounds(uint32_t elem_id, int16_t *x, int16_t *y, uint16_t *w, uint16_t *h)
Bounding box of an element's recorded commands, offset applied.
int host_view_canvas_elem_end(void)
Stop recording draw calls into an element.
int host_view_canvas_draw_text_aligned(int16_t x, int16_t y, int16_t w, const char *text, uint8_t align)
Draw text within a horizontal box.
int host_view_canvas_set_footer(const char *hint)
Override the footer hint of the canvas.
int host_view_canvas_draw_text(int16_t x, int16_t y, const char *text)
Draw text at (x, y) using the current text size/colour.
int host_view_canvas_set_shade(uint8_t shade)
Set the fill ink for subsequent filled shapes (rect, circle, triangle).
int host_view_canvas_remove_widget(uint32_t widget_id)
Remove a widget previously added to the canvas.
int host_text_pick_font_that_fits(const char *text, int16_t max_width_px, const uint8_t *candidates, uint32_t count, uint8_t *out_font_id)
Pick the largest HOST_FONT_* whose rendered text fits within max_width_px. Candidates are evaluated i...
int host_view_canvas_add_text(uint32_t widget_id, uint16_t max_len, const char *initial)
Add a T9 text input widget bound to widget_id.
int host_view_canvas_set_text(uint32_t widget_id, const char *text)
Set the text of a text-input widget.
int host_view_canvas_elem_set_z(uint32_t elem_id, int8_t z)
Set an element's replay layer (z-order).
int host_view_canvas_draw_triangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool filled)
Draw a triangle outline or filled triangle through three points.
int host_view_canvas_set_anim_policy(uint8_t refresh_policy, uint8_t max_fps)
Configure host-driven animation pacing for the current canvas.
int host_view_canvas_set_long_press_action(uint32_t action_id)
Set the action id fired on a canvas long-press.
int host_view_canvas_draw_line(int16_t x0, int16_t y0, int16_t x1, int16_t y1)
Draw a line between two points.
int host_view_canvas_set_value(uint32_t widget_id, int32_t value)
Set the integer value of a slider widget.
int host_view_canvas_get_body_size(uint16_t *w, uint16_t *h)
Read the drawable body region (excluding header/footer).
int host_view_canvas_commit(bool full_refresh)
Flush draw state to the panel.
int host_view_canvas_add_slider(uint32_t widget_id, int32_t min, int32_t max, int32_t initial, int32_t step)
Add an integer slider widget bound to widget_id.
int host_view_canvas_elem_clear(uint32_t elem_id)
Drop only an element's recorded draw commands, keeping the element.
int host_view_canvas_draw_sprite(int16_t x, int16_t y, uint32_t sprite)
Record a draw of a sprite's current frame at (x, y).
int host_display_draw_rect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
Draw a rectangle outline.
bool host_display_is_busy(void)
True while the panel is processing a previous refresh.
int host_display_draw_pixel(int16_t x, int16_t y, uint16_t color)
Set a single pixel.
uint16_t host_display_get_backlight(void)
Current backlight level (0 when no display is available).
int host_display_draw_line(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)
Draw a line between two points.
uint16_t host_display_width(void)
Display width in pixels.
int host_display_set_backlight(uint16_t level)
Set the display backlight level (0 = off .. panel maximum, e.g. 1023). Applied live; NOT persisted to...
int host_display_flush(uint8_t refresh_mode)
Push the framebuffer to the panel using the given refresh mode.
int host_display_fill_rect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
Draw a filled rectangle.
int host_display_draw_text(int16_t x, int16_t y, const char *text, uint8_t size, uint16_t color)
Draw text using the default GFX font.
uint16_t host_display_height(void)
Display height in pixels.
int host_display_clear(void)
Clear the framebuffer to background.
int host_ui_set_inactivity(uint32_t timeout_ms, uint32_t action_id)
Arm an inactivity timer for the plugin's current view.
int host_ui_pop(void)
Pop the topmost view.
int host_ui_set_view_lifecycle(uint32_t hide_action_id, uint32_t show_action_id)
Register hide/show callbacks for the plugin's current top view.
int host_ui_remove_list_item(uint16_t index)
Remove the list row at index (partial redraw).
int host_ui_acquire_exclusive(void)
Claim exclusive UI ownership (block other plugins from pushing views).
int host_ui_push_time(const char *title, uint8_t h, uint8_t m, uint32_t action_id)
Show a time-of-day picker.
int host_ui_repaint(void)
Force a repaint of the current view.
int host_ui_set_view_empty(const char *text)
Override the empty-state text shown by an empty list view.
int host_ui_push_message(const char *text, uint8_t icon, uint32_t duration_ms)
Show a blocking message view that auto-dismisses after duration_ms.
int host_ui_view_markdown(const uint8_t *data, uint32_t len)
Render and show Markdown from an in-memory (UTF-8) buffer. No capability required; the buffer is boun...
int host_ui_push_t9_input(const char *title, const char *initial, uint16_t max_len, uint32_t action_id)
Show a T9-style text entry.
int host_ui_push_date(const char *title, uint8_t d, uint8_t m, uint16_t y, uint32_t action_id)
Show a date picker.
int host_ui_push_info(const char *title, const char *body)
Show a scrollable info screen with title and body.
int host_ui_release_exclusive(void)
Release a previously acquired exclusive UI lock.
int host_ui_consume_input_text(char *out, size_t out_size)
Read text input committed by the most recent input view.
int host_ui_consume_input_int(int32_t *out)
Read integer input committed by the most recent input view.
int host_ui_push_context_menu(const char *title, const ui_item_t *items, uint16_t count, uint32_t select_action_id)
Show a context menu. At most 8 items (ContextMenuView::MAX_ITEMS); the menu is scrollable and shows 4...
int host_ui_push_confirm(const char *text, uint8_t icon, uint32_t action_id)
Show a Y/N confirmation.
int host_ui_push_slider(const char *title, int32_t min, int32_t max, int32_t init, int32_t step, const char *unit, uint32_t action_id)
Show an integer slider.
int host_ui_push_color_picker(uint8_t initial_r, uint8_t initial_g, uint8_t initial_b, uint32_t action_id)
Show an RGB color picker.
int host_ui_push_toast(const char *text, uint8_t icon, uint16_t duration_ms)
Show a transient toast overlay.
int host_ui_insert_list_item(uint16_t index, const ui_item_t *item)
Insert a list row at index (partial redraw).
int host_ui_push_pin_entry(const char *title, uint8_t max_len, uint8_t max_attempts, uint32_t action_id)
Show a numeric PIN entry.
int host_ui_pop_to_plugin(void)
Pop back to the plugin's first view.
int host_ui_push_list(const char *title, const ui_item_t *items, uint16_t count, uint32_t select_action_id, uint32_t menu_action_id)
Show a list view.
int host_ui_push_password(const char *title, const char *initial, uint16_t max_len, uint32_t action_id)
Show a password entry (masked T9).
int host_ui_update_list_item(uint16_t index, const ui_item_t *item)
Update one list row in place (partial redraw).
int host_ui_view_image(const uint8_t *data, uint32_t len)
Decode and show an image (PNG/JPEG) from an in-memory buffer, dithered. No capability required; the b...
int host_ui_wink(uint8_t count, uint16_t period_ms)
Blink the backlight as a visual identification signal.
int host_ui_replace_list(const char *title, const ui_item_t *items, uint16_t count, uint32_t select_action_id, uint32_t menu_action_id)
Replace the plugin's top list view in place; falls back to push when none.
int host_ui_set_view_footer(const char *hint)
Override the footer hint of the plugin's current top view.
int host_browser_open(const char *url)
Open a URL in the badge browser (enters the browser and loads it). No capability required.
int host_usb_cdc_write(const uint8_t *data, size_t len)
Write raw bytes to the USB-CDC TX stream.
int host_vcard_received_count(void)
Number of received vCards in the store.
int host_vcard_received_add(const char *vcard, size_t len)
Store a new received vCard.
int host_vcard_received_display(uint16_t index, char *out, size_t out_size)
Copy the display name of the received vCard at sorted position index into out (for list rows).
int host_vcard_set_own(const char *vcard, size_t len)
Set / replace the badge's own vCard.
int host_vcard_received_update(uint16_t index, const char *vcard, size_t len)
Overwrite the received vCard at sorted position index.
int host_vcard_get_own(char *out, size_t out_size)
Copy the badge's own vCard text into out.
int host_vcard_received_delete(uint16_t index)
Delete the received vCard at sorted position index.
int host_vcard_received_get(uint16_t index, char *out, size_t out_size)
Copy the received vCard at sorted position index into out.
int host_fs_view_markdown(const char *name)
Render and show one of the plugin's own Markdown files in the scrollable text viewer.
int host_fs_view_image(const char *name)
Decode and show one of the plugin's own image files (PNG/JPEG) on the e-paper, dithered and scaled to...
int host_fs_view(const char *name)
Open one of the plugin's own files in a scrollable on-screen text viewer (same as opening the file in...
int host_fs_size(const char *name, size_t *out)
Write the byte size of name to *out.
int host_fs_read(const char *name, uint8_t *buf, size_t *len)
Read name into buf.
int host_fs_remove(const char *name)
Delete name.
int host_fs_write(const char *name, const uint8_t *data, size_t len)
Create or overwrite name with len bytes.
int host_fs_list(char *out, size_t *out_len)
Enumerate the plugin's own files.
bool host_wifi_scan_done(void)
True when the scan started by host_wifi_start_scan has finished.
int host_wifi_scan_results(wifi_scan_result_t *out, size_t *count)
Read results from the last completed scan.
int host_wifi_mac(uint8_t out[6])
Read the station MAC address.
int host_wifi_request(uint32_t timeout_ms)
Request the shared WiFi radio and wait up to timeout_ms for join.
int host_wifi_ip(char *out, size_t out_size)
Copy the current IPv4 address as dotted decimal into out.
bool host_wifi_is_connected(void)
True when WiFi STA is associated and has an IP.
int host_wifi_release(void)
Release the WiFi radio held by this plugin.
int8_t host_wifi_rssi(void)
Current AP signal strength in dBm.
int host_wifi_start_scan(void)
Start an asynchronous WiFi scan.
int host_wifi_ssid(char *out, size_t out_size)
Copy the currently joined SSID into out.
One characteristic of a plugin GATT service (peripheral role).
One characteristic discovered on a connected peer (central role).
One device from a central scan.
A plugin GATT service definition (peripheral role). Always primary.
Tween description for host_anim_start(); zero-init unused fields.