OLE Developer Guide  Latest Git
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
receiver_counters.h
Go to the documentation of this file.
1 /*
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2.1 of the License, or (at your option) any later version.
6  *
7  * This library is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * Lesser General Public License for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public
13  * License along with this library; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15  *
16  * receiver_counters.h
17  * Copyright (C) 2015 Simon Newton
18  */
19 
27 #ifndef FIRMWARE_SRC_RECEIVER_COUNTERS_H_
28 #define FIRMWARE_SRC_RECEIVER_COUNTERS_H_
29 
30 #include <stdint.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 // @cond INTERNAL
37 typedef struct {
38  uint32_t dmx_frames;
39  uint32_t asc_frames;
40  uint32_t rdm_frames;
41  uint32_t rdm_short_frame;
42  uint32_t rdm_length_mismatch;
43  uint32_t rdm_sub_start_code_invalid;
44  uint32_t rdm_msg_len_invalid;
45  uint32_t rdm_param_data_len_invalid;
46  uint32_t rdm_checksum_invalid;
47  uint8_t dmx_last_checksum;
48  uint16_t dmx_last_slot_count;
49  uint16_t dmx_min_slot_count;
50  uint16_t dmx_max_slot_count;
51 } ReceiverCounters;
52 
53 // @endcond
54 
58 extern ReceiverCounters g_responder_counters;
59 
64 
69 
73 static inline uint32_t ReceiverCounters_DMXFrames() {
74  return g_responder_counters.dmx_frames;
75 }
76 
80 static inline uint32_t ReceiverCounters_ASCFrames() {
81  return g_responder_counters.asc_frames;
82 }
83 
87 static inline uint32_t ReceiverCounters_RDMFrames() {
88  return g_responder_counters.rdm_frames;
89 }
90 
96 static inline uint32_t ReceiverCounters_RDMShortFrame() {
97  return g_responder_counters.rdm_short_frame;
98 }
99 
105 static inline uint32_t ReceiverCounters_RDMLengthMismatch() {
106  return g_responder_counters.rdm_length_mismatch;
107 }
108 
114  return g_responder_counters.rdm_sub_start_code_invalid;
115 }
116 
122  return g_responder_counters.rdm_msg_len_invalid;
123 }
124 
130  return g_responder_counters.rdm_param_data_len_invalid;
131 }
132 
137  return g_responder_counters.rdm_checksum_invalid;
138 }
139 
145 static inline uint32_t ReceiverCounters_DMXLastChecksum() {
146  return g_responder_counters.dmx_last_checksum;
147 }
148 
154 static inline uint32_t ReceiverCounters_DMXLastSlotCount() {
155  return g_responder_counters.dmx_last_slot_count;
156 }
157 
164 static inline uint32_t ReceiverCounters_DMXMinimumSlotCount() {
165  return g_responder_counters.dmx_min_slot_count;
166 }
167 
173 static inline uint32_t ReceiverCounters_DMXMaximumSlotCount() {
174  return g_responder_counters.dmx_max_slot_count;
175 }
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 
185 #endif // FIRMWARE_SRC_RECEIVER_COUNTERS_H_
static uint32_t ReceiverCounters_RDMSubStartCodeInvalidCounter()
The number of RDM frames received where the sub-start-code was incorrect.
Definition: receiver_counters.h:113
static uint32_t ReceiverCounters_ASCFrames()
The number of ASC frames received.
Definition: receiver_counters.h:80
static uint32_t ReceiverCounters_DMXMinimumSlotCount()
The smallest DMX frame seen.
Definition: receiver_counters.h:164
static uint32_t ReceiverCounters_RDMParamDataLenInvalidCounter()
The number of RDM frames received where the param data length was incorrect.
Definition: receiver_counters.h:129
static uint32_t ReceiverCounters_DMXFrames()
The number of DMX512 frames received.
Definition: receiver_counters.h:73
static uint32_t ReceiverCounters_DMXLastSlotCount()
The number of slots in the most recent DMX frame.
Definition: receiver_counters.h:154
static uint32_t ReceiverCounters_DMXMaximumSlotCount()
The largest DMX frame seen.
Definition: receiver_counters.h:173
static uint32_t ReceiverCounters_RDMShortFrame()
The number of RDM frames that were too short.
Definition: receiver_counters.h:96
ReceiverCounters g_responder_counters
The counters for the receiver.
static uint32_t ReceiverCounters_DMXLastChecksum()
The additive checksum of the last DMX frame.
Definition: receiver_counters.h:145
void ReceiverCounters_ResetCounters()
Reset the counters.
static uint32_t ReceiverCounters_RDMLengthMismatch()
The number of RDM frames that had a length mismatch.
Definition: receiver_counters.h:105
static uint32_t ReceiverCounters_RDMChecksumInvalidCounter()
The number of RDM frames received where the checksum was incorrect.
Definition: receiver_counters.h:136
void ReceiverCounters_ResetCommsStatusCounters()
Reset the COMMS_STATUS counters.
static uint32_t ReceiverCounters_RDMFrames()
The number of RDM frames received.
Definition: receiver_counters.h:87
static uint32_t ReceiverCounters_RDMMessageLengthInvalidCounter()
The number of RDM frames received where the message length was incorrect.
Definition: receiver_counters.h:121