Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
Defs.hxx File Reference
#include <cstdint>
#include "utils/macros.h"

Go to the source code of this file.

Classes

struct  openlcb::NodeHandle
 Container of both a NodeID and NodeAlias. More...
 
struct  openlcb::Defs
 The generic interface for NMRAnet network interfaces. More...
 

Namespaces

namespace  openlcb
 

Typedefs

typedef uint64_t openlcb::NodeID
 48-bit NMRAnet Node ID type
 
typedef uint16_t openlcb::NodeAlias
 Alias to a 48-bit NMRAnet Node ID type.
 
typedef string openlcb::Payload
 Container that carries the data bytes in an NMRAnet message.
 

Enumerations

enum class  openlcb::EventState { VALID = 0 , INVALID = 1 , RESERVED = 2 , UNKNOWN = 3 }
 Allowed states of producers and consumers. More...
 

Functions

EventState openlcb::invert_event_state (EventState state)
 Returns the inverted event state, switching valid and invalid, but not changing unknown and reserved.
 
EventState openlcb::to_event_state (bool state)
 Returns the inverted event state, switching valid and invalid, but not changing unknown and reserved.
 
Defs::MTI openlcb::operator+ (const Defs::MTI &value, EventState state)
 Allows of setting the producer/consumer identified MTI with the event state to set the low bits.
 
Defs::MTI openlcb::operator++ (Defs::MTI &value, int)
 Operator overload for post increment.
 
Defs::MTIopenlcb::operator++ (Defs::MTI &value)
 Operator overload for pre increment.
 
Defs::MTI openlcb::operator-- (Defs::MTI &value, int)
 Operator overload for post decrement.
 
Defs::MTIopenlcb::operator-- (Defs::MTI &value)
 Operator overload for pre decrement.
 

Variables

static const NodeAlias openlcb::NOT_RESPONDING = 0xF000
 Guard value put into the the internal node alias maps when a node ID could not be translated to a valid alias.
 

Detailed Description

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Static declarations, enums and helper functions for the NMRAnet interface.

Author
Stuart W. Baker
Date
18 September 2013

Definition in file openlcb/Defs.hxx.