How rdkcentral/json-rpc works
JSON HAL is a C library pair for JSON-RPC communication between a manager application and vendor HAL software. The main workflow is client initialization and request/reply over TCP, followed by server-side action dispatch to registered vendor callbacks; a separate event workflow lets vendor software publish notifications to subscribed clients. Shared configuration and message-conversion code supports both libraries, and the server can optionally validate JSON against a loaded schema. The README and sampled excerpts establish the public workflow and socket dispatch; some internal client/server wiring is documented rather than fully visible in the excerpts.
Main entry points: json_hal_client.c Client API · json_hal_server.c Server API · tcp_client.c Client socket · tcp_server.c Server socket
Components 10
HAL Client
- Client API
json_hal_client.c - Client socket
tcp_client.c
HAL Server
- Server API
json_hal_server.c - Server socket
tcp_server.c
Shared Protocol
- Config and messages
json_hal_common.c - RPC fields
json-rpc-common/json_rpc_common.h
Schema Validation
- Schema validator
json-schema-validator-wrapper/json_schema_validator_wrapper.cpp
Other components
- Manager app
- Vendor software
- HAL config
Connections 19
- Manager app → Client API: calls APIs
- Client API → Config and messages: loads config
- Client API → Client socket: starts socket
- Client API → Client socket: sends request
- Client socket → Server socket: exchanges TCP
- Server socket → Server API: dispatches messages
- Server API → Config and messages: parses messages
- Server API → Vendor software: invokes callbacks
- Vendor software → Server API: publishes events
- Server API → Server socket: sends replies
- Server socket → Client socket: returns replies
- Client socket → Client API: delivers messages
- Client API → Manager app: returns reply
- Client API → Manager app: notifies events
- Server API → Schema validator: validates JSON
- HAL config → Config and messages: provides settings
- Config and messages → RPC fields: uses fields
- Client API → RPC fields: formats RPC
- Server API → RPC fields: dispatches RPC