Skip to content

C constants and types

Common Device constants, status values, callbacks, and storage descriptors.

CORELIB_VERSION_MAJOR

c
#define CORELIB_VERSION_MAJOR 1u

Corelib semantic major version.

CORELIB_VERSION_MINOR

c
#define CORELIB_VERSION_MINOR 0u

Corelib semantic minor version.

CORELIB_VERSION_PATCH

c
#define CORELIB_VERSION_PATCH 0u

Corelib semantic patch version.

CORELIB_PFP_VERSION

c
#define CORELIB_PFP_VERSION 1u

Supported PFP version.

CORELIB_TRANSACTION_VERSION

c
#define CORELIB_TRANSACTION_VERSION 2u

Supported Transaction Protocol version.

CORELIB_FRAME_SIZE

c
#define CORELIB_FRAME_SIZE 64u

Complete encoded PFP frame bytes.

CORELIB_FRAME_PAYLOAD_SIZE

c
#define CORELIB_FRAME_PAYLOAD_SIZE 40u

PFP payload bytes per frame.

CORELIB_MAX_MESSAGE_SIZE

c
#define CORELIB_MAX_MESSAGE_SIZE 10200u

Protocol maximum complete message bytes.

CORELIB_MIN_TRANSACTION_DATA_SIZE

c
#define CORELIB_MIN_TRANSACTION_DATA_SIZE 64u

Minimum supported opaque transaction payload bytes.

CORELIB_CAPABILITY_GATEWAY

c
#define CORELIB_CAPABILITY_GATEWAY 0x00000001u

Capability bit identifying a gateway node.

CORELIB_CONTEXT_STORAGE_SIZE

c
#define CORELIB_CONTEXT_STORAGE_SIZE 2048u

Conservative portable storage bytes for an endpoint context.

CORELIB_PENDING_REQUEST_STORAGE_SIZE

c
#define CORELIB_PENDING_REQUEST_STORAGE_SIZE 64u

Conservative storage bytes for one pending request.

corelib_status_t

c
typedef enum { ... } corelib_status_t;

Result of a Corelib operation.

Values: CORELIB_OK, CORELIB_INVALID_ARGUMENT, CORELIB_INVALID_STATE, CORELIB_INVALID_FRAME, CORELIB_UNSUPPORTED, CORELIB_CAPACITY_EXCEEDED, CORELIB_BUSY, CORELIB_NOT_FOUND, CORELIB_EXPIRED, CORELIB_REENTRANT.

corelib_send_result_t

c
typedef enum { ... } corelib_send_result_t;

Result returned by the application's non-blocking frame sender.

Values: CORELIB_SEND_ACCEPTED, CORELIB_SEND_BUSY, CORELIB_SEND_FAILED.

corelib_action_t

c
typedef enum { ... } corelib_action_t;

Generic Transaction Protocol operation delivered to the application.

Values: CORELIB_ACTION_COMMON_REQUEST, CORELIB_ACTION_COMMON_PUBLISH, CORELIB_ACTION_COMMON_RESPONSE, CORELIB_ACTION_SHARE_REQUEST, CORELIB_ACTION_SHARE_PUBLISH, CORELIB_ACTION_SHARE_RESPONSE.

corelib_transaction_result_t

c
typedef enum { ... } corelib_transaction_result_t;

Application-level result encoded in a transaction response.

Values: CORELIB_RESULT_SUCCESS, CORELIB_RESULT_UNSUPPORTED, CORELIB_RESULT_BUSY, CORELIB_RESULT_INVALID_REQUEST, CORELIB_RESULT_INTERNAL_ERROR.

corelib_session_state_t

c
typedef enum { ... } corelib_session_state_t;

Current PFP session lifecycle state.

Values: CORELIB_SESSION_INACTIVE, CORELIB_SESSION_ACTIVE, CORELIB_SESSION_STALE.

corelib_diagnostic_t

c
typedef enum { ... } corelib_diagnostic_t;

Diagnostic category reported to the application.

