Open Lighting Architecture
0.9.6
Main Page
Modules
Related Pages
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
ola
rdm
RDMCommandSerializer.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
* RDMCommandSerializer.h
17
* Write RDMCommands to a memory buffer.
18
* Copyright (C) 2012 Simon Newton
19
*/
20
29
#ifndef INCLUDE_OLA_RDM_RDMCOMMANDSERIALIZER_H_
30
#define INCLUDE_OLA_RDM_RDMCOMMANDSERIALIZER_H_
31
32
#include <stdint.h>
33
#include <ola/io/ByteString.h>
34
#include <ola/io/IOStack.h>
35
#include <
ola/rdm/RDMCommand.h
>
36
#include <
ola/rdm/UID.h
>
37
38
namespace
ola {
39
namespace
rdm {
40
41
49
class
RDMCommandSerializer
{
50
public
:
57
static
bool
Pack
(
const
RDMCommand
&command,
58
ola::io::ByteString
*output);
59
66
static
bool
PackWithStartCode
(
const
RDMCommand
&command,
67
ola::io::ByteString
*output);
68
76
static
unsigned
int
RequiredSize
(
const
RDMCommand
&command);
77
88
static
bool
Pack
(
const
RDMCommand
&command,
89
uint8_t *buffer,
90
unsigned
int
*size);
91
92
// TODO(simon): Add IOQueue Write() method here
93
101
static
bool
Write
(
const
RDMCommand
&command,
ola::io::IOStack
*stack);
102
106
enum
{ MAX_PARAM_DATA_LENGTH = 231 };
107
108
private
:
109
static
const
unsigned
int
CHECKSUM_LENGTH = 2;
110
111
static
void
PopulateHeader(
RDMCommandHeader
*header,
112
const
RDMCommand
&command);
113
};
114
}
// namespace rdm
115
}
// namespace ola
116
#endif // INCLUDE_OLA_RDM_RDMCOMMANDSERIALIZER_H_
Generated on Fri Jul 3 2015 15:58:45 for Open Lighting Architecture by
1.8.1.2