DCCpp
This is the library version of a program for Arduino to control railroading DCC devices.
FunctionsState Class Reference

#include "DCCpp.hpp"

Public Member Functions

 FunctionsState ()
 
void clear ()
 
void activate (byte inFunctionNumber)
 
void inactivate (byte inFunctionNumber)
 
bool isActivated (byte inFunctionNumber)
 
void statesSent ()
 
bool isActivationChanged (byte inFunctionNumber)
 

Detailed Description

This is a class to handle decoder functions. An instance of this class handle the status of the functions of one decoder. A function can be active or not.

Definition at line 13 of file DCCpp.hpp.

Constructor & Destructor Documentation

FunctionsState::FunctionsState ( )

Initialize the instance.

Definition at line 25 of file DCCpp.cpp.

Member Function Documentation

void FunctionsState::activate ( byte  inFunctionNumber)

Activate one function. The allowed number goes from 0 to 28, maximum for DCC.

Parameters
inFunctionNumberNumber of the function to activate.

Definition at line 41 of file DCCpp.cpp.

void FunctionsState::clear ( )

Reset all functions to inactive.

Definition at line 30 of file DCCpp.cpp.

void FunctionsState::inactivate ( byte  inFunctionNumber)

Inactivate one function. The allowed number goes from 0 to 28, maximum for DCC.

Parameters
inFunctionNumberNumber of the function to inactivate.

Definition at line 46 of file DCCpp.cpp.

bool FunctionsState::isActivated ( byte  inFunctionNumber)

Check if the given function is activated. The allowed number goes from 0 to 28, maximum for DCC.

Parameters
inFunctionNumberNumber of the function to activate.
Returns
True if the given function is activated.

Definition at line 51 of file DCCpp.cpp.

bool FunctionsState::isActivationChanged ( byte  inFunctionNumber)

Check if the given function had its activation flag changed when sent to the decoder last time. The allowed number goes from 0 to 28, maximum for DCC.

Parameters
inFunctionNumberNumber of the function to check.
Returns
True if the given function activation flag is different between activFlags and sentActiveFlags.

Definition at line 56 of file DCCpp.cpp.

void FunctionsState::statesSent ( )

Copy the current active flags into 'sent' active flags.

Definition at line 61 of file DCCpp.cpp.


The documentation for this class was generated from the following files: