mirror of
https://gitee.com/openharmony/developtools_hdc
synced 2024-11-23 07:02:43 +00:00
commit
40d8610ee6
@ -611,6 +611,11 @@ void HdcHostUSB::BeginUsbRead(HSession hSession)
|
||||
--hSession->ref;
|
||||
auto server = reinterpret_cast<HdcServer *>(clsMainBase);
|
||||
hUSB->hostBulkIn.isShutdown = true;
|
||||
if (server != nullptr && server->clsServerForClient != nullptr) {
|
||||
HdcServerForClient *sfc = (HdcServerForClient *)server->clsServerForClient;
|
||||
const string msg("[Fail][E001003] USB communication abnormal, please check the USB communication link.");
|
||||
sfc->EchoToAllChannelsViaSessionId(hSession->sessionId, msg);
|
||||
}
|
||||
server->FreeSession(hSession->sessionId);
|
||||
RemoveIgnoreDevice(hUSB->usbMountPoint);
|
||||
WRITE_LOG(LOG_INFO, "Usb loop read finish sid:%u", hSession->sessionId);
|
||||
@ -660,12 +665,6 @@ int HdcHostUSB::SendUSBRaw(HSession hSession, uint8_t *data, const int length)
|
||||
WRITE_LOG(LOG_FATAL, "Send usb failed, sid:%u ret:%d", hSession->sessionId, ret);
|
||||
CancelUsbIo(hSession);
|
||||
hSession->hUSB->hostBulkOut.isShutdown = true;
|
||||
HdcServer* serverClass = (HdcServer *)server;
|
||||
if (serverClass != nullptr && serverClass->clsServerForClient != nullptr) {
|
||||
HdcServerForClient *sfc = (HdcServerForClient *)serverClass->clsServerForClient;
|
||||
const string msg("[Fail][E001003] USB communication abnormal, please check the USB communication link.");
|
||||
sfc->EchoToAllChannelsViaSessionId(hSession->sessionId, msg);
|
||||
}
|
||||
server->FreeSession(hSession->sessionId);
|
||||
}
|
||||
--hSession->ref;
|
||||
|
Loading…
Reference in New Issue
Block a user