dlsym (Apple platforms / Linux) or JNI (Android). This page documents the symbols your SDK actually calls.
Most apps never touch this layer directly — the SDK wraps it. This page is for: build-error diagnosis, custom integrations (CLIs, embedded hosts), or auditing what the SDK does on your behalf.
When you’d care
You see one of these:- A linker error mentioning
libsynheart_core_runtimeor undefinedsynheart_core_*symbols. - A
dlsym/ JNI error at runtime. - You’re embedding the runtime directly without using the SDK shells.
- You’re writing platform glue code that calls the runtime from a non-mainstream language.
ABI rules
- C calling convention —
extern "C", no name mangling, no exceptions across the boundary. - Handle ownership —
synheart_core_newreturns an opaque*const SynheartCorehandle that the SDK owns and must free withsynheart_core_free. - Strings out of the runtime are heap-allocated
*char(UTF-8, null-terminated). Caller must release withsynheart_core_free_string. ReturningNULLmeans “no value” (not an error — checklast_error_code). - Strings into the runtime are borrowed for the duration of the call. The runtime copies what it needs.
- Structured returns are JSON strings. Lenient JSON parsing on both sides — unknown fields are tolerated.
- Error codes are negative integers; success is
0or a positive value (e.g. queue length). - Thread safety — the runtime is internally synchronised. Any thread can call any function on a handle. Callbacks (HSI, log, stream) fire on a runtime-owned thread; the SDK shell is responsible for re-dispatching to the host’s UI/main thread.
1. Handle and lifecycle
2. Session lifecycle
3. HSI streaming
The runtime emits HSI 1.3 windows on a configurable cadence (default: 60s window, 5s step). Hosts subscribe via callback; the SDK exposes the stream asStream<HSIState> / AnyPublisher<...> / Flow<...>.
4. Sample ingest
The runtime accepts sensor samples through five push functions. Allts_ms parameters are device monotonic milliseconds.
5. Cloud upload
The runtime owns a persistent SQLite upload queue. The SDK observes it; the runtime drains it.
See Cloud Protocol for the wire shape.
6. Consent and capability
See Consent System and Capability System for the model.
7. Sessions and local storage
The runtime owns local persistence (SQLite plus encrypted preference storage on Apple/Android).8. SRM and baselines
The Self-Reference Model maintains longitudinal baselines per subject.9. Sync
10. Account deletion
11. Multi-source priority resolver
When multiple wearables / vendors push the same metric, the runtime de-duplicates via a priority resolver. SDKs configure it so the SDK consumer’s source preferences flow into the runtime gate.12. Stateless score computation
These are stateless utility calls — they don’t read or mutate the handle’s state, just compute a result from the input JSON. The_handle parameter is unused; pass NULL.
13. Apple Health backfill
When a user exportsexport.zip from the iOS Health app, the SDK feeds it back into the runtime via this batch path. Idempotency keys ensure repeated imports don’t duplicate samples.
14. Diagnostics
15. Memory management
Forgetting to call this on returned strings leaks memory. SDK shells handle it automatically; custom integrations must call it themselves.
Symbols this page does not document
The runtime exports more than what’s listed here. Those undocumented symbols are either:- Tracing variants (
*_tracedwith a correlation id parameter) — useful for runtime debugging only. - Vendor event ingestion (
*_vendor_*) — internal to the cloud connector seam. - Internal counters (
frame_count,last_features,last_quality) — diagnostic-only, may change.
Related
- Architecture — how the SDK composes around the FFI.
- Cloud Protocol — what HSI windows look like on the wire.
- HSV Specification — the typed inference output the runtime emits.
- HSI Specification — the public wire format.