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

Implement a Driver connection type #280

Merged
merged 8 commits into from
Jun 20, 2024

Commits on Jun 20, 2024

  1. Remove noImplicitAny

    This makes TypeScript a bit more bearable.
    amrc-benmorrow committed Jun 20, 2024
    Configuration menu
    Copy the full SHA
    668e52f View commit details
    Browse the repository at this point in the history
  2. Run a broker for drivers to connect to

    We are using the Aedes broker library. Create a broker and perform auth
    on clients.
    
    The broker URL to listen on and the location of the passwords for the
    drivers are taken from the environment rather than from the config as
    these will need to be synchronised with the driver deployment. This
    means they are Helm values rather than edge agent config items.
    amrc-benmorrow committed Jun 20, 2024
    Configuration menu
    Copy the full SHA
    f8e14df View commit details
    Browse the repository at this point in the history
  3. Emit structured driver messages

    The messages from a driver are too complicated to try to emit as
    positional arguments; emit an object instead. This means we can pull out
    and validate the data topic name too.
    amrc-benmorrow committed Jun 20, 2024
    Configuration menu
    Copy the full SHA
    df852b7 View commit details
    Browse the repository at this point in the history
  4. Start a TODO list

    These tasks are too small to go in Jira, and some will probably outlive
    this project.
    amrc-benmorrow committed Jun 20, 2024
    Configuration menu
    Copy the full SHA
    1c65a6b View commit details
    Browse the repository at this point in the history
  5. Remove Device subclasses

    Device represents a Sparkplug Device, and clearly lives on the Edge
    Agent side of the divide. It should not have any connection-specific
    functionality.
    
    Where there was specific code, this was concerned with arranging to
    subscribe to addresses on the southbound connection. Handle this in the
    Connection class instead.
    amrc-benmorrow committed Jun 20, 2024
    Configuration menu
    Copy the full SHA
    81f4942 View commit details
    Browse the repository at this point in the history
  6. Update TODO

    amrc-benmorrow committed Jun 20, 2024
    Configuration menu
    Copy the full SHA
    d89ac3d View commit details
    Browse the repository at this point in the history
  7. Implement a Driver connection type

    This sits alongside the other connection types, for now, and speaks my
    new driver protocol. This doesn't handle CMDs or errors correctly yet,
    but otherwise works.
    
    I'm not entirely sure how to handle drivers that want to poll
    themselves. Currently the EA keeps sending poll messages regardless, and
    drivers like OPCUA can just not subscribe, and use the group poll
    instruction instead.
    
    I have disabled the watchdog timeout; it fires much too quickly when
    you're pretending to be a device manually. I'm not sure a fixed timeout
    with no ping is the right thing to do anyway; there are valid reasons
    why a connection might not speak for 10s.
    amrc-benmorrow committed Jun 20, 2024
    Configuration menu
    Copy the full SHA
    f332d35 View commit details
    Browse the repository at this point in the history
  8. Update TODO

    amrc-benmorrow committed Jun 20, 2024
    Configuration menu
    Copy the full SHA
    0b10386 View commit details
    Browse the repository at this point in the history