# aackk/uartbinlib architecture

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

- Interactive diagram: https://gitdiagram.com/aackk/uartbinlib
- Repository: https://github.com/aackk/uartbinlib

## Overview

uartbinlib is a platform-independent C library for framed binary messages over byte streams such as UART. An application selects either the core API or the confirmed-message API, supplies transport hooks and buffers, feeds received bytes, and polls when timeout/retry handling is enabled. The confirmed layer wraps the core parser and sender to automate ACKs, sequence matching, retries, and duplicate filtering. Source excerpts show these runtime relationships; transport wiring and broader core behavior are also documented in the README.

Main entry points: [`src/uartbin.c`](https://github.com/aackk/uartbinlib/blob/main/src/uartbin.c) (Core API), [`src/uartbin_app.c`](https://github.com/aackk/uartbinlib/blob/main/src/uartbin_app.c) (Confirmed API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core framing"]
  node_core_api["Core API<br/>[uartbin.c]"]
end

subgraph group_confirmed["Confirmed messaging"]
  node_confirmed_api["Confirmed API<br/>[uartbin_app.c]"]
end

node_application(("Host application"))
node_uart["UART byte stream"]

node_application -->|"calls core API"| node_core_api
node_application -->|"calls app API"| node_confirmed_api
node_confirmed_api -->|"wraps core"| node_core_api
node_core_api -->|"dispatches packets"| node_confirmed_api
node_core_api -->|"writes frames"| node_uart
node_uart -->|"provides bytes"| node_core_api
node_confirmed_api -->|"delivers messages"| node_application

click node_core_api "https://github.com/aackk/uartbinlib/blob/main/src/uartbin.c"
click node_confirmed_api "https://github.com/aackk/uartbinlib/blob/main/src/uartbin_app.c"

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_core_api toneBlue
class node_confirmed_api toneAmber
class node_application,node_uart toneIndigo
```

## Components

### Core framing

- [Core API](https://github.com/aackk/uartbinlib/blob/main/src/uartbin.c): `src/uartbin.c`

### Confirmed messaging

- [Confirmed API](https://github.com/aackk/uartbinlib/blob/main/src/uartbin_app.c): `src/uartbin_app.c`

### Other components

- **Host application**
- **UART byte stream**

## Connections

- Host application → Core API: calls core API (evidence: `README.md`)
- Host application → Confirmed API: calls app API (evidence: `README.md`)
- Confirmed API → Core API: wraps core (evidence: `src/uartbin_app.c`)
- Core API → Confirmed API: dispatches packets (evidence: `src/uartbin_app.c`)
- Core API → UART byte stream: writes frames (evidence: `README.md`)
- UART byte stream → Core API: provides bytes (evidence: `README.md`)
- Confirmed API → Host application: delivers messages (evidence: `src/uartbin_app.c`)
