Expand description
AUTO-GENERATED by scripts/gen-abi-bindings.sh (bindgen 0.72.1) — DO NOT EDIT.
Source of truth: packages/platform/nros-platform-api/include/nros/platform*.h (RFC-0054).
Edit the headers, rerun the script, commit both.
Structs§
Constants§
- NROS_
PLATFORM_ CONDVAR_ STORAGE_ SIZE - NROS_
PLATFORM_ MUTEX_ REC_ STORAGE_ SIZE - NROS_
PLATFORM_ MUTEX_ STORAGE_ SIZE - NROS_
PLATFORM_ PARK_ EXPIRED - NROS_
PLATFORM_ PARK_ SIGNALLED - NROS_
PLATFORM_ PARK_ YIELDED - NROS_
PLATFORM_ PRIORITY_ INHERIT - NROS_
PLATFORM_ PRIORITY_ MAX - NROS_
PLATFORM_ PRIORITY_ MIN - NROS_
PLATFORM_ RET_ ERROR - NROS_
PLATFORM_ RET_ INVALID - NROS_
PLATFORM_ RET_ NOMEM - NROS_
PLATFORM_ RET_ OK - NROS_
PLATFORM_ RET_ TIMEOUT - NROS_
PLATFORM_ RET_ UNSUPPORTED - NROS_
PLATFORM_ STORAGE_ ALIGN - NROS_
PLATFORM_ TASK_ DETACHED - NROS_
PLATFORM_ TASK_ STORAGE_ SIZE
Functions§
- nros_
platform_ ⚠alloc - Allocate
sizebytes; returnNULLon failure. May be called from any thread. - nros_
platform_ ⚠clock_ ns - Monotonic nanoseconds since a platform-defined epoch (boot, program start, …). Never decreases. Wraps after ~584 years.
- nros_
platform_ ⚠clock_ resolution_ ns - Granularity of
nros_platform_clock_ns, in nanoseconds: the smallest non-zero difference two successive reads can report. - nros_
platform_ ⚠condvar_ drop - nros_
platform_ ⚠condvar_ init - nros_
platform_ ⚠condvar_ signal - nros_
platform_ ⚠condvar_ signal_ all - nros_
platform_ ⚠condvar_ signal_ from_ isr - Phase 124.B.7.a — ISR-safe signal.
- nros_
platform_ ⚠condvar_ storage_ align - nros_
platform_ ⚠condvar_ storage_ size - nros_
platform_ ⚠condvar_ wait_ until - Atomically release
mand block oncvuntil signalled or until the absolute monotonic deadlineabstime, in MILLISECONDS on thenros_platform_clock_ns()epoch — i.e.clock_ns() / 1000000. The mutex is re-acquired before this returns. Returns 0 when signalled, 1 on timeout and -1 on error, the same codes asnros_platform_wake_wait_ms(issue 1906: FreeRTOS returned -1 on timeout, so a caller could not tell a timeout from a failure). A port rounds the remaining time UP to its tick, so the wait never times out before its deadline. - nros_
platform_ ⚠critical_ section_ acquire - nros_
platform_ ⚠critical_ section_ release - nros_
platform_ ⚠dealloc - Free a previously allocated block.
NULLis a no-op. - nros_
platform_ ⚠epoch_ us - Microseconds since the UNIX EPOCH (1970-01-01T00:00:00Z), or
0when this platform has no wall-clock source. - nros_
platform_ ⚠heap_ total_ bytes - Total managed heap size in bytes (used + free), or
0if unknown. - nros_
platform_ ⚠heap_ used_ bytes - Bytes currently allocated from the platform heap, or
0if the port does not instrument it. Phase 230 / RFC-0034 D7: the true unified figure where the platform owns one kernel heap shared by the C side and the Rust#[global_allocator]. - nros_
platform_ ⚠log_ flush - nros_
platform_ ⚠log_ write - nros_
platform_ ⚠mutex_ drop - nros_
platform_ ⚠mutex_ init - nros_
platform_ ⚠mutex_ lock - nros_
platform_ ⚠mutex_ rec_ drop - nros_
platform_ ⚠mutex_ rec_ init - Initialise a recursive mutex (same-thread re-entry permitted). Required by zenoh-pico.
- nros_
platform_ ⚠mutex_ rec_ lock - nros_
platform_ ⚠mutex_ rec_ storage_ align - nros_
platform_ ⚠mutex_ rec_ storage_ size - nros_
platform_ ⚠mutex_ rec_ try_ lock - nros_
platform_ ⚠mutex_ rec_ unlock - nros_
platform_ ⚠mutex_ storage_ align - nros_
platform_ ⚠mutex_ storage_ size - Opaque-storage sizing for the lock family, matching
wakeandtask. Pure functions, callable before the corresponding_init. - nros_
platform_ ⚠mutex_ try_ lock - nros_
platform_ ⚠mutex_ unlock - nros_
platform_ ⚠network_ poll - Pump the underlying network stack to process pending I/O. No-op on platforms with a kernel-driven socket layer (POSIX, Zephyr, lwIP, NetX Duo). Bare-metal smoltcp targets advance the stack from this entry point.
- nros_
platform_ ⚠panic - nros_
platform_ ⚠random_ fill - Fill
lenbytes atbufwith random data. - nros_
platform_ ⚠random_ u8 - Random
u8. Cryptographically random where the platform has an entropy source; otherwise a seeded PRNG. Must be deterministic within a single test session for reproducibility. - nros_
platform_ ⚠random_ u16 - Random
u16. Seerandom_u8notes. - nros_
platform_ ⚠random_ u32 - Random
u32. Seerandom_u8notes. - nros_
platform_ ⚠random_ u64 - Random
u64. Seerandom_u8notes. - nros_
platform_ ⚠realloc - Resize the block at
ptrtosizebytes. Equivalent to libcrealloc:NULLptr → fresh alloc;0size → free + returnNULL. Preserves contents up tomin(old, new). - nros_
platform_ ⚠register_ log_ writer - nros_
platform_ ⚠sleep_ ms - Sleep at least
msmilliseconds. - nros_
platform_ ⚠sleep_ s - Sleep at least
sseconds. - nros_
platform_ ⚠sleep_ us - Sleep at least
usmicroseconds. Spin if the platform clock has no sub-millisecond timer. - nros_
platform_ ⚠socket_ accept - Accept a pending connection from
sock_inintosock_out. - nros_
platform_ ⚠socket_ close - Socket-layer shutdown + close. Distinct from
nros_platform_tcp_closebecause zenoh-pico’s helper layer exposes both. - nros_
platform_ ⚠socket_ set_ non_ blocking - Switch a socket to non-blocking mode.
- nros_
platform_ ⚠socket_ wait_ event - Wait for socket events on a multi-peer set. Optional on platforms without a poll/select primitive.
- nros_
platform_ ⚠task_ attr_ init - Fill
attrwith the defaults — equivalent to passingNULLtotask_init. - nros_
platform_ ⚠task_ cancel - Request
taskto terminate at the next cancellation point. Cooperative: a task that never reaches a cancel point will not stop. - nros_
platform_ ⚠task_ detach - Mark
taskas detached — its storage is reclaimed on exit without a join. - nros_
platform_ ⚠task_ exit - Terminate the calling task immediately. Does not return.
- nros_
platform_ ⚠task_ free - Free task storage allocated by
task_init. Called aftertask_joinortask_detach + exit. - nros_
platform_ ⚠task_ init - Spawn a new task.
taskis opaque caller-provided storage (size fromnros_platform_task_storage_size);attris anros_platform_task_attr_t *, orNULLfor every default;entryis the task entry point;argis forwarded toentry. - nros_
platform_ ⚠task_ join - Block until
taskexits. Cleans up task storage on success. - nros_
platform_ ⚠task_ stack_ unused_ bytes - Smallest number of bytes ever left unused on the CALLING task’s stack, or
0if this port cannot report it. - nros_
platform_ ⚠task_ stack_ unused_ bytes_ upto - The same query, capped:
min(unused, limit), reading at mostlimitbytes of the stack (phase-436 E5). - nros_
platform_ ⚠task_ storage_ align - nros_
platform_ ⚠task_ storage_ size - Opaque-storage sizing for
task, mirroring the wake primitive’s probes below. Both are pure functions (no global state) and may be called beforenros_platform_task_init. - nros_
platform_ ⚠tcp_ close - Close a TCP socket.
- nros_
platform_ ⚠tcp_ create_ endpoint - Resolve
(address, port)strings into the caller-allocated endpoint storage atep. Both strings are NUL-terminated. - nros_
platform_ ⚠tcp_ free_ endpoint - Release any resources held by the endpoint at
ep. - nros_
platform_ ⚠tcp_ listen - Open a listening TCP socket bound to
endpoint. - nros_
platform_ ⚠tcp_ open - Open a TCP client connection to
endpoint. - nros_
platform_ ⚠tcp_ read - Read up to
lenbytes. Returns bytes received, orNROS_PLATFORM_NET_SOCKET_ERRORon error. - nros_
platform_ ⚠tcp_ read_ exact - Read exactly
lenbytes. Returnslenon success, orNROS_PLATFORM_NET_SOCKET_ERRORon error. - nros_
platform_ ⚠tcp_ send - Send
lenbytes. Returns bytes sent, orNROS_PLATFORM_NET_SOCKET_ERRORon error. - nros_
platform_ ⚠tcp_ set_ rx_ notify - phase-521 W6 (RFC-0113 D4) — install (
notify != NULL) or remove the receive notification on a connected TCP socket: the stack callsnotify(ctx)each time data is queued on it, from the stack’s own context (NetX’s IP thread), sonotifymust only signal. Data already queued at install calls it once before this returns; once a removal returns, the previousnotifyis never called again. A zenoh session in CALLER mode oversockreports this asNROS_RMW_READINESS_NOTIFY. - nros_
platform_ ⚠time_ now_ ns - Wall-clock nanoseconds since the Unix epoch, or
0if the platform has no real-time clock. - nros_
platform_ ⚠timer_ cancel - Cancel a previously-armed timer. Returns:
- nros_
platform_ ⚠timer_ create_ oneshot - Register a one-shot timer that invokes
callback(user_data)once aftertimeout_usmicroseconds. Returns the platform-native handle on success, NULL on failure. - nros_
platform_ ⚠timer_ create_ periodic - Register a periodic timer that invokes
callback(user_data)everyperiod_usmicroseconds. Returns the platform-native handle on success, NULL on failure. - nros_
platform_ ⚠timer_ destroy - Cancel + free the timer. Drains in-flight callback invocations
before returning so
user_datais no longer accessed. Idempotent on already-destroyed handles. - nros_
platform_ ⚠udp_ close - nros_
platform_ ⚠udp_ create_ endpoint - nros_
platform_ ⚠udp_ free_ endpoint - nros_
platform_ ⚠udp_ listen - Bind a UDP socket in listen / server mode. Optional — return -1 on platforms that don’t expose a UDP-server primitive.
- nros_
platform_ ⚠udp_ mcast_ close - nros_
platform_ ⚠udp_ mcast_ listen - nros_
platform_ ⚠udp_ mcast_ open - nros_
platform_ ⚠udp_ mcast_ read - nros_
platform_ ⚠udp_ mcast_ read_ exact - nros_
platform_ ⚠udp_ mcast_ send - nros_
platform_ ⚠udp_ open - nros_
platform_ ⚠udp_ read - nros_
platform_ ⚠udp_ read_ exact - nros_
platform_ ⚠udp_ readiness_ handle - phase-521 W4 (RFC-0113 D4) — the OS handle that becomes readable when a
datagram arrives on
sock: its file descriptor on POSIX and NuttX. An RMW session reports it asNROS_RMW_READINESS_WAITABLE, and the executor parks on it (nros_platform_wake_park_handles_us) instead of blocking inread. Returns -1 where the stack has no such handle (lwIP, NetX, a bare-metal stack); those report readiness as a Notify instead. - nros_
platform_ ⚠udp_ send - Send
lenbytes toendpoint. - nros_
platform_ ⚠udp_ set_ recv_ timeout - Set the recv timeout in milliseconds;
0means block indefinitely. - nros_
platform_ ⚠udp_ set_ rx_ notify - phase-521 W4 (RFC-0113 D4) — install (
notify != NULL) or remove the receive notification onsock: the stack callsnotify(ctx)each time a datagram is queued on it, from the stack’s own context (lwIP’s tcpip thread, NetX’s IP thread), sonotifymust only signal. Data already queued at install calls it once before this returns; once a removal returns, the previousnotifyis never called again. An RMW session oversockreports this asNROS_RMW_READINESS_NOTIFY. - nros_
platform_ ⚠wake_ drop - nros_
platform_ ⚠wake_ init - nros_
platform_ ⚠wake_ park_ granularity_ us - The finest park
nros_platform_wake_park_until_uscan express, in microseconds. An RTOS tick is a coarser limit than the ABI signature and a timespec primitive a finer one, so only the port can answer (issue 1242). - nros_
platform_ ⚠wake_ park_ handles_ us - phase-521 W3 (RFC-0113 D3) — park on the wake object AND on OS handles.
- nros_
platform_ ⚠wake_ park_ until_ us - phase-436 W7 — OPTIONAL microsecond park, the
ParkUntilFna port may install throughnros_cpp_executor_set_park_primitive. - nros_
platform_ ⚠wake_ signal - nros_
platform_ ⚠wake_ signal_ from_ isr - nros_
platform_ ⚠wake_ storage_ align - nros_
platform_ ⚠wake_ storage_ size - Opaque-storage sizing. Both helpers are pure functions (no global
state) and may be called before
nros_platform_wake_init. - nros_
platform_ ⚠wake_ wait_ ms - nros_
platform_ ⚠yield_ now - Voluntarily yield the current task / thread. On bare-metal,
core::hint::spin_loop()is acceptable; on RTOSes use the native cooperative-yield primitive (k_yield,vPortYield,tx_thread_relinquish,sched_yield, …). RTOS yields are not ISR-safe.
Type Aliases§
- nros_
platform_ log_ flush_ fn_ t - nros_
platform_ log_ writer_ fn_ t - nros_
platform_ ret_ t - nros_
platform_ timer_ callback_ t - @file platform_timer.h @brief Canonical C ABI for the nros platform timer surface.