Skip to content

fix the device owner ship model - #15

Merged
firesurfer merged 8 commits into
mainfrom
fix/device-owner-ship-modell
Aug 24, 2026
Merged

fix the device owner ship model #15
firesurfer merged 8 commits into
mainfrom
fix/device-owner-ship-modell

Conversation

@firesurfer

Copy link
Copy Markdown
Contributor

What changes

This PR changes the device owner ship model to a more sane approach. In the same step the GenericEthercatDevice and the EthercatDeviceBase were fused into a single EthercatDevice class.

Example how this affects the downstream users

  1. Old setup -> device is attached to the bus
EthercatBus bus;

MyFancyDevice device;
bus.attach_device(device_id, device.get_ethercat_device());
  1. New setup -> device is handed out by the bus
EthercatBus bus;
MyFancyDevice device(bus->aquired_device(device_id));

Why

  1. More sane approach -> the generic adapter is handled fully by the bus
  2. This approach allows a better synchronization model in the future (aka sync all devices at once into the bus with less synchronization overhead)

@firesurfer
firesurfer requested a review from bpapaspyros August 24, 2026 08:38

@bpapaspyros bpapaspyros left a comment

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.

overall looking good, just trying to wrap my head around the threading parts.

Also, does keeping all devices in one vector and then mutex locking creating a bottleneck in some places? perhaps it's insignificant even. (I'm re-reading, but I wanted to already post the syntactic/code comments that came to mind)

Comment thread src/internal/soem/soem_backend.cpp Outdated
Comment thread src/internal/soem/soem_backend.cpp
Comment thread include/duatic_ethercat_interface/ethercat_bus.hpp Outdated
Comment thread include/duatic_ethercat_interface/ethercat_device.hpp
Comment thread include/duatic_ethercat_interface/ethercat_device.hpp
Comment thread src/example/demo.cpp Outdated
firesurfer and others added 4 commits August 24, 2026 12:48
Co-authored-by: Vaios Papaspyros <8146703+bpapaspyros@users.noreply.github.com>
Co-authored-by: Vaios Papaspyros <8146703+bpapaspyros@users.noreply.github.com>

@bpapaspyros bpapaspyros left a comment

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.

looks good then, thanks for the explanations

@firesurfer
firesurfer merged commit 9cd0733 into main Aug 24, 2026
8 checks passed
@firesurfer
firesurfer deleted the fix/device-owner-ship-modell branch August 24, 2026 11:19
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