Comments (2)
Hub Discovery
A central module PoweredUpHost
handles the discovery of Hubs using the provided IPoweredUpBluetoothAdapter
. The host instantiates the specific hub but does not perform a Hub.ConnectAsync
. This decision is left with the invoking consumer (based on e.g. filtering by name/bt address of the hub).
Rationale: Discovery is required but specific to the LEGO protocol. Therefore, a module is required handling it independent of the utilized BT stack. The Hub
provides a method ConnectWithBluetoothAdapter
which allows alternatives to Bluetooth connections, e.g. for mocking etc.
Hub
A Hub
is essentially a handler for ports. It manages a list of Port
s which then can be used to retrieve the connected device. The hub itself has built-in devices exposed via known ports. Derived classes (e.g. TechnicMediumHub
) of the base hub can be used to simplify access to known external ports (e.g. A-D). The hub does not understand or expose functionality for individual devices. This is outsourced to devices.
Rationale: To keep the Hub maintainable, the device logic is isolated into specific device classes.
Devices
Devices are convenience modules collecting conversions from and to protocol messages. It is connected to the rest of the library using the IPoweredUpProtocol
(which may be filtered to the given port).
Devices have cached static information retrieved using PortInformation and PortModeInformation messages. These cached messages allow a much faster setup of the protocol decoding.
Rationale: Keep devices simple while at the same time keep the hub focused on managing ports and connection.
from powered-up.
Hub
, Port
and Device
are virtual representations of physical object. This allows a simple mental transfer.
from powered-up.
Related Issues (20)
- Remove device from the Windows List of known devices!!!! HOT 4
- Update Mario
- Adjust Modes to use scale-safe data type
- Improve Linux Buildability
- Internalize WinRT dependency & re-release CLI as a net6.0 only HOT 1
- Update to .NET 6 / C# 10
- Embed README.md in NuGet
- Add Support for LEGO Education SPIKE Essential Devices
- More usage examples for continuous motor control? HOT 4
- Linux install failed: nuget reports signature expiration and self-signed certificate HOT 3
- "System.NullReferenceException: Object reference not set to an instance of an object." during "Discover Ports. Receiving Messages ..." when using CLI HOT 4
- System.ObjectDisposedException: The object has been closed. after a few seconds HOT 11
- Controlling two hubs not working (Lego 42100) HOT 6
- Update to .NET 8 / C# 12
- poweredup device list hangs HOT 4
- Device discovery still uses static port information HOT 3
- Code Quality v5.0
- Investigate Impact of supporting WeDo 2.0 (HUB)
- How turn on lights on ColorDistanceSensor ? HOT 12
- Code Quality v6.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powered-up.