# seer300/nbiot_xy1100 architecture

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

- Interactive diagram: https://gitdiagram.com/seer300/nbiot_xy1100
- Repository: https://github.com/seer300/nbiot_xy1100

## Overview

This tree is firmware for the XY1100 NB-IoT module, not a standalone cloud service. Its visible entry point initializes hardware and system services, invokes user initialization hooks, then starts the OS scheduler. The source tree also includes cellular networking, AT-facing protocol clients, cloud-device-management stacks, and firmware-update implementations. The README describes build setup only; wiring among these subsystems is not established by the sampled excerpts, so the graph shows only the startup calls evident in main.c and otherwise represents major capabilities without speculative links.

Main entry points: [`xinyi/TARGETS/xinyiNBSoC/USERAPP/basic/src/main.c`](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/TARGETS/xinyiNBSoC/USERAPP/basic/src/main.c) (Application entry), [`xinyi/APPLIB/cloud/cdp/AgentTiny/ota/fota/atiny_fota_manager.c`](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/cdp/AgentTiny/ota/fota/atiny_fota_manager.c) (Agent OTA), [`xinyi/APPLIB/http/httpcore/src/http_client.c`](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/http/httpcore/src/http_client.c) (HTTP client), [`xinyi/APPLIB/mqtt/xy_mqtt/src/MQTTClient.c`](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/mqtt/xy_mqtt/src/MQTTClient.c) (MQTT client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Firmware startup"]
  node_main["Application entry<br/>[main.c]"]
  node_userhooks["User init hooks<br/>[main.c]"]
  node_system["System services"]
  node_scheduler["FreeRTOS scheduler<br/>[tasks.c]"]
end

subgraph group_network["Connectivity"]
  node_lwip["lwIP networking<br/>[ip.c]"]
  node_at_socket["AT sockets<br/>[at_socket_cmd.c]"]
  node_http["HTTP client<br/>[http_client.c]"]
  node_mqtt["MQTT client<br/>[MQTTClient.c]"]
  node_coap["CoAP client<br/>[xy_coap_api.c]"]
end

subgraph group_cloud["Cloud clients"]
  node_cdp_at["CDP AT interface<br/>[at_cdp.c]"]
  node_agent["CDP LwM2M agent<br/>[agenttiny.c]"]
  node_onenet["OneNET client<br/>[xy_cis_api.c]"]
  node_onenet_core["OneNET protocol core<br/>[cis_core.c]"]
end

subgraph group_update["Firmware updates"]
  node_agent_ota["Agent OTA"]
  node_ota_package["OTA package handling<br/>[package.c]"]
  node_ota_flags["Upgrade flags<br/>[flag_manager.c]"]
  node_abup["ABUP FOTA<br/>[abup_fota.c]"]
end

subgraph group_security["Secure transport"]
  node_dtls["DTLS transport<br/>[dtls_interface.c]"]
  node_mbedtls_ssl["TLS implementation<br/>[ssl_tls.c]"]
end

node_device(("Device user"))
node_cloud_service(("Cloud service"))

node_main -->|"calls"| node_system
node_main -->|"calls"| node_userhooks
node_main -->|"starts"| node_scheduler
node_device -->|"boots firmware"| node_main
node_device -.->|"issues commands"| node_cdp_at
node_device -.->|"uses API"| node_onenet
node_device -.->|"uses client"| node_mqtt
node_device -.->|"uses client"| node_http
node_device -.->|"uses client"| node_coap
node_cloud_service -.->|"manages device"| node_agent
node_cloud_service -.->|"communicates"| node_onenet_core
node_cloud_service -.->|"exchanges messages"| node_mqtt
node_agent_ota -->|"reads/writes flags"| node_ota_flags
node_agent_ota -->|"initializes package"| node_ota_package
node_agent_ota -->|"reports update state"| node_agent
node_abup -.->|"uses HTTP"| node_http
node_mbedtls_ssl -.->|"supports transport"| node_dtls

click node_main "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/TARGETS/xinyiNBSoC/USERAPP/basic/src/main.c"
click node_userhooks "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/TARGETS/xinyiNBSoC/USERAPP/basic/src/main.c"
click node_scheduler "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/KERNEL/OS/FreeRTOS/tasks.c"
click node_lwip "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/lwip/lwip-2.1.2/core/ip.c"
click node_at_socket "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/at_socket/src/at_socket_cmd.c"
click node_http "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/http/httpcore/src/http_client.c"
click node_mqtt "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/mqtt/xy_mqtt/src/MQTTClient.c"
click node_coap "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/libcoap/xy_coap/src/xy_coap_api.c"
click node_cdp_at "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/cdp/xy_cdp/src/at_cdp.c"
click node_agent "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/cdp/AgentTiny/atiny_lwm2m/agenttiny.c"
click node_onenet "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/onenet/xy_onenet/src/xy_cis_api.c"
click node_onenet_core "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/onenet/ciscore/cis_core.c"
click node_agent_ota "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/cdp/AgentTiny/ota/fota/atiny_fota_manager.c"
click node_ota_package "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/cdp/AgentTiny/ota/package/package.c"
click node_ota_flags "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/cdp/AgentTiny/ota/flag_operate/flag_manager.c"
click node_abup "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/abup/src/abup_fota.c"
click node_dtls "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/Dtls/xy_dtls/src/dtls_interface.c"
click node_mbedtls_ssl "https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/Dtls/mbedtls-2.6.0/library/ssl_tls.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_main,node_userhooks,node_system,node_scheduler,node_device toneBlue
class node_lwip,node_at_socket,node_http,node_mqtt,node_coap toneAmber
class node_cdp_at,node_agent,node_onenet,node_onenet_core toneMint
class node_agent_ota,node_ota_package,node_ota_flags,node_abup toneRose
class node_dtls,node_mbedtls_ssl,node_cloud_service toneIndigo
```

## Components

### Firmware startup

- [Application entry](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/TARGETS/xinyiNBSoC/USERAPP/basic/src/main.c): `xinyi/TARGETS/xinyiNBSoC/USERAPP/basic/src/main.c`
- [User init hooks](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/TARGETS/xinyiNBSoC/USERAPP/basic/src/main.c): `xinyi/TARGETS/xinyiNBSoC/USERAPP/basic/src/main.c`
- **System services**
- [FreeRTOS scheduler](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/KERNEL/OS/FreeRTOS/tasks.c): `xinyi/KERNEL/OS/FreeRTOS/tasks.c`

### Connectivity

- [lwIP networking](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/lwip/lwip-2.1.2/core/ip.c): `xinyi/APPLIB/lwip/lwip-2.1.2/core/ip.c`
- [AT sockets](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/at_socket/src/at_socket_cmd.c): `xinyi/APPLIB/at_socket/src/at_socket_cmd.c`
- [HTTP client](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/http/httpcore/src/http_client.c): `xinyi/APPLIB/http/httpcore/src/http_client.c`
- [MQTT client](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/mqtt/xy_mqtt/src/MQTTClient.c): `xinyi/APPLIB/mqtt/xy_mqtt/src/MQTTClient.c`
- [CoAP client](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/libcoap/xy_coap/src/xy_coap_api.c): `xinyi/APPLIB/libcoap/xy_coap/src/xy_coap_api.c`

### Cloud clients

- [CDP AT interface](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/cdp/xy_cdp/src/at_cdp.c): `xinyi/APPLIB/cloud/cdp/xy_cdp/src/at_cdp.c`
- [CDP LwM2M agent](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/cdp/AgentTiny/atiny_lwm2m/agenttiny.c): `xinyi/APPLIB/cloud/cdp/AgentTiny/atiny_lwm2m/agenttiny.c`
- [OneNET client](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/onenet/xy_onenet/src/xy_cis_api.c): `xinyi/APPLIB/cloud/onenet/xy_onenet/src/xy_cis_api.c`
- [OneNET protocol core](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/onenet/ciscore/cis_core.c): `xinyi/APPLIB/cloud/onenet/ciscore/cis_core.c`

### Firmware updates

- [Agent OTA](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/cdp/AgentTiny/ota/fota/atiny_fota_manager.c): `xinyi/APPLIB/cloud/cdp/AgentTiny/ota/fota/atiny_fota_manager.c`
- [OTA package handling](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/cdp/AgentTiny/ota/package/package.c): `xinyi/APPLIB/cloud/cdp/AgentTiny/ota/package/package.c`
- [Upgrade flags](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/cloud/cdp/AgentTiny/ota/flag_operate/flag_manager.c): `xinyi/APPLIB/cloud/cdp/AgentTiny/ota/flag_operate/flag_manager.c`
- [ABUP FOTA](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/abup/src/abup_fota.c): `xinyi/APPLIB/abup/src/abup_fota.c`

### Secure transport

- [DTLS transport](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/Dtls/xy_dtls/src/dtls_interface.c): `xinyi/APPLIB/Dtls/xy_dtls/src/dtls_interface.c`
- [TLS implementation](https://github.com/seer300/nbiot_xy1100/blob/master/xinyi/APPLIB/Dtls/mbedtls-2.6.0/library/ssl_tls.c): `xinyi/APPLIB/Dtls/mbedtls-2.6.0/library/ssl_tls.c`

### Other components

- **Device user**
- **Cloud service**

## Connections

- Application entry → System services: calls
- Application entry → User init hooks: calls
- Application entry → FreeRTOS scheduler: starts
- Device user → Application entry: boots firmware
- Device user → CDP AT interface: issues commands
- Device user → OneNET client: uses API
- Device user → MQTT client: uses client
- Device user → HTTP client: uses client
- Device user → CoAP client: uses client
- Cloud service → CDP LwM2M agent: manages device
- Cloud service → OneNET protocol core: communicates
- Cloud service → MQTT client: exchanges messages
- Agent OTA → Upgrade flags: reads/writes flags
- Agent OTA → OTA package handling: initializes package
- Agent OTA → CDP LwM2M agent: reports update state
- ABUP FOTA → HTTP client: uses HTTP
- TLS implementation → DTLS transport: supports transport