Values: CORELIB_DIAGNOSTIC_INVALID_FRAME, CORELIB_DIAGNOSTIC_INVALID_MESSAGE, CORELIB_DIAGNOSTIC_RESOURCE_LIMIT, CORELIB_DIAGNOSTIC_SEND_FAILED, CORELIB_DIAGNOSTIC_REQUEST_EXPIRED, CORELIB_DIAGNOSTIC_TIME_REVERSED.

corelib_context_t

c
typedef struct corelib_context corelib_context_t;

Opaque state for one independently serialized Corelib endpoint.

c
typedef uint16_t corelib_link_id_t;

Application-defined identifier for a registered physical link.

corelib_send_callback_t

c
typedef corelib_send_result_t(* corelib_send_callback_t) (void *user, corelib_link_id_t link_id, void *transport_context, const uint8_t frame[CORELIB_FRAME_SIZE]);

Attempts to enqueue one complete PFP frame without blocking.

corelib_transaction_callback_t

c
typedef void(* corelib_transaction_callback_t) (void *user, const corelib_transaction_t *transaction);

Delivers one decoded generic transaction with borrowed payload bytes.

corelib_session_callback_t

c
typedef void(* corelib_session_callback_t) (void *user, corelib_session_state_t state, uint32_t session_id, uint16_t local_address);

Reports a local session lifecycle change.

corelib_node_callback_t

c
typedef void(* corelib_node_callback_t) (void *user, const uint8_t node_uuid[16], bool reachable, uint16_t local_address);

Reports local node reachability and address changes.

corelib_diagnostic_callback_t

c
typedef void(* corelib_diagnostic_callback_t) (void *user, corelib_diagnostic_t diagnostic, corelib_status_t status);

Reports a recoverable Corelib diagnostic.

corelib_transaction_id_t

c
typedef struct { ... } corelib_transaction_id_t;

Stable correlation identity for one application transaction.

Fields: token, share_id, action.

corelib_transaction_t

c
typedef struct { ... } corelib_transaction_t;

Borrowed application transaction delivered during a callback.

Fields: id, data, data_size.

corelib_version_t

c
typedef struct { ... } corelib_version_t;

Corelib and supported wire-protocol versions.

Fields: major, minor, patch, pfp_version, transaction_version.

corelib_bootstrap_assignment_t

c
typedef struct { ... } corelib_bootstrap_assignment_t;

Profile-delivered assignment for a node that is not yet PFP-addressable.

Fields: node_uuid, session_id, transaction_id, heartbeat_interval_ms, node_address, parent_address, link_id.

corelib_usage_t

c
typedef struct { ... } corelib_usage_t;

Snapshot of currently occupied endpoint resources.

Fields: active_reassemblies, queued_frames, pending_requests, reassembly_bytes.

corelib_limits_t

c
typedef struct { ... } corelib_limits_t;

Fixed capacities configured for an endpoint context.

Fields: maximum_message_size, maximum_transaction_data_size, reassembly_slots, outbound_frames, pending_requests.

corelib_reassembly_storage_t

c
typedef struct { ... } corelib_reassembly_storage_t;

Caller-owned storage used for fragmented-message reassembly.

Fields: message, received, headers.

corelib_frame_storage_t

c
typedef struct { ... } corelib_frame_storage_t;

Caller-owned queue storage for complete PFP frames.

Fields: frames, capacity.

corelib_entry_storage_t

c
typedef struct { ... } corelib_entry_storage_t;

Generic caller-owned fixed-entry storage description.

Fields: entries, capacity, entry_size.

corelib_storage_t

c
typedef struct { ... } corelib_storage_t;

Complete caller-owned memory configuration for an endpoint.

Fields: reassembly, reassembly_slot_count, maximum_message_size, transaction_scratch, outbound, pending_requests.

corelib_callbacks_t

c
typedef struct { ... } corelib_callbacks_t;

Application callback table invoked synchronously by Corelib operations.

Fields: send_frame, transaction, session_changed, node_changed, diagnostic, user.

corelib_config_t

c
typedef struct { ... } corelib_config_t;

Immutable endpoint configuration copied during initialisation.

Fields: node_uuid, capabilities, heartbeat_interval_ms, application_response_timeout_ms, maximum_transaction_data_size, callbacks, storage.

Released under the MIT Licence.