31 #include "MultiGetter.h"
35 #include <xplra/Protocol.h>
37 #include <hu/varadiistvan/scpl/io/DataStream.h>
52 MultiGetter::MultiGetter(
XPlane& xplane) noexcept :
53 MultiBuffer(xplane, Protocol::COMMAND_REGISTER_GET_MULTI,
54 Protocol::COMMAND_UNREGISTER_GET_MULTI)
60 inline void MultiGetter::read(
const DataRef& dataRef)
62 switch (dataRef.
type) {
63 case Protocol::TYPE_INT:
67 case Protocol::TYPE_FLOAT:
71 case Protocol::TYPE_DOUBLE:
75 case Protocol::TYPE_FLOAT_ARRAY:
76 case Protocol::TYPE_INT_ARRAY:
77 case Protocol::TYPE_BYTE_ARRAY:
81 length = min(length, dataRef.
length);
83 (dataRef.
type==Protocol::TYPE_FLOAT_ARRAY) ?
sizeof(
float) :
84 ((dataRef.
type==Protocol::TYPE_INT_ARRAY) ?
85 sizeof(int32_t) :
sizeof(uint8_t));
96 xplane.
stream->writeU8(Protocol::COMMAND_EXECUTE_GET_MULTI);
118 for(vector<DataRef>::const_iterator i =
dataRefs.begin();
void writeSpec(uint8_t command) const
std::vector< DataRef > dataRefs
virtual void doExecuteUnregistered()
void read(const DataRef &dataRef)
scpl::io::DataStream * stream
void checkResult(uint8_t result, bool hasParameter=false, long parameter=0)