Open Lighting Architecture: include/ola/e133/MessageBuilder.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
MessageBuilder.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 * MessageBuilder.h
17 * Copyright (C) 2013 Simon Newton
18 *
19 * A class to simplify some of the E1.33 packet building operations.
20 */
21
22#ifndef INCLUDE_OLA_E133_MESSAGEBUILDER_H_
23#define INCLUDE_OLA_E133_MESSAGEBUILDER_H_
24
25#include <ola/acn/CID.h>
26#include <ola/base/Macro.h>
27#include <ola/e133/E133Enums.h>
28#include <ola/io/IOStack.h>
29#include <ola/io/MemoryBlockPool.h>
30#include <string>
31
32namespace ola {
33namespace e133 {
34
35using ola::acn::CID;
36using ola::io::IOStack;
37using std::string;
38
42 class MessageBuilder {
43 public:
44 MessageBuilder(const CID &cid, const string &source_name);
45 ~MessageBuilder() {}
46
47 void PrependRDMHeader(IOStack *packet);
48
49 void BuildNullTCPPacket(IOStack *packet);
50
51 void BuildTCPE133StatusPDU(IOStack *packet,
52 uint32_t sequence_number, uint16_t endpoint_id,
53 ola::e133::E133StatusCode status_code,
54 const string &description);
55 void BuildUDPE133StatusPDU(IOStack *packet,
56 uint32_t sequence_number, uint16_t endpoint_id,
57 ola::e133::E133StatusCode status_code,
58 const string &description);
59
60 void BuildTCPRootE133(IOStack *packet, uint32_t vector,
61 uint32_t sequence_number, uint16_t endpoint_id);
62 void BuildUDPRootE133(IOStack *packet, uint32_t vector,
63 uint32_t sequence_number, uint16_t endpoint_id);
64
65 ola::io::MemoryBlockPool *pool() { return &m_memory_pool; }
66
67 private:
68 const CID m_cid;
69 const string m_source_name;
70 ola::io::MemoryBlockPool m_memory_pool;
71
72 MessageBuilder(const MessageBuilder &) = delete;
73 const MessageBuilder &operator=(const MessageBuilder &) = delete;
74};
75} // namespace e133
76} // namespace ola
77#endif // INCLUDE_OLA_E133_MESSAGEBUILDER_H_
CID.h
The ACN component identifier.
Macro.h
Helper macros.
ola::acn::CID
The ACN component identifier.
Definition CID.h:47
ola::io::IOStack
Definition IOStack.h:41
ola::io::MemoryBlockPool
MemoryBlockPool. This class is not thread safe.
Definition MemoryBlockPool.h:35
ola::e133
E1.33 (RDMNet).
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44