ACAP is an open application platform that enables you to develop and deploy applications directly on Axis network devices. This repository provides template projects with a C wrapper (ACAP.c/ACAP.h) that simplifies SDK interactions for HTTP endpoints, configuration management, event handling, and more.
| Document | Description |
|---|---|
| doc/ACAP.md | Complete technical reference — ACAP.h API, build configuration, code patterns, and full reference implementations for all templates |
| doc/EVENTS.md | Comprehensive catalog of Axis device events with namespaces, properties, and state types |
| doc/VDO.md | VDO (Video Device Object) API reference for video capture and streaming |
| doc/STORAGE.md | Edge Storage API — SD card and NAS read/write with axstorage |
| Template READMEs | Each template directory contains its own README with specific usage, configuration, and endpoint documentation |
For LLM-assisted development, provide doc/ACAP.md as context. Agent-specific instruction files are included for all major AI coding assistants — see AI Agent Support below.
- Axis device supporting ACAP
- Docker installed on your development PC
- C programming knowledge (embedded focus)
- Familiarity with HTML/JS/CSS for UI development
- Clone the repository
git clone https://github.com/pandosme/make_acap.git cd make_acap/base - Build the ACAP
./build.sh
- Install on device
Upload the resulting
.eapfile via AXIS Device Manager or the device's web interface. - Customise
Edit
main.c,manifest.json, andMakefileto implement your service logic. See doc/ACAP.md for the full API reference and code patterns.
Each template follows this structure:
template_name/
├── app/
│ ├── ACAP.c / ACAP.h # SDK wrapper (do not modify)
│ ├── main.c # Application logic (edit this)
│ ├── cJSON.c / cJSON.h # JSON library
│ ├── Makefile # Build configuration
│ ├── manifest.json # ACAP package metadata
│ ├── settings/ # JSON configuration files
│ └── html/ # Web UI assets
├── Dockerfile # Docker build environment
├── build.sh # Build helper script
└── README.md # Template-specific documentation
ACAP.c, ACAP.h, cJSON.c, cJSON.h are shared library files identical across all templates.
Edit only: main.c, manifest.json, Makefile, settings/, html/.
These three values must always match:
PROG1inMakefileAPP_PACKAGEinmain.cappNameinmanifest.json
| Start With | When You Need |
|---|---|
base |
HTTP endpoints, image capture, events, settings, web UI |
event_subscription |
Static event monitoring (topics defined in subscriptions.json) |
event_selection |
User-configurable trigger source (event or timer, picked via UI) |
mqtt |
MQTT broker connectivity, publish/subscribe |
thermometry |
Thermal camera — poll temperature areas/spot meter and forward alarms via MQTT |
cJSON* app = ACAP_Init(APP_PACKAGE, settings_callback);
ACAP_HTTP_Node("endpoint", handler);
void handler(const ACAP_HTTP_Response response, const ACAP_HTTP_Request request) {
const char* method = ACAP_HTTP_Get_Method(request);
const char* body = ACAP_HTTP_Get_Body(request);
char* param = ACAP_HTTP_Request_Param(request, "key"); // must free()
free(param);
}
cJSON* settings = ACAP_Get_Config("settings"); // do NOT free
ACAP_STATUS_SetBool("system", "healthy", 1);
ACAP_EVENTS_Fire_State("state", value);
ACAP_EVENTS_Fire("trigger");| Function | Ownership |
|---|---|
ACAP_Get_Config(), ACAP_STATUS_*() getters |
Internal — do NOT free |
ACAP_FILE_Read() |
Caller — cJSON_Delete() |
ACAP_HTTP_Request_Param() |
Caller — free() |
ACAP_VAPIX_Get/Post(), cJSON_Print*() |
Caller — free() |
- Add
{"name": "myendpoint", "access": "admin", "type": "fastCgi"}tomanifest.jsonhttpConfig - Call
ACAP_HTTP_Node("myendpoint", my_handler)inmain() - Implement the handler using opaque accessor functions above
Add the .c file to OBJS1 in Makefile. Add any new library to PKGS.
The build uses Docker with the Axis ACAP Native SDK 12.2.0. The build.sh script builds packages for both aarch64 and armv7hf architectures.
cd base # or event_subscription, event_selection, mqtt, thermometry
./build.shFor manual single-architecture builds:
docker build --build-arg ARCH=aarch64 --tag acap .
docker cp $(docker create acap):/opt/app ./build
cp build/*.eap .This repo includes instruction files for all major AI coding assistants. Each file contains the same core rules (protected files, naming conventions, API quick reference, memory ownership) so any agent produces correct ACAP code out of the box.
| Agent | Config File | Auto-Loaded |
|---|---|---|
| GitHub Copilot | .github/copilot-instructions.md |
Yes |
| Cursor | .cursor/rules/*.mdc |
Yes (skill-based) |
| Windsurf | .windsurfrules |
Yes |
| Cline | .clinerules |
Yes |
| Aider | CONVENTIONS.md |
Yes |
Cursor skills provide context-aware rules that activate based on the files being edited:
acap-general.mdc— Always on: core rules, template selection, build commandsadd-http-endpoint.mdc— Activates for manifest.json and main.c: step-by-step endpoint recipeadd-event.mdc— Activates for events.json and subscriptions.json: event declaration and subscriptionmemory-management.mdc— Activates for all .c files: ownership rules and common pitfalls