Giter VIP home page Giter VIP logo

loconet2's Introduction

LocoNet2

A refactor of the original LocoNet library to be much more object oriented, with derived classes for each different hardware interface

Currently this only supports the ESP32 processor.

positron96/LocoNet2

This is a modified version of LocoNet2 library that is tailored for command station use. It is now used in the ESP32 LocoNet Command Station.

Warning! This library was only tested for specific usecase and specific hardware (a ESP32 command station). Even examples that worked for upstream library may not work with this one (I have not tested).

The core LocoNet class is now split into 2 classes:

  1. LocoNetPhy - an implementation of physical LocoNet bus with rx and tx functionality. Upon receiving a message, an Phy class sends a message to a LocoNetDispatcher for further processing. The class is still abstract with actual implementations residing in different classes. For ESP32, LocoNetESP32 class was tested to work with the new architecture.
  2. LocoNetDispatcher - a class that broadcasts LocoNet messages to consumer objects (that implement a LocoNetConsumer interface). Has built-in filtering that was orginally present in LocoNet class.

This architecture allows for several sources of LocoNet messages to co-exist (physical LocoNet, LocoNet over WiFi, LocoNet over Serial) and to exchange messages. Upon receiving a LocoNet message from outside world, the source classes send messages to LocoNetDispatcher, which broadcasts them to all other LocoNet sources that emit the message to outside world.

LocoNet class is now an alias for LocoNetDispatcher. Existing utility classes (LocoNetThrottle, LocoNetFastClock etc) still use LocoNet class and have not changed much. Probably they will work with minor modifications.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.