generated from AMRC-FactoryPlus/acs-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a Driver connection type (#280)
This sits alongside the other connection types (for now) and communicates with an external driver using the new protocol. Configuration, polling and data packets are implemented. Command packets and error handling is not. The Device subclasses have been removed. Where they had functionality this has been moved into the DeviceConnections. The Devices now purely handle the Sparkplug side of things, leaving the DeviceConnection to handle the southbound details.
- Loading branch information
Showing
22 changed files
with
837 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# TODO list for edge-split work | ||
|
||
- [x] The Device subclasses need to go. Where they do work this needs to | ||
move into the Connection. In particular some Devices handle | ||
subscription tasks which should move to `startSubscription`. | ||
|
||
- [ ] `DeviceConnection.readMetrics` accepts payload format / delimiter | ||
arguments. I don't think any of the drivers use them? This belongs | ||
EA-side. | ||
|
||
- [ ] `writeMetrics` also accepts format/delimiter. I'm not clear yet | ||
that it isn't used for this code path. Ideally we want all device | ||
writes to accept a plain Buffer as might be provided from a read. | ||
|
||
- [x] The Connection currently handles the poll loop, as part of | ||
`startSubscription`. | ||
* For simple connections this is implemented in the base class and | ||
should be handled by the Device (EA-side). | ||
* Some Connections (MTConnect, OPCUA) can request polling in the | ||
southbound protocol. The driver protocol needs extending to handle | ||
this case. | ||
|
||
- [ ] More generally, the Connections shouldn't see the Metrics at all. | ||
They should operate entirely on addresses. | ||
|
||
- [x] Multiple Devices may subscribe to a single Connection. The EA-side | ||
Connection will need to track the current list of addresses we are | ||
interested in and push it down to the driver. | ||
|
||
- [ ] Devices are currently linked to a single Connection. This is not | ||
necessary, but means we need to: | ||
* Add a `connection` property to each metric definition. | ||
* Change the Device to poll via a central connection manifold rather | ||
than via an individual connection. | ||
* Supply data topic names to a Device in return for addresses when | ||
it subscribes to the connection manifold. | ||
* Poll the manifold using connection/datatopic pairs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.