Lines Matching refs:hSession
32 HSession hSession = (HSession)stream->data; in ReadUSB() local
33 HdcSessionBase *hSessionBase = (HdcSessionBase *)hSession->classInstance; in ReadUSB()
34 if (hSessionBase->FetchIOBuf(hSession, hSession->ioBuf, nread) < 0) { in ReadUSB()
35 hSessionBase->FreeSession(hSession->sessionId); in ReadUSB()
39 bool HdcUSBBase::ReadyForWorkThread(HSession hSession) in ReadyForWorkThread() argument
43 if (uv_tcp_init(&hSession->childLoop, &hSession->dataPipe[STREAM_WORK]) || in ReadyForWorkThread()
44 uv_tcp_open(&hSession->dataPipe[STREAM_WORK], hSession->dataFd[STREAM_WORK])) { in ReadyForWorkThread()
48 hSession->dataPipe[STREAM_WORK].data = hSession; in ReadyForWorkThread()
49 HdcSessionBase *pSession = (HdcSessionBase *)hSession->classInstance; in ReadyForWorkThread()
50 Base::SetTcpOptions(&hSession->dataPipe[STREAM_WORK]); in ReadyForWorkThread()
51 …if (uv_read_start((uv_stream_t *)&hSession->dataPipe[STREAM_WORK], pSession->AllocCallback, ReadUS… in ReadyForWorkThread()
56 hSession->dataFd[STREAM_WORK]); in ReadyForWorkThread()
76 int HdcUSBBase::SendUSBBlock(HSession hSession, uint8_t *data, const int length) in SendUSBBlock() argument
81 std::lock_guard<std::mutex> lock(hSession->hUSB->lockSendUsbBlock); in SendUSBBlock()
82 auto header = BuildPacketHeader(hSession->sessionId, USB_OPTION_HEADER, length); in SendUSBBlock()
84 if ((SendUSBRaw(hSession, header.data(), header.size())) <= 0) { in SendUSBBlock()
88 if ((childRet = SendUSBRaw(hSession, data, length)) <= 0) { in SendUSBBlock()
92 if (childRet > 0 && (childRet % hSession->hUSB->wMaxPacketSizeSend == 0)) { in SendUSBBlock()
95 auto dummy = BuildPacketHeader(hSession->sessionId, 0, 0); in SendUSBBlock()
96 if ((SendUSBRaw(hSession, dummy.data(), dummy.size())) <= 0) { in SendUSBBlock()
132 void HdcUSBBase::PreSendUsbSoftReset(HSession hSession, uint32_t sessionIdOld) in PreSendUsbSoftReset() argument
135 HUSB hUSB = hSession->hUSB; in PreSendUsbSoftReset()
136 if (hSession->serverOrDaemon && !hUSB->resetIO) { in PreSendUsbSoftReset()
140 if (SendUSBRaw(hSession, header.data(), header.size()) <= 0) { in PreSendUsbSoftReset()
148 int HdcUSBBase::CheckPacketOption(HSession hSession, uint8_t *appendData, int dataSize) in CheckPacketOption() argument
150 HUSB hUSB = hSession->hUSB; in CheckPacketOption()
155 if (header->sessionId != hSession->sessionId) { in CheckPacketOption()
162 header->sessionId, hSession->sessionId); in CheckPacketOption()
163 PreSendUsbSoftReset(hSession, header->sessionId); in CheckPacketOption()
175 int HdcUSBBase::SendToHdcStream(HSession hSession, uv_stream_t *stream, uint8_t *appendData, int da… in SendToHdcStream() argument
179 HUSB hUSB = hSession->hUSB; in SendToHdcStream()
181 return CheckPacketOption(hSession, appendData, dataSize); in SendToHdcStream()
187 PreSendUsbSoftReset(hSession, 0); // 0 == reset current in SendToHdcStream()