Open Lighting Architecture 0.10.9
Loading...
Searching...
No Matches
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
28namespace ola {
29namespace usb {
30
38
47
97
101typedef 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,
129
155
167 const ola::io::ByteString&> CommandCompleteCallback;
168
169
170std::ostream& operator<<(std::ostream& os, const USBCommandResult &result);
171std::ostream& operator<<(std::ostream& os, const CommandClass &command_class);
172std::ostream& operator<<(std::ostream& os, const JaRuleReturnCode &rc);
173
174} // namespace usb
175} // namespace ola
176
177#endif // LIBS_USB_JARULECONSTANTS_H_
The base class for all 4 argument callbacks.
Definition Callback.h:3811
ola::BaseCallback4< void, USBCommandResult, JaRuleReturnCode, uint8_t, const ola::io::ByteString & > CommandCompleteCallback
A command completion callback.
Definition JaRuleConstants.h:167
CommandClass
The Ja Rule command set.
Definition JaRuleConstants.h:101
USBCommandResult
Indicates the eventual state of a Ja Rule command.
Definition JaRuleConstants.h:53
@ COMMAND_RESULT_SEND_ERROR
An error occurred when trying to send the command.
Definition JaRuleConstants.h:70
@ COMMAND_RESULT_CLASS_MISMATCH
The command class returned did not match the request.
Definition JaRuleConstants.h:85
@ COMMAND_RESULT_TIMEOUT
The command was sent but no response was received.
Definition JaRuleConstants.h:80
@ COMMAND_RESULT_OK
The command was sent and a response was received.
Definition JaRuleConstants.h:57
@ COMMAND_RESULT_INVALID_PORT
Invalid port.
Definition JaRuleConstants.h:95
@ COMMAND_RESULT_MALFORMED
The command is malformed.
Definition JaRuleConstants.h:65
@ COMMAND_RESULT_CANCELLED
The command was cancelled.
Definition JaRuleConstants.h:90
@ COMMAND_RESULT_QUEUE_FULL
The command was not sent as the TX queue was full.
Definition JaRuleConstants.h:75
JaRuleReturnCode
JaRule command return codes.
Definition JaRuleConstants.h:133
@ RC_UNKNOWN
Unknown command.
Definition JaRuleConstants.h:135
@ RC_RDM_BCAST_RESPONSE
Data was received in response to a broadcast RDM command.
Definition JaRuleConstants.h:149
@ RC_RDM_TIMEOUT
No RDM response was received.
Definition JaRuleConstants.h:142
@ RC_LAST
One past the last valid return code.
Definition JaRuleConstants.h:153
@ RC_TX_ERROR
There was an error during transceiver transmit.
Definition JaRuleConstants.h:141
@ RC_BAD_PARAM
The command was malformed.
Definition JaRuleConstants.h:140
@ RC_RDM_INVALID_RESPONSE
An invalid RDM response was received.
Definition JaRuleConstants.h:150
@ RC_OK
The command completed successfully.
Definition JaRuleConstants.h:134
@ RC_BUFFER_FULL
The command could not be completed due to a full memory buffer.
Definition JaRuleConstants.h:139
@ RC_INVALID_MODE
The command is invalid in the current mode.
Definition JaRuleConstants.h:151
JaRulePortMode
Ja Rule Port modes.
Definition JaRuleConstants.h:42
@ SELF_TEST_MODE
Self test mode.
Definition JaRuleConstants.h:45
@ CONTROLLER_MODE
DMX/RDM Controller mode.
Definition JaRuleConstants.h:43
@ RESPONDER_MODE
DMX/RDM Responder mode.
Definition JaRuleConstants.h:44
JaRuleStatusFlags
Ja Rule status flags.
Definition JaRuleConstants.h:34
@ MSG_TRUNCATED_FLAG
The message has been truncated.
Definition JaRuleConstants.h:36
@ FLAGS_CHANGED_FLAG
Flags have changed.
Definition JaRuleConstants.h:35
The namespace containing all OLA symbols.
Definition Credentials.cpp:44