1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-24 21:21:24 +01:00
CommandStation-EX/Turnouts.h
Asbelos e0c76a9dc4 Alter Stream to Print
In prep for Wifi siolution, all output  functions changed to expect Print class instead of Stream... Can still pass Serial1 etc because Stream extends Print, but this allows for an output-only class extending Print to collect a response buffer for Wifi sending with AT commands.
2020-06-12 14:28:35 +01:00

30 lines
571 B
C

#ifndef Turnouts_h
#define Turnouts_h
#include <Arduino.h>
#include "DCC.h"
struct TurnoutData {
uint8_t tStatus;
uint8_t subAddress;
int id;
int address;
};
struct Turnout{
static Turnout *firstTurnout;
int num;
struct TurnoutData data;
Turnout *nextTurnout;
static bool activate(int n, bool state);
static Turnout* get(int);
static bool remove(int);
static void load();
static void store();
static Turnout *create(int, int, int);
static void show(Print & stream, int n);
static bool showAll(Print & stream);
}; // Turnout
#endif