Ambiorix / prplOS 官方示例怎么读:从 120 行的 wait_for 开始
prplOS 的中文资料极少,硬啃源码很容易劝退。更快的路径是从官方 examples 里最小的一个读起:baapi/wait_for 只有约 120 行,却把 amxrt 运行时、事件循环、总线 API 三件事一次讲清。本文给出逐段拆解、在普通 Linux PC 上的实测方法,以及后续的阅读路线。
49 posts
prplOS 的中文资料极少,硬啃源码很容易劝退。更快的路径是从官方 examples 里最小的一个读起:baapi/wait_for 只有约 120 行,却把 amxrt 运行时、事件循环、总线 API 三件事一次讲清。本文给出逐段拆解、在普通 Linux PC 上的实测方法,以及后续的阅读路线。
A dedicated AMX / prplOS development environment: build libubox/ubus/libamx*/amxrt/amxb_ubus from source, on a PC or as a Docker base image, with a ubus ACL (the file must be root:root 0644). Every example article then only clones and compiles on top of it.
greeter_plugin is the most complete AMX data-model example: 4 ODL files define objects/instances/events/persistence, 4 C files implement methods/actions/events/entry point. Walk through ODL→C→build/run, including the state machine, transactions, dynamic Statistics and the PC build result.
UCI centralizes configuration into package/section/option; Ambiorix unifies configuration, state, methods and events into a runtime data model. This article compares their boundaries and adds persistence: where ODL, the runtime object tree, %persistent save files and UCI actually live.
Implements USP Device:2.13 LocalAgent.Threshold: multi-instance, Alias key, expressions/search paths, validate/destroy actions and a Triggered event. ODL walkthrough with ✅/⚠️/❓ verification status.
Same data model as greeter_plugin, but a standalone executable: libamxrt parses the command line, loads backends/ODL and registers the model; symbols in an executable cannot be resolved by import, so they must be registered in the ftab. With main.c walkthrough and app/plugin comparison.
Subscribe via RSS to get new posts automatically.
Technical questions, feedback and leads: use the guestbook.