Lines Matching refs:sessionId

217 void HdcDaemonUSB::ResetOldSession(uint32_t sessionId, bool isSoftReset)
220 if (sessionId == 0) {
221 sessionId = currentSessionId;
223 HSession hSession = daemon->AdminSession(OP_QUERY, sessionId, nullptr);
225 WRITE_LOG(LOG_FATAL, "ResetOldSession hSession nullptr sessionId:%u", sessionId);
230 WRITE_LOG(LOG_WARN, "Hostside softreset to restart daemon, old sessionId:%u isSoftReset:%d",
231 sessionId, isSoftReset);
232 daemon->FreeSession(sessionId);
236 int HdcDaemonUSB::AvailablePacket(uint8_t *ioBuf, int ioBytes, uint32_t *sessionId)
245 uint32_t inSessionId = ntohl(usbPayloadHeader->sessionId);
253 *sessionId = inSessionId;
337 uint32_t sessionId = hSession->sessionId;
339 if (Base::IsSessionDeleted(sessionId)) {
340 WRITE_LOG(LOG_DEBUG, "SendUSBRaw session %u is deleted", sessionId);
347 daemon->FreeSession(hSession->sessionId);
354 void HdcDaemonUSB::OnNewHandshakeOK(const uint32_t sessionId)
356 currentSessionId = sessionId; // sync with server, and set server's real Id
362 WRITE_LOG(LOG_DEBUG, "OnSessionFreeFinally sid:%u currentsid:%u", hSession->sessionId, currentSessionId);
364 WRITE_LOG(LOG_INFO, "OnSessionFreeFinally sid:%u softreset", hSession->sessionId);
367 if (currentSessionId == hSession->sessionId) {
374 HSession HdcDaemonUSB::PrepareNewSession(uint32_t sessionId, uint8_t *pRecvBuf, int recvBytesIO)
378 HSession hChildSession = daemon->MallocSession(false, CONN_USB, this, sessionId);
380 WRITE_LOG(LOG_FATAL, "malloc session failed sessionId:%u", sessionId);
383 currentSessionId = sessionId;
391 hSessionInfo->sessionId = hChildSession->sessionId;
403 if (Base::IsSessionDeleted(hSessionInfo->sessionId)) {
534 int HdcDaemonUSB::DispatchToWorkThread(uint32_t sessionId, uint8_t *readBuf, int readBytes)
540 if (sessionId == 0) {
542 sessionId = currentSessionId;
544 if (currentSessionId != 0 && sessionId != currentSessionId) {
545 WRITE_LOG(LOG_WARN, "New session coming, restart old sessionId:%u", currentSessionId);
549 hChildSession = daemon->AdminSession(OP_QUERY, sessionId, nullptr);
551 hChildSession = PrepareNewSession(sessionId, readBuf, readBytes);
553 WRITE_LOG(LOG_WARN, "prep new session err for sessionId:%u", sessionId);
591 uint32_t sessionId = 0;
625 if ((childRet = thisClass->AvailablePacket((uint8_t *)bufPtr, bytesIOBytes, &sessionId)) != RET_SUCCESS) {
634 if ((childRet = thisClass->DispatchToWorkThread(sessionId, bufPtr, bytesIOBytes)) < 0) {