Lines Matching refs:hUSB
149 int HdcDaemonUSB::ConnectEPPoint(HUSB hUSB)
180 if ((hUSB->bulkOut = open(outPath.c_str(), O_RDWR)) < 0) {
185 if ((hUSB->bulkIn = open(inPath.c_str(), O_RDWR)) < 0) {
191 fcntl(hUSB->bulkOut, F_SETFD, FD_CLOEXEC);
192 fcntl(hUSB->bulkIn, F_SETFD, FD_CLOEXEC);
193 hUSB->wMaxPacketSizeSend = GetMaxPacketSize(hUSB->bulkIn);
195 WRITE_LOG(LOG_DEBUG, "New bulk in\\out open bulkout:%d bulkin:%d", hUSB->bulkOut, hUSB->bulkIn);
200 CloseEndpoint(hUSB, true);
205 void HdcDaemonUSB::CloseEndpoint(HUSB hUSB, bool closeCtrlEp)
207 Base::CloseFd(hUSB->bulkIn);
208 Base::CloseFd(hUSB->bulkOut);
587 auto hUSB = reinterpret_cast<HUSB>(ctxIo->data);
594 if (bytesIOBytes > hUSB->wMaxPacketSizeSend && bytesIOBytes != thisClass->saveNextReadSize) {
640 int nextReadSize = childRet == 0 ? hUSB->wMaxPacketSizeSend : std::min(childRet, Base::GetUsbffsBulkSize());
642 if (thisClass->LoopUSBRead(hUSB, nextReadSize) < 0) {
656 int HdcDaemonUSB::LoopUSBRead(HUSB hUSB, int readMaxWanted)
666 ctxRecv.data = hUSB;
672 ret = uv_fs_read(&daemon->loopMain, req, hUSB->bulkOut, &iov, 1, -1, OnUSBRead);
685 HUSB hUSB = &thisClass->usbHandle;
692 if (hUSB->bulkIn > 0) {
697 if (hUSB->bulkOut > 0) {
711 if (thisClass->ConnectEPPoint(hUSB) != RET_SUCCESS) {
717 thisClass->LoopUSBRead(hUSB, hUSB->wMaxPacketSizeSend);