Skip to content

Commit 0b27b6e

Browse files
authored
Merge pull request #1945 from peternewman/e1.33-cherry-pick
E1.33 cherry pick the second
2 parents e7b4039 + 274e2c7 commit 0b27b6e

34 files changed

+792
-39
lines changed

include/ola/acn/ACNPort.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ const uint16_t ACN_PORT = 5568;
6161
*/
6262
const uint16_t E133_PORT = 5569;
6363

64+
/**
65+
* @brief The port used for E1.33 LLRP communication.
66+
*/
67+
const uint16_t LLRP_PORT = 5569;
68+
6469
/**
6570
* @}
6671
*/

include/ola/acn/ACNVectors.h

Lines changed: 125 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ namespace acn {
4343
* @brief ACN vectors used at the root layer.
4444
*/
4545
enum RootVector {
46-
VECTOR_ROOT_E131_REV2 = 3, /**< Draft E1.31, used by some old gear. */
47-
VECTOR_ROOT_E131 = 4, /**< E1.31 (sACN) */
48-
VECTOR_ROOT_RPT = 5, /**< E1.33 (RPT) */
49-
VECTOR_ROOT_NULL = 6, /**< NULL (empty) root */
50-
VECTOR_ROOT_BROKER = 9, /**< E1.33 (Broker) */
51-
VECTOR_ROOT_LLRP = 0x0A, /**< E1.33 (LLRP) */
52-
VECTOR_ROOT_EPT = 0x0B, /**< E1.33 (EPT) */
46+
/** @brief Draft E1.31, used by some old gear. */
47+
VECTOR_ROOT_E131_REV2 = 0x00000003,
48+
VECTOR_ROOT_E131 = 0x00000004, /**< E1.31 (sACN) */
49+
VECTOR_ROOT_RPT = 0x00000005, /**< E1.33 (RPT) */
50+
VECTOR_ROOT_NULL = 0x00000006, /**< NULL (empty) root */
51+
VECTOR_ROOT_BROKER = 0x00000009, /**< E1.33 (Broker) */
52+
VECTOR_ROOT_LLRP = 0x0000000A, /**< E1.33 (LLRP) */
53+
VECTOR_ROOT_EPT = 0x0000000B, /**< E1.33 (EPT) */
5354
};
5455

5556
/**
@@ -94,9 +95,123 @@ enum E133ControllerVector {
9495
* @brief Vectors used at the E1.33 LLRP layer.
9596
*/
9697
enum LLRPVector {
97-
VECTOR_LLRP_PROBE_REQUEST = 1, /**< LLRP Probe Request */
98-
VECTOR_LLRP_PROBE_REPLY = 1, /**< LLRP Probe Reply */
99-
VECTOR_LLRP_RDM_CMD = 1, /**< LLRP RDM Command */
98+
VECTOR_LLRP_PROBE_REQUEST = 0x00000001, /**< LLRP Probe Request */
99+
VECTOR_LLRP_PROBE_REPLY = 0x00000002, /**< LLRP Probe Reply */
100+
VECTOR_LLRP_RDM_CMD = 0x00000003, /**< LLRP RDM Command */
101+
};
102+
103+
/**
104+
* @brief Vectors used at the E1.33 Broker layer.
105+
*/
106+
enum BrokerVector {
107+
VECTOR_BROKER_CONNECT = 0x0001, /**< Broker Client Connect */
108+
VECTOR_BROKER_CONNECT_REPLY = 0x0002, /**< Broker Connect Reply */
109+
110+
/** @brief Broker Client Entry Update */
111+
VECTOR_BROKER_CLIENT_ENTRY_UPDATE = 0x0003,
112+
113+
VECTOR_BROKER_REDIRECT_V4 = 0x0004, /**< Broker Client Redirect IPv4 */
114+
VECTOR_BROKER_REDIRECT_V6 = 0x0005, /**< Broker Client Redirect IPv6 */
115+
VECTOR_BROKER_FETCH_CLIENT_LIST = 0x0006, /**< Broker Fetch Client List */
116+
117+
/** @brief Broker Connected Client List */
118+
VECTOR_BROKER_CONNECTED_CLIENT_LIST = 0x0007,
119+
120+
/** @brief Broker Client Incremental Addition */
121+
VECTOR_BROKER_CLIENT_ADD = 0x0008,
122+
123+
/** @brief Broker Client Incremental Deletion */
124+
VECTOR_BROKER_CLIENT_REMOVE = 0x0009,
125+
126+
/** @brief Broker Client Entry Change */
127+
VECTOR_BROKER_CLIENT_ENTRY_CHANGE = 0x000A,
128+
129+
/** @brief Broker Request Dynamic UID Assignment */
130+
VECTOR_BROKER_REQUEST_DYNAMIC_UIDS = 0x000B,
131+
132+
/** @brief Broker Dynamic UID Assignment List */
133+
VECTOR_BROKER_ASSIGNED_DYNAMIC_UIDS = 0x000C,
134+
135+
/** @brief Broker Fetch Dynamic UID Assignment List */
136+
VECTOR_BROKER_FETCH_DYNAMIC_UID_LIST = 0x000D,
137+
138+
VECTOR_BROKER_DISCONNECT = 0x000E, /**< Broker Client Disconnect */
139+
VECTOR_BROKER_NULL = 0x000F, /**< Broker Client Null */
140+
};
141+
142+
// Table A-8, RPT PDU Vector
143+
/**
144+
* @brief Vectors used at the E1.33 RPT layer.
145+
*/
146+
enum RPTVector {
147+
VECTOR_RPT_REQUEST = 0x00000001, /**< RPT Request */
148+
VECTOR_RPT_STATUS = 0x00000002, /**< RPT Status */
149+
VECTOR_RPT_NOTIFICATION = 0x00000003, /**< RPT Notification */
150+
};
151+
152+
// Table A-9, RPT Request PDU Vector
153+
/**
154+
* @brief Vectors used at the E1.33 RPT Request layer.
155+
*/
156+
enum RPTRequestVector {
157+
VECTOR_REQUEST_RDM_CMD = 0x01, /**< RPT Request RDM Command */
158+
};
159+
160+
// Table A-10, RPT Status PDU Vector
161+
/**
162+
* @brief Vectors used at the E1.33 RPT Status layer.
163+
*/
164+
enum RPTStatusVector {
165+
/** @brief RPT Status Unknown RPT UID */
166+
VECTOR_RPT_STATUS_UNKNOWN_RPT_UID = 0x0001,
167+
168+
VECTOR_RPT_STATUS_RDM_TIMEOUT = 0x0002, /**< RPT Status RDM Timeout */
169+
170+
/** @brief RPT Status RDM Invalid Response */
171+
VECTOR_RPT_STATUS_RDM_INVALID_RESPONSE = 0x0003,
172+
173+
/** @brief RPT Status Unknown RDM UID */
174+
VECTOR_RPT_STATUS_UNKNOWN_RDM_UID = 0x0004,
175+
176+
/** @brief RPT Status Unknown Endpoint */
177+
VECTOR_RPT_STATUS_UNKNOWN_ENDPOINT = 0x0005,
178+
179+
/** @brief RPT Status Broadcast Complete */
180+
VECTOR_RPT_STATUS_BROADCAST_COMPLETE = 0x0006,
181+
182+
VECTOR_RPT_STATUS_UNKNOWN_VECTOR = 0x0007, /**< RPT Status Unknown Vector */
183+
184+
/** @brief RPT Status Invalid Message */
185+
VECTOR_RPT_STATUS_INVALID_MESSAGE = 0x0008,
186+
187+
/** @brief RPT Status Invalid Command Class */
188+
VECTOR_RPT_STATUS_INVALID_COMMAND_CLASS = 0x0009,
189+
};
190+
191+
// Table A-11, RPT Notification PDU Vector
192+
/**
193+
* @brief Vectors used at the E1.33 RPT Notification layer.
194+
*/
195+
enum RPTNotificationVector {
196+
VECTOR_NOTIFICATION_RDM_CMD = 0x01, /**< RPT Notification RDM Command */
197+
};
198+
199+
/**
200+
* @brief Vectors used at the E1.33 RDM Command layer.
201+
*/
202+
enum RDMCommandVector {
203+
VECTOR_RDM_CMD_RDM_DATA = 0xCC, /**< E1.33 RDM Command */
204+
};
205+
206+
// Table A-21, Client Protocol Codes
207+
// These aren't fully named as vectors in the standard, but are used as such so
208+
// we put them in here
209+
/**
210+
* @brief Vectors used at the E1.33 Broker Client Entry layer.
211+
*/
212+
enum ClientProtocolCode {
213+
CLIENT_PROTOCOL_RPT = 0x00000005, /**< Broker RPT Client Entry */
214+
CLIENT_PROTOCOL_EPT = 0x0000000B, /**< Broker EPT Client Entry */
100215
};
101216

102217
/**

include/ola/acn/CID.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ class CID {
8989
*/
9090
std::string ToString() const;
9191

92+
/**
93+
* @brief A helper function to write a CID to an ostream.
94+
* @param out the ostream
95+
* @param cid the CID to write.
96+
*/
97+
friend std::ostream& operator<< (std::ostream &out, const CID &cid) {
98+
return out << cid.ToString();
99+
}
100+
92101
/**
93102
* @brief Write the CID to an OutputBufferInterface
94103
*/
@@ -132,6 +141,10 @@ class CID {
132141
*/
133142
static CID FromString(const std::string &cid);
134143

144+
static CID LLRPBroadcastCID() {
145+
return FromString("FBAD822C-BD0C-4D4C-BDC8-7EABEBC85AFF");
146+
}
147+
135148
private:
136149
class CIDImpl *m_impl;
137150

include/ola/e133/DeviceManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class DeviceManager {
5353
* @returns true if the data should be acknowledged, false otherwise.
5454
*/
5555
typedef ola::Callback3<bool, const IPV4Address&, uint16_t,
56-
const string&> RDMMesssageCallback;
56+
const string&> RDMMessageCallback;
5757

5858
// Run when we acquire designated controller status for a device.
5959
typedef ola::Callback1<void, const IPV4Address&> AcquireDeviceCallback;
@@ -66,7 +66,7 @@ class DeviceManager {
6666
~DeviceManager();
6767

6868
// Ownership of the callbacks is transferred.
69-
void SetRDMMessageCallback(RDMMesssageCallback *callback);
69+
void SetRDMMessageCallback(RDMMessageCallback *callback);
7070
void SetAcquireDeviceCallback(AcquireDeviceCallback *callback);
7171
void SetReleaseDeviceCallback(ReleaseDeviceCallback *callback);
7272

include/ola/e133/E133Enums.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ enum EndpointMode {
3939
ENDPOINT_MODE_OUTPUT = 2,
4040
};
4141

42+
// TODO(Peter): Check that this no longer exists
4243
// Table A-9 E1.33 Status Codes
4344
enum E133StatusCode {
4445
SC_E133_ACK = 0x0000,
@@ -53,6 +54,44 @@ enum E133StatusCode {
5354
SC_E133_BROADCAST_COMPLETE = 0x0009,
5455
};
5556

57+
// Table A-19 E1.33 Connection Status Codes for Broker Connect
58+
enum E133ConnectStatusCode {
59+
CONNECT_OK = 0x0000,
60+
CONNECT_SCOPE_MISMATCH = 0x0001,
61+
CONNECT_CAPACITY_EXCEEDED = 0x0002,
62+
CONNECT_DUPLICATE_UID = 0x0003,
63+
CONNECT_INVALID_CLIENT_ENTRY = 0x0004,
64+
CONNECT_INVALID_UID = 0x0005,
65+
};
66+
67+
// Table A-20 E1.33 Status Codes for Dynamic UID Mapping
68+
enum E133DynamicUIDStatusCode {
69+
DYNAMIC_UID_STATUS_OK = 0x0000,
70+
DYNAMIC_UID_STATUS_INVALID_REQUEST = 0x0001,
71+
DYNAMIC_UID_STATUS_UID_NOT_FOUND = 0x0002,
72+
DYNAMIC_UID_STATUS_DUPLICATE_RID = 0x0003,
73+
DYNAMIC_UID_STATUS_CAPACITY_EXHAUSTED = 0x0004,
74+
};
75+
76+
// Table A-22 E1.33 RPT Client Type Codes
77+
enum E133RPTClientTypeCode {
78+
RPT_CLIENT_TYPE_DEVICE = 0x00,
79+
RPT_CLIENT_TYPE_CONTROLLER = 0x01,
80+
};
81+
82+
// Table A-24 E1.33 Client Disconnect Reason Codes
83+
enum E133DisconnectStatusCode {
84+
DISCONNECT_SHUTDOWN = 0x0000,
85+
DISCONNECT_CAPACITY_EXHAUSTED = 0x0001,
86+
DISCONNECT_HARDWARE_FAULT = 0x0002,
87+
DISCONNECT_SOFTWARE_FAULT = 0x0003,
88+
DISCONNECT_SOFTWARE_RESET = 0x0004,
89+
DISCONNECT_INCORRECT_SCOPE = 0x0005,
90+
DISCONNECT_RPT_RECONFIGURE = 0x0006,
91+
DISCONNECT_LLRP_RECONFIGURE = 0x0007,
92+
DISCONNECT_USER_RECONFIGURE = 0x0008,
93+
};
94+
5695
// The max size of an E1.33 Status string.
5796
enum {
5897
MAX_E133_STATUS_STRING_SIZE = 64

include/ola/e133/E133Helper.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
* E133Helper.h
17+
* Various misc E1.33 functions.
18+
* Copyright (C) 2024 Peter Newman
19+
*/
20+
21+
#ifndef INCLUDE_OLA_E133_E133HELPER_H_
22+
#define INCLUDE_OLA_E133_E133HELPER_H_
23+
24+
#include <stdint.h>
25+
#include <ola/e133/E133Enums.h>
26+
#include <string>
27+
28+
namespace ola {
29+
namespace e133 {
30+
31+
bool IntToRPTClientType(uint8_t input,
32+
ola::e133::E133RPTClientTypeCode *client_type);
33+
std::string RPTClientTypeToString(uint8_t type);
34+
} // namespace e133
35+
} // namespace ola
36+
#endif // INCLUDE_OLA_E133_E133HELPER_H_

include/ola/e133/E133StatusHelper.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ namespace e133 {
3030

3131
using std::string;
3232
using ola::e133::E133StatusCode;
33+
using ola::e133::E133ConnectStatusCode;
3334

3435
bool IntToStatusCode(uint16_t input, E133StatusCode *status_code);
3536
string StatusCodeToString(E133StatusCode status_code);
37+
38+
bool IntToConnectStatusCode(uint16_t input,
39+
E133ConnectStatusCode *connect_status_code);
40+
string ConnectStatusCodeToString(E133ConnectStatusCode connect_status_code);
3641
} // namespace e133
3742
} // namespace ola
3843
#endif // INCLUDE_OLA_E133_E133STATUSHELPER_H_

include/ola/e133/Makefile.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ if INSTALL_E133
44
olae133include_HEADERS = \
55
include/ola/e133/DeviceManager.h \
66
include/ola/e133/E133Enums.h \
7+
include/ola/e133/E133Helper.h \
78
include/ola/e133/E133Receiver.h \
89
include/ola/e133/E133StatusHelper.h \
910
include/ola/e133/E133URLParser.h \

include/ola/network/AdvancedTCPConnector.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ class AdvancedTCPConnector {
8484
/**
8585
* @brief Return the number of connections tracked by this connector.
8686
*/
87-
unsigned int EndpointCount() const { return m_connections.size(); }
87+
unsigned int EndpointCount() const {
88+
return static_cast<unsigned int>(m_connections.size());
89+
}
8890

8991
/**
9092
* @brief The state of a connection.

include/ola/network/TCPConnector.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ class TCPConnector {
9898
/**
9999
* @brief Return the number of pending connections
100100
*/
101-
unsigned int ConnectionsPending() const { return m_connections.size(); }
101+
unsigned int ConnectionsPending() const {
102+
return static_cast<unsigned int>(m_connections.size());
103+
}
102104

103105
/**
104106
* @brief Called when the TCP socket connects.

0 commit comments

Comments
 (0)