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

Method receive

src/command_transaction.cpp:103–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103bool CommandTransaction::receive(CommandTransaction::Result& result, uint32_t min_length)
104{
105 int length = 0;
106
107 int r = libusb_bulk_transfer(handle_, inbound_endpoint_, &result[0], result.size(), &length, timeout_);
108 result.resize(length);
109
110 if(r != LIBUSB_SUCCESS)
111 {
112 LOG_ERROR << "bulk transfer failed: " << WRITE_LIBUSB_ERROR(r);
113 return false;
114 }
115
116 if ((uint32_t)length < min_length)
117 {
118 LOG_ERROR << "bulk transfer too short! expected at least: " << min_length << " got : " << length;
119 return false;
120 }
121
122 return true;
123}
124
125bool CommandTransaction::isResponseCompleteResult(CommandTransaction::Result& result, uint32_t sequence)
126{

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected