MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / execute

Method execute

src/command_transaction.cpp:50–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48CommandTransaction::~CommandTransaction() {}
49
50bool CommandTransaction::execute(const CommandBase& command, Result& result)
51{
52 result.resize(command.maxResponseLength());
53 response_complete_result_.resize(ResponseCompleteLength);
54
55 // send command
56 if (!send(command))
57 return false;
58
59 // receive response data
60 if(command.maxResponseLength() > 0)
61 {
62 if (!receive(result, command.minResponseLength()))
63 return false;
64 if (isResponseCompleteResult(result, command.sequence()))
65 {
66 LOG_ERROR << "received premature response complete!";
67 return false;
68 }
69 }
70
71 // receive response complete
72 if (!receive(response_complete_result_, ResponseCompleteLength))
73 return false;
74 if (!isResponseCompleteResult(response_complete_result_, command.sequence()))
75 {
76 LOG_ERROR << "missing response complete!";
77 return false;
78 }
79
80 return true;
81}
82
83bool CommandTransaction::send(const CommandBase& command)
84{

Callers

nothing calls this directly

Calls 3

maxResponseLengthMethod · 0.80
minResponseLengthMethod · 0.80
sequenceMethod · 0.80

Tested by

no test coverage detected