nros rmw-cffi
C vtable for plugging a third-party RMW backend into nros
Loading...
Searching...
No Matches
Macros | Typedefs
rmw_ret.h File Reference

Return-code constants for the nros RMW C vtable. More...

#include <stdint.h>
Include dependency graph for rmw_ret.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NROS_RMW_RET_AMBIGUOUS_BACKEND   -16
 
#define NROS_RMW_RET_BAD_ALLOC   -3
 
#define NROS_RMW_RET_BUFFER_TOO_SMALL   -12
 
#define NROS_RMW_RET_CONNECTION_FAILED   -18
 
#define NROS_RMW_RET_ERROR   -1
 
#define NROS_RMW_RET_INCOMPATIBLE_ABI   -14
 
#define NROS_RMW_RET_INCOMPATIBLE_QOS   -6
 
#define NROS_RMW_RET_INVALID_ARGUMENT   -4
 
#define NROS_RMW_RET_LOAN_NOT_SUPPORTED   -9
 
#define NROS_RMW_RET_MESSAGE_TOO_LARGE   -13
 
#define NROS_RMW_RET_NO_BACKEND   -15
 
#define NROS_RMW_RET_NO_DATA   -10
 
#define NROS_RMW_RET_NODE_NAME_NON_EXISTENT   -8
 
#define NROS_RMW_RET_OK   0
 
#define NROS_RMW_RET_TIMEOUT   -2
 
#define NROS_RMW_RET_TOPIC_NAME_INVALID   -7
 
#define NROS_RMW_RET_UNKNOWN_BACKEND   -17
 
#define NROS_RMW_RET_UNSUPPORTED   -5
 
#define NROS_RMW_RET_WOULD_BLOCK   -11
 

Typedefs

typedef int32_t nros_rmw_ret_t
 

Detailed Description

Return-code constants for the nros RMW C vtable.

Functions in nros_rmw_vtable_t and the public C entry points (nros_rmw_cffi_register, …) report status as a signed 32-bit integer. Zero means success; every error code is negative and named by one of the macros below.

Two return-shape conventions exist:

Pointer-returning calls (open, create_publisher, …) signal failure with NULL; if the caller needs the specific failure cause, it polls the session via the runtime API.

No thread-local error string is exposed by the RMW layer — that pattern requires thread-local heap storage which embedded targets cannot afford. Backends log diagnostic strings at the failure site via the platform's printk-equivalent.

Macro Definition Documentation

◆ NROS_RMW_RET_AMBIGUOUS_BACKEND

#define NROS_RMW_RET_AMBIGUOUS_BACKEND   -16

Phase 128.A.3 — more than one backend is linked into this binary and the caller did not select one. Set NROS_RMW=<name> (env var) to disambiguate, or use the bridge Executor::open_multi API to bind nodes to backends explicitly.

◆ NROS_RMW_RET_BAD_ALLOC

#define NROS_RMW_RET_BAD_ALLOC   -3

Memory allocation failed.

Returned by backends on std / alloc-equipped platforms when heap allocation fails. Bare-metal backends generally do not return this — they preallocate at session-open time.

◆ NROS_RMW_RET_BUFFER_TOO_SMALL

#define NROS_RMW_RET_BUFFER_TOO_SMALL   -12

Buffer supplied by the caller is smaller than the data the backend wants to deliver.

◆ NROS_RMW_RET_CONNECTION_FAILED

#define NROS_RMW_RET_CONNECTION_FAILED   -18

Phase 155.B.3 — backend reached the wire but couldn't establish a session: refused TCP connect, unreachable agent, peer dropped the link mid-handshake. Distinct from NROS_RMW_RET_ERROR so callers (and the C-side nros_support_init / nros_cpp_init log lines) can distinguish "I can't reach the router" from "internal backend invariant tripped". Maps to / from TransportError::ConnectionFailed and Disconnected.

◆ NROS_RMW_RET_ERROR

#define NROS_RMW_RET_ERROR   -1

Generic failure not covered by a more specific code.

◆ NROS_RMW_RET_INCOMPATIBLE_ABI

#define NROS_RMW_RET_INCOMPATIBLE_ABI   -14

Phase 115.A.2 — caller-supplied versioned struct (e.g. nros_transport_ops_t) carries an abi_version the runtime does not understand. The previously installed copy (if any) is left untouched.

◆ NROS_RMW_RET_INCOMPATIBLE_QOS

#define NROS_RMW_RET_INCOMPATIBLE_QOS   -6

Publisher and subscriber QoS profiles do not match in a way the backend cannot reconcile (e.g., reliable publisher vs. best-effort subscriber on a backend that requires strict matching).

◆ NROS_RMW_RET_INVALID_ARGUMENT

#define NROS_RMW_RET_INVALID_ARGUMENT   -4

Caller supplied a NULL pointer, an out-of-range value, or an inconsistent argument combination.

◆ NROS_RMW_RET_LOAN_NOT_SUPPORTED

#define NROS_RMW_RET_LOAN_NOT_SUPPORTED   -9

The backend does not support loaned messages on this entity, or the loan slot is currently in use. Caller may retry, or fall back to the copying path.

◆ NROS_RMW_RET_MESSAGE_TOO_LARGE

#define NROS_RMW_RET_MESSAGE_TOO_LARGE   -13

Incoming message exceeded the backend's static capacity.

◆ NROS_RMW_RET_NO_BACKEND

#define NROS_RMW_RET_NO_BACKEND   -15

Phase 128.A.3 — Executor::open / nros::init could not pick a unique backend because no nros-rmw-* crate (or static lib) is linked into this binary. The walker found zero entries in the .nros_rmw_init section.

◆ NROS_RMW_RET_NO_DATA

#define NROS_RMW_RET_NO_DATA   -10

No data was available on a non-blocking receive. Distinct from NROS_RMW_RET_TIMEOUT: this fires immediately, not after a bounded wait.

◆ NROS_RMW_RET_NODE_NAME_NON_EXISTENT

#define NROS_RMW_RET_NODE_NAME_NON_EXISTENT   -8

A request referenced a node that does not exist in this session.

◆ NROS_RMW_RET_OK

#define NROS_RMW_RET_OK   0

Operation completed successfully.

◆ NROS_RMW_RET_TIMEOUT

#define NROS_RMW_RET_TIMEOUT   -2

Operation deadline elapsed before completion.

◆ NROS_RMW_RET_TOPIC_NAME_INVALID

#define NROS_RMW_RET_TOPIC_NAME_INVALID   -7

Topic, service, or action name failed validation (empty, non-printable bytes, illegal characters).

◆ NROS_RMW_RET_UNKNOWN_BACKEND

#define NROS_RMW_RET_UNKNOWN_BACKEND   -17

Phase 128.A.3 — caller selected a backend by name (env var or Executor::open_multi) but no registered slot matches. The error is recoverable by linking the requested backend or correcting the spelling.

◆ NROS_RMW_RET_UNSUPPORTED

#define NROS_RMW_RET_UNSUPPORTED   -5

The backend does not implement this operation. Optional callbacks return this; the runtime then falls back to a default path.

◆ NROS_RMW_RET_WOULD_BLOCK

#define NROS_RMW_RET_WOULD_BLOCK   -11

Resource (slot, queue, transport buffer) is momentarily unavailable. Caller should retry; never blocks.

Typedef Documentation

◆ nros_rmw_ret_t

typedef int32_t nros_rmw_ret_t

Signed 32-bit status code. Zero on success; negative on error.