Giter Club home page Giter Club logo

zusi3tcp's Introduction

Zusi 3 TCP Protocol Library

An implementation of the Zusi 3 TCP protocol in C++.

This library is currently in an alpha state. It should be possible to send/receive all Zusi messages, but there is only limited error checking and the API will change in the future. The ID enumerations are only partly populated.

Read the API Documentation

Classes

  • zusi::Socket - Abstract interface for a network communications class
  • zusi::Node - Message node. Has and ID, child attributes and nodes.
  • zusi::Attribute - Message attribute. Has an ID, and some data.
  • zusi::ClientConnection - Encapsulates a connection to a Zusi 3 server. Negotiates a connection with the server and sends and recieves message for the application.
  • zusi::ServerConnection - Emulates a Zusi 3 server. Negotiates a connection with the client and sends data updates.

Samples

  • dump_ftd - Connects to server, subscribes to Führerstand variables and displays the contents of received messages
  • pfeil_and_go - Connects to server, sounds the horn, and opens the throttle
  • server_emulator - Accepts a client connection and sends simulated Speed and Power data to the client

For an example of constructing a message to transmit, see the ClientConnection::connect() method.

Platforms

Currently there is no byte-swapping so it will only work on little-endian architectures.

The library is portable to different platforms by implementing the Socket interface. Two implementations are included - WinsockBlockingSocket, which uses the Windows socket library in blocking mode, and DebugSocket, which prints data to the console insted of sending it.

License

The MIT License

Copyright (c) 2016 Jonathan Pilborough

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

zusi3tcp's People

Contributors

jonathanp0 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

johannes

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.