Open Lighting Architecture  Latest Git
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
JaRuleConstants.h
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program 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
10  * GNU Library General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15  *
16  * JaRuleConstants.h
17  * Constants used with Ja Rule devices.
18  * Copyright (C) 2015 Simon Newton
19  */
20 
21 #ifndef LIBS_USB_JARULECONSTANTS_H_
22 #define LIBS_USB_JARULECONSTANTS_H_
23 
24 #include <ola/Callback.h>
25 #include <ola/io/ByteString.h>
26 #include <ostream>
27 
28 namespace ola {
29 namespace usb {
30 
34 typedef enum {
38 
42 typedef enum {
47 
53 typedef enum {
58 
66 
71 
76 
81 
86 
91 
97 
101 typedef enum {
102  JARULE_CMD_RESET_DEVICE = 0x00,
103  JARULE_CMD_SET_MODE = 0x01,
104  JARULE_CMD_GET_HARDWARE_INFO = 0x02,
105  JARULE_CMD_RUN_SELF_TEST = 0x03,
106  JARULE_CMD_SET_BREAK_TIME = 0x10,
107  JARULE_CMD_GET_BREAK_TIME = 0x11,
108  JARULE_CMD_SET_MARK_TIME = 0x12,
109  JARULE_CMD_GET_MARK_TIME = 0x13,
110  JARULE_CMD_SET_RDM_BROADCAST_TIMEOUT = 0x20,
111  JARULE_CMD_GET_RDM_BROADCAST_TIMEOUT = 0x21,
112  JARULE_CMD_SET_RDM_RESPONSE_TIMEOUT = 0x22,
113  JARULE_CMD_GET_RDM_RESPONSE_TIMEOUT = 0x23,
114  JARULE_CMD_SET_RDM_DUB_RESPONSE_LIMIT = 0x24,
115  JARULE_CMD_GET_RDM_DUB_RESPONSE_LIMIT = 0x25,
116  JARULE_CMD_SET_RDM_RESPONDER_DELAY = 0x26,
117  JARULE_CMD_GET_RDM_RESPONDER_DELAY = 0x27,
118  JARULE_CMD_SET_RDM_RESPONDER_JITTER = 0x28,
119  JARULE_CMD_GET_RDM_RESPONDER_JITTER = 0x29,
120  JARULE_CMD_TX_DMX = 0x30,
121  JARULE_CMD_RDM_DUB_REQUEST = 0x40,
122  JARULE_CMD_RDM_REQUEST = 0x41,
123  JARULE_CMD_RDM_BROADCAST_REQUEST = 0x42,
124 
125  // Experimental / testing
126  JARULE_CMD_ECHO = 0xf0,
127  JARULE_CMD_GET_FLAGS = 0xf2,
128 } CommandClass;
129 
133 typedef enum {
136 
143 
152 
155 
168 
169 
170 std::ostream& operator<<(std::ostream& os, const USBCommandResult &result);
171 std::ostream& operator<<(std::ostream& os, const CommandClass &command_class);
172 std::ostream& operator<<(std::ostream& os, const JaRuleReturnCode &rc);
173 
174 } // namespace usb
175 } // namespace ola
176 
177 #endif // LIBS_USB_JARULECONSTANTS_H_
No RDM response was received.
Definition: JaRuleConstants.h:142
USBCommandResult
Indicates the eventual state of a Ja Rule command.
Definition: JaRuleConstants.h:53
The command was not sent as the TX queue was full.
Definition: JaRuleConstants.h:75
The command is malformed.
Definition: JaRuleConstants.h:65
The command is invalid in the current mode.
Definition: JaRuleConstants.h:151
DMX/RDM Controller mode.
Definition: JaRuleConstants.h:43
CommandClass
The Ja Rule command set.
Definition: JaRuleConstants.h:101
JaRulePortMode
Ja Rule Port modes.
Definition: JaRuleConstants.h:42
The command completed successfully.
Definition: JaRuleConstants.h:134
JaRuleReturnCode
JaRule command return codes.
Definition: JaRuleConstants.h:133
The command was cancelled.
Definition: JaRuleConstants.h:90
The base class for all 4 argument callbacks.
Definition: Callback.h:3811
The command class returned did not match the request.
Definition: JaRuleConstants.h:85
DMX/RDM Responder mode.
Definition: JaRuleConstants.h:44
The command was sent but no response was received.
Definition: JaRuleConstants.h:80
ola::BaseCallback4< void, USBCommandResult, JaRuleReturnCode, uint8_t, const ola::io::ByteString & > CommandCompleteCallback
A command completion callback.
Definition: JaRuleConstants.h:167
Invalid port.
Definition: JaRuleConstants.h:95
One past the last valid return code.
Definition: JaRuleConstants.h:153
Flags have changed.
Definition: JaRuleConstants.h:35
Data was received in response to a broadcast RDM command.
Definition: JaRuleConstants.h:149
Unknown command.
Definition: JaRuleConstants.h:135
The command was malformed.
Definition: JaRuleConstants.h:140
An invalid RDM response was received.
Definition: JaRuleConstants.h:150
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
std::basic_string< uint8_t > ByteString
A contiguous block of uint8_t data.
Definition: ByteString.h:40
The command was sent and a response was received.
Definition: JaRuleConstants.h:57
JaRuleStatusFlags
Ja Rule status flags.
Definition: JaRuleConstants.h:34
The command could not be completed due to a full memory buffer.
Definition: JaRuleConstants.h:139
There was an error during transceiver transmit.
Definition: JaRuleConstants.h:141
An error occurred when trying to send the command.
Definition: JaRuleConstants.h:70
The message has been truncated.
Definition: JaRuleConstants.h:36
Self test mode.
Definition: JaRuleConstants.h:45