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

Method send

src/command_transaction.cpp:83–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83bool CommandTransaction::send(const CommandBase& command)
84{
85 int transferred_bytes = 0;
86 int r = libusb_bulk_transfer(handle_, outbound_endpoint_, const_cast<uint8_t *>(command.data()), command.size(), &transferred_bytes, timeout_);
87
88 if(r != LIBUSB_SUCCESS)
89 {
90 LOG_ERROR << "bulk transfer failed: " << WRITE_LIBUSB_ERROR(r);
91 return false;
92 }
93
94 if((size_t)transferred_bytes != command.size())
95 {
96 LOG_ERROR << "sent number of bytes differs from expected number! expected: " << command.size() << " got: " << transferred_bytes;
97 return false;
98 }
99
100 return true;
101}
102
103bool CommandTransaction::receive(CommandTransaction::Result& result, uint32_t min_length)
104{

Callers

nothing calls this directly

Calls 2

dataMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected