machinekit-hal
machinekit-hal copied to clipboard
HAL pin cannot be owned in new-style Python API
A pin created via the from machinekit import hal API cannot be owned and therefore not be used to create userland components.
E.g.:
self.halcomp = hal.Component(self.compname)
self.halpin = self.parent_comp.newpin(self.name, self.type, self.dir)
self.halpin.set(self.local_pin_value)
Throws the error:
RuntimeError: cannot set value of linked pin <pin name>
Fix either by adding an owned flag to the HalPin or creating a OwnedHalPin class returned by newpin.