9#ifndef Oculus_PrimeSerialInterface_DEFINED
10#define Oculus_PrimeSerialInterface_DEFINED
14#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
17#pragma clang diagnostic push
18#pragma clang diagnostic ignored "-Wreserved-id-macro"
20#pragma clang diagnostic pop
46#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
61#define SV std::vector<std::string>
62#define PARSER(s, c, p) if (k.compare(s) == 0) { set_##c ( p ); continue; }
63#define ARRAY_PARSER(s, c, p) if (k.compare(s) == 0) \
65 SV kk = components_of_string_separated(v, ARRAY_DEL, true); \
66 for(size_t n = 0; n < kk.size(); n++) \
67 { v = kk.at(n); _##c[n] = p; _##c##_mask = 1; } \
70#define COMP(v, s) v.compare(0, 2, s) == 0
72#define PARSE_UINT8 static_cast<uint8_t>(atoi(v.c_str()))
79 SV sn = components_of_string_separated(str,
DELIMITER,
true);
80 for(
size_t i = 0; i < sn.size(); i++)
82 SV kv = components_of_string_separated(sn.at(i),
SEP,
true);
85 fprintf(stderr,
"parse error\n");
88 std::string k = kv.at(0);
89 std::string v = kv.at(1);
110 std::stringstream ss;
112 <<
static_cast<int>(forward()[0]) <<
" " <<
static_cast<int>(forward()[1]) <<
" forward : , ";
#define ARRAY_PARSER(s, c, p)
Serial interface for the main oculus prime board.
Oculus_PrimeSerialInterface()
default constructor
std::string description() const
pretty print method for showing the current property values
void from_string(const std::string &str)
parse class properties from a string
Oculus_PrimeSerialInterface(const std::string &str)
string constructor (see from_string() below)
/file wb_oculus_prime_serial.h