Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider exposing WhoAmI as a property of Device #83

Open
bruno-f-cruz opened this issue Jan 7, 2024 · 0 comments
Open

Consider exposing WhoAmI as a property of Device #83

bruno-f-cruz opened this issue Jan 7, 2024 · 0 comments

Comments

@bruno-f-cruz
Copy link
Contributor

The Device constructor overload that takes a WhoAmI is not exposed in the Bonsai operator.

public Device(int whoAmI)

The requirement to expose this WhoAmI was somewhat made mute by the device-specific APIs that implement the WhoAmI check on connection since these know what ID to expect to find.

There is however a scenario where having the WhoAmI exposed in the core class still makes some sense. Consider a user who has some sort of specification that maps ComPort -> WhoAmI.
We can then use ComPort to instantiate Observables that connect to different devices on different ports. This is already possible and an efficient way to connect to harp devices dynamically. The caveat here is that the WhoAmI information cannot currently be used to make check if the device we connected to is the expected device. If this property is exposed, we can leverage the already existing constructor to have this behavior for free.

The proposal is thus to expose the WhoAmI property in the current operator as a Nullable<int> that by default will be null and ensure backward compatibility. If a value is defined, the aforementioned constructor will be used and the WhoAmI code will be asserted.

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

No branches or pull requests

1 participant