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

Dynamic Device #37

Closed
9 of 10 tasks
tthiery opened this issue Jul 1, 2020 · 2 comments
Closed
9 of 10 tasks

Dynamic Device #37

tthiery opened this issue Jul 1, 2020 · 2 comments
Assignees
Milestone

Comments

@tthiery
Copy link
Member

tthiery commented Jul 1, 2020

Use Cases

  • Implement fallback device for unknown devices (flag)
  • Implement fallback for known but not implemented devices (flag)
  • Use DynamicDevice.Discover in case GetStaticPortInformation does not have any information for typed device (aka. soft react to firmware updates).

Strategy

  • Create a sub class DynamicDevice which derives from Device
  • Add a discovery function as DynamicDevice.DiscoverAsync. Decision needed whether we auto-call it when discovered by HubAttachedIOMessage or by user before usage by user (since pretty expensive).
  • Add ConcurrentDictionary<byte,Mode> Modes to Device which is auto populated on Discovery (or on auto-playing knowledge into the device) ... so for existing devies these are auto-populated.
  • Add default observables, properties (SI, Raw, Pct) and WriteDirectMode method to Mode
  • Rewrite existing invocations to target Mode.

Should be non-breaking at the API surface.

@tthiery tthiery added this to the v2.0 milestone Jul 1, 2020
@tthiery tthiery added area-devices enhancement New feature or request labels Jul 1, 2020
tthiery added a commit that referenced this issue Jul 8, 2020
- Add example (requires cleanup in samples
- Add extension mode for IServiceCollection to AddPoweredUp services
  (like IDeviceFactory)
- Made DeviceFactory a singleton instead of static (to allow testing
  of DynamicDevice on a known device)
- Fix console output in DiscoverPorts function
- Add WriteDirectModeData to Mode
- Add GenericWriteDirectModeDataMessage for byte[] provided by user
- Breaking Change due to ServiceCollection need to contain IDeviceFactory

#37 breaking
@tthiery tthiery self-assigned this Jul 8, 2020
@tthiery
Copy link
Member Author

tthiery commented Jul 8, 2020

Is currently breaking due to .AddPoweredUP on ServiceCollection (DeviceFactory is no longer static)

tthiery added a commit that referenced this issue Jul 8, 2020
- Created base class for providing default infrastructure
- Create ServiceProvider Configure callback into Example
- Reduced default wait time in some examples

#37 non-breaking
tthiery added a commit that referenced this issue Jul 8, 2020
- Fixed DeviceFactory to return DynamicDevice if no typed device present

#37 non-breaking
tthiery added a commit that referenced this issue Jul 8, 2020
tthiery added a commit that referenced this issue Jul 10, 2020
@tthiery
Copy link
Member Author

tthiery commented Jul 10, 2020

Postpone fallback to dynamic discover in case of new firmware/software version. Not yet clear how to handle and performance.

@tthiery tthiery closed this as completed Jul 10, 2020
tthiery added a commit that referenced this issue Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant