Skip to content

feat: Add sys-crate for the Device Data Hub API - #241

Open
apljungquist wants to merge 12 commits into
mainfrom
acap-rs-datahub-sys
Open

apljungquist wants to merge 12 commits into
mainfrom
acap-rs-datahub-sys

Conversation

@apljungquist

@apljungquist apljungquist commented Jul 11, 2026 •

Copy link
Copy Markdown
Collaborator

Device Data Hub is the designated replacement for the Message Broker API, which is deprecated and will be removed in AXIS OS 13.0.

The bindings are generated from the C headers the same way as for mdb-sys. Constants that the C headers define as object-like macros with casts are transcribed manually because bindgen cannot evaluate them; we may be able to remove those if we upgrade to bindgen >= 0.70.0

Details

.devcontainer/Dockerfile:

  • Set AXIS_OS_VERSION or the new example won't build.

apps/object_consumer:

  • Port an example to trigger the sys-crate build script or the crates/%-sys/src/bindings.rs make target fails 1. It will be updated to use the safe bindings when they are added.

apps/object_consumer/manifest.json:

  • Set /acapPackageConf/setup/compatibleOsVersions/0/min to work around the equivalent implementation not setting this automatically while I work on patching the equivalent implementation.

apps/object_consumer/src/main.rs:

  • Don't pay close attention to this, it's mostly AI generated and will be replaced soon. It seems to work when run alongside the C object_detector examples.

Footnotes

  1. https://github.com/AxisCommunications/acap-rs/actions/runs/30839862786/job/91773991360#step:5:381 ↩

Device Data Hub is the designated replacement for the Message Broker
API, which is deprecated and will be removed in AXIS OS 13.0.

The bindings are generated from the C headers the same way as for
`mdb-sys`. Constants that the C headers define as object-like macros
with casts are transcribed manually because bindgen cannot evaluate
them.
@apljungquist
apljungquist force-pushed the acap-rs-datahub-sys branch from 5778722 to d0cf4d1 Compare July 11, 2026 06:46
@apljungquist
apljungquist requested a review from guoxe August 4, 2026 06:08
@apljungquist
apljungquist marked this pull request as ready for review August 4, 2026 06:08
@apljungquist
apljungquist requested a review from a team as a code owner August 4, 2026 06:08
@apljungquist apljungquist changed the title feat: Add unsafe bindings for the Device Data Hub API feat: Add sys-crate for the Device Data Hub API Aug 4, 2026
@apljungquist
apljungquist removed the request for review from guoxe August 4, 2026 06:34
@apljungquist
apljungquist marked this pull request as draft August 4, 2026 06:34
@apljungquist

Copy link
Copy Markdown
Collaborator Author

Looks like this is failing because the two acap-build implementations have diverged. Parking this until #239 is done.

@apljungquist
apljungquist marked this pull request as ready for review September 23, 2026 19:08
@apljungquist
apljungquist requested a review from guoxe September 23, 2026 19:09
@apljungquist
apljungquist removed the request for review from guoxe September 24, 2026 06:22
@apljungquist
apljungquist marked this pull request as draft September 24, 2026 06:22
@apljungquist

Copy link
Copy Markdown
Collaborator Author

Looks like this is failing because the two acap-build implementations have diverged. Parking this until #239 is done.

I forgot about this

in an attempt to work around the equivalent implementation not setting
this
@apljungquist
apljungquist marked this pull request as ready for review October 4, 2026 12:40
@apljungquist
apljungquist requested a review from guoxe October 4, 2026 12:43
@apljungquist

Copy link
Copy Markdown
Collaborator Author

Looks like this is failing because the two acap-build implementations have diverged. Parking this until #239 is done.

I forgot about this

I'm struggling to set aside time for the acap-build port right now, so I implemented a quick workaround instead.

@guoxe

guoxe commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Constants that the C headers define as object-like macros with casts are transcribed manually because bindgen cannot evaluate them; we may be able to remove those if we upgrade to bindgen >= 0.70.0

Did you explore this option?

Comment thread .devcontainer/Dockerfile
SYSROOT_ARMV7HF=/opt/axis/acapsdk/sysroots/armv7hf
# The above makes the below easier to read
ENV \
AXIS_OS_VERSION=12.11 \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be coupled to the new axis-os-x cargo features? I am a bit concerned that updating this will be forgotten and/or it complicating builds for axis os versions that are not 12.11

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC this is needed for acap-build, so moving it from the environment into the build tools would require us to update them and I'm struggling to make time for that. Are you using the cargo-acap-* tools still?

I'm considering moving away from them, for vaious reasons and I ended up using plain GNU make to build cargo examples 1 instead of adding that functionality to cargo-acap-build.

Footnotes

  1. https://github.com/apljungquist/easy-acap/blob/main/crates/crash-loop-guard/Makefile ↩

@apljungquist

apljungquist commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

Constants that the C headers define as object-like macros with casts are transcribed manually because bindgen cannot evaluate them; we may be able to remove those if we upgrade to bindgen >= 0.70.0

Did you explore this option?

Now I have and it appears to check out. Should we land the dependency update first?

#284

@apljungquist
apljungquist requested a review from guoxe November 3, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants