本文整理汇总了C++中ola::DmxBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ ola::DmxBuffer方法的具体用法?C++ ola::DmxBuffer怎么用?C++ ola::DmxBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ola
的用法示例。
在下文中一共展示了ola::DmxBuffer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testStringToDmx
/*
* Test the StringToDmx function
*/
void DmxBufferTest::testStringToDmx() {
string input = "1,2,3,4";
uint8_t expected1[] = {1, 2, 3, 4};
runStringToDmx(input, DmxBuffer(expected1, sizeof(expected1)));
input = "a,b,c,d";
uint8_t expected2[] = {0, 0, 0, 0};
runStringToDmx(input, DmxBuffer(expected2, sizeof(expected2)));
input = "a,b,c,";
uint8_t expected3[] = {0, 0, 0, 0};
runStringToDmx(input, DmxBuffer(expected3, sizeof(expected3)));
input = "255,,,";
uint8_t expected4[] = {255, 0, 0, 0};
runStringToDmx(input, DmxBuffer(expected4, sizeof(expected4)));
input = "255,,,10";
uint8_t expected5[] = {255, 0, 0, 10};
runStringToDmx(input, DmxBuffer(expected5, sizeof(expected5)));
input = " 266,,,10 ";
uint8_t expected6[] = {10, 0, 0, 10};
runStringToDmx(input, DmxBuffer(expected6, sizeof(expected6)));
input = "";
uint8_t expected7[] = {};
runStringToDmx(input, DmxBuffer(expected7, sizeof(expected7)));
}
示例2: s1
DmxBuffer buffer;
buffer.SetRangeToValue(0, value, ola::DMX_UNIVERSE_SIZE);
return buffer;
}
TestState s1("Single Source Send",
new NodeSimpleSend(20),
new NodeInactive(),
"512 x 20",
BufferFromValue(20));
TestState s2("Single Source Timeout",
new NodeInactive(),
new NodeInactive(),
"Loss of data after 2.5s",
DmxBuffer());
TestState s3("Single Source Send",
new NodeSimpleSend(10),
new NodeInactive(),
"512 x 10",
BufferFromValue(10));
TestState s4("Single Source Terminate",
new NodeTerminate(),
new NodeInactive(),
"Immediate loss of data",
DmxBuffer());
TestState s5("Single Source Send",
new NodeSimpleSend(30),
new NodeInactive(),
"512 x 30",
BufferFromValue(30));
示例3: Check
void Check(SimpleRpcController *controller,
ola::proto::DmxData *reply) {
OLA_ASSERT_FALSE(controller->Failed());
OLA_ASSERT(DmxBuffer(SAMPLE_DMX_DATA, sizeof(SAMPLE_DMX_DATA)) ==
DmxBuffer(reply->data()));
}