# kiiplatform/ebisu architecture

> Architecture diagram of the GitHub repository kiiplatform/ebisu, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kiiplatform/ebisu
- Repository: https://github.com/kiiplatform/ebisu

## Overview

Ebisu is an embedded C suite for connecting constrained devices to Kii Cloud. Its primary device workflow uses TIO to upload sensor state and receive MQTT commands, while Kii also exposes cloud storage and device-management APIs. KHC supplies HTTP transport and JKII supplies JSON parsing; applications provide platform socket and task callbacks. The README documents product capabilities, while several internal relationships below are supported only by the SOURCE INDEX; unsampled implementation details are not inferred.

Main entry points: [`kii/include/kii.h`](https://github.com/kiiplatform/ebisu/blob/master/kii/include/kii.h) (Kii client API), [`tio/tio.c`](https://github.com/kiiplatform/ebisu/blob/master/tio/tio.c) (TIO device client), [`kii/kii_ti_impl.c`](https://github.com/kiiplatform/ebisu/blob/master/kii/kii_ti_impl.c) (Thing implementation), [`kii/kii_req_impl.c`](https://github.com/kiiplatform/ebisu/blob/master/kii/kii_req_impl.c) (Request implementation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_device["Device workflows"]
  node_tio["TIO device client<br/>[tio.c]"]
  node_updater["State updater<br/>[tio.h]"]
  node_command["Command parser<br/>[command_parser.c]"]
end

subgraph group_kii["Kii cloud APIs"]
  node_kii_api["Kii client API<br/>[kii.h]"]
  node_kii_object["Object storage<br/>[kii_object.c]"]
  node_kii_thing["Thing onboarding<br/>[kii_thing.c]"]
  node_kii_push["Push subscriptions<br/>[kii_push.c]"]
  node_kii_server["Server code<br/>[kii_server_code.c]"]
  node_kii_mqtt["MQTT task<br/>[kii_mqtt_task.c]"]
  node_kii_ti["Thing implementation<br/>[kii_ti_impl.c]"]
  node_kii_request["Request implementation<br/>[kii_req_impl.c]"]
end

subgraph group_transport["Protocol foundations"]
  node_khc["HTTP client<br/>[khc_state_impl.c]"]
  node_khc_api["HTTP API<br/>[khc.h]"]
  node_jkii["JSON parser<br/>[jkii.c]"]
end

subgraph group_platform["Platform adapters"]
  node_socket["Socket callbacks"]
  node_embedded(("Embedded platform"))
end

node_app(("Device application"))

node_app -->|"uses device client"| node_tio
node_tio -->|"uploads state"| node_updater
node_tio -->|"parses commands"| node_command
node_tio -->|"uses cloud APIs"| node_kii_api
node_kii_api -->|"offers storage"| node_kii_object
node_kii_api -->|"offers onboarding"| node_kii_thing
node_kii_api -->|"offers subscriptions"| node_kii_push
node_kii_api -->|"offers execution"| node_kii_server
node_kii_api -->|"supports MQTT"| node_kii_mqtt
node_kii_ti -->|"uses requests"| node_kii_request
node_kii_ti -->|"uses JSON utilities"| node_jkii
node_kii_request -->|"uses HTTP client"| node_khc_api
node_khc_api -->|"runs HTTP states"| node_khc
node_khc -->|"calls socket callbacks"| node_socket
node_embedded -->|"implements callbacks"| node_socket

click node_tio "https://github.com/kiiplatform/ebisu/blob/master/tio/tio.c"
click node_updater "https://github.com/kiiplatform/ebisu/blob/master/tio/include/tio.h"
click node_command "https://github.com/kiiplatform/ebisu/blob/master/tio/command_parser.c"
click node_kii_api "https://github.com/kiiplatform/ebisu/blob/master/kii/include/kii.h"
click node_kii_object "https://github.com/kiiplatform/ebisu/blob/master/kii/kii_object.c"
click node_kii_thing "https://github.com/kiiplatform/ebisu/blob/master/kii/kii_thing.c"
click node_kii_push "https://github.com/kiiplatform/ebisu/blob/master/kii/kii_push.c"
click node_kii_server "https://github.com/kiiplatform/ebisu/blob/master/kii/kii_server_code.c"
click node_kii_mqtt "https://github.com/kiiplatform/ebisu/blob/master/kii/kii_mqtt_task.c"
click node_kii_ti "https://github.com/kiiplatform/ebisu/blob/master/kii/kii_ti_impl.c"
click node_kii_request "https://github.com/kiiplatform/ebisu/blob/master/kii/kii_req_impl.c"
click node_khc "https://github.com/kiiplatform/ebisu/blob/master/khc/src/khc_state_impl.c"
click node_khc_api "https://github.com/kiiplatform/ebisu/blob/master/khc/include/khc.h"
click node_jkii "https://github.com/kiiplatform/ebisu/blob/master/jkii/src/jkii.c"
click node_socket "https://github.com/kiiplatform/ebisu/blob/master/khc/include/khc_socket_callback.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_tio,node_updater,node_command toneBlue
class node_kii_api,node_kii_object,node_kii_thing,node_kii_push,node_kii_server,node_kii_mqtt,node_kii_ti,node_kii_request toneAmber
class node_khc,node_khc_api,node_jkii toneMint
class node_socket,node_embedded toneRose
class node_app toneIndigo
```

## Components

### Device workflows

- [TIO device client](https://github.com/kiiplatform/ebisu/blob/master/tio/tio.c): `tio/tio.c`
- [State updater](https://github.com/kiiplatform/ebisu/blob/master/tio/include/tio.h): `tio/include/tio.h`
- [Command parser](https://github.com/kiiplatform/ebisu/blob/master/tio/command_parser.c): `tio/command_parser.c`

### Kii cloud APIs

- [Kii client API](https://github.com/kiiplatform/ebisu/blob/master/kii/include/kii.h): `kii/include/kii.h`
- [Object storage](https://github.com/kiiplatform/ebisu/blob/master/kii/kii_object.c): `kii/kii_object.c`
- [Thing onboarding](https://github.com/kiiplatform/ebisu/blob/master/kii/kii_thing.c): `kii/kii_thing.c`
- [Push subscriptions](https://github.com/kiiplatform/ebisu/blob/master/kii/kii_push.c): `kii/kii_push.c`
- [Server code](https://github.com/kiiplatform/ebisu/blob/master/kii/kii_server_code.c): `kii/kii_server_code.c`
- [MQTT task](https://github.com/kiiplatform/ebisu/blob/master/kii/kii_mqtt_task.c): `kii/kii_mqtt_task.c`
- [Thing implementation](https://github.com/kiiplatform/ebisu/blob/master/kii/kii_ti_impl.c): `kii/kii_ti_impl.c`
- [Request implementation](https://github.com/kiiplatform/ebisu/blob/master/kii/kii_req_impl.c): `kii/kii_req_impl.c`

### Protocol foundations

- [HTTP client](https://github.com/kiiplatform/ebisu/blob/master/khc/src/khc_state_impl.c): `khc/src/khc_state_impl.c`
- [HTTP API](https://github.com/kiiplatform/ebisu/blob/master/khc/include/khc.h): `khc/include/khc.h`
- [JSON parser](https://github.com/kiiplatform/ebisu/blob/master/jkii/src/jkii.c): `jkii/src/jkii.c`

### Platform adapters

- [Socket callbacks](https://github.com/kiiplatform/ebisu/blob/master/khc/include/khc_socket_callback.h): `khc/include/khc_socket_callback.h`
- **Embedded platform**

### Other components

- **Device application**

## Connections

- Device application → TIO device client: uses device client (evidence: `README.md`)
- TIO device client → State updater: uploads state (evidence: `README.md`)
- TIO device client → Command parser: parses commands
- TIO device client → Kii client API: uses cloud APIs (evidence: `README.md`)
- Kii client API → Object storage: offers storage (evidence: `README.md`)
- Kii client API → Thing onboarding: offers onboarding (evidence: `kii/include/kii.h`)
- Kii client API → Push subscriptions: offers subscriptions (evidence: `kii/include/kii.h`)
- Kii client API → Server code: offers execution (evidence: `kii/include/kii.h`)
- Kii client API → MQTT task: supports MQTT (evidence: `kii/kii_mqtt_task.c`)
- Thing implementation → Request implementation: uses requests (evidence: `kii/kii_ti_impl.c`)
- Thing implementation → JSON parser: uses JSON utilities (evidence: `kii/kii_ti_impl.c`)
- Request implementation → HTTP API: uses HTTP client
- HTTP API → HTTP client: runs HTTP states (evidence: `khc/src/khc_state_impl.c`)
- HTTP client → Socket callbacks: calls socket callbacks (evidence: `khc/src/khc_state_impl.c`)
- Embedded platform → Socket callbacks: implements callbacks (evidence: `khc/include/khc_socket_callback.h`)
