mirror of
https://gitee.com/openharmony/developtools_hdc
synced 2024-11-23 23:20:43 +00:00
Merge pull request !1452 from kun chen/master
This commit is contained in:
commit
c3ed97c17b
@ -32,7 +32,7 @@ private:
|
|||||||
void CheckMaster(CtxFile *context) override;
|
void CheckMaster(CtxFile *context) override;
|
||||||
void WhenTransferFinish(CtxFile *context) override;
|
void WhenTransferFinish(CtxFile *context) override;
|
||||||
bool BeginTransfer(CtxFile *context, const string &command);
|
bool BeginTransfer(CtxFile *context, const string &command);
|
||||||
void TransferSummary(CtxFile *context) override;
|
void TransferSummary(CtxFile *context);
|
||||||
bool SetMasterParameters(CtxFile *context, const char *command, int argc, char **argv);
|
bool SetMasterParameters(CtxFile *context, const char *command, int argc, char **argv);
|
||||||
bool FileModeSync(const uint16_t cmd, uint8_t *payload, const int payloadSize);
|
bool FileModeSync(const uint16_t cmd, uint8_t *payload, const int payloadSize);
|
||||||
};
|
};
|
||||||
|
@ -202,19 +202,6 @@ out:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HdcTransferBase::Next(HdcTransferBase *thisClass, CtxFile *context)
|
|
||||||
{
|
|
||||||
if (context->isDir) {
|
|
||||||
uint8_t payload = 1;
|
|
||||||
uint16_t cmdFinish = (thisClass->commandBegin == CMD_FILE_BEGIN ? CMD_FILE_FINISH : CMD_APP_FINISH);
|
|
||||||
thisClass->CommandDispatch(cmdFinish, &payload, 1);
|
|
||||||
} else {
|
|
||||||
thisClass->TransferSummary(context);
|
|
||||||
thisClass->TaskFinish();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HdcTransferBase::OnFileIO(uv_fs_t *req)
|
void HdcTransferBase::OnFileIO(uv_fs_t *req)
|
||||||
{
|
{
|
||||||
CtxFileIO *contextIO = reinterpret_cast<CtxFileIO *>(req->data);
|
CtxFileIO *contextIO = reinterpret_cast<CtxFileIO *>(req->data);
|
||||||
@ -243,11 +230,6 @@ void HdcTransferBase::OnFileIO(uv_fs_t *req)
|
|||||||
WRITE_LOG(LOG_DEBUG, "read file data %" PRIu64 "/%" PRIu64 "", context->indexIO,
|
WRITE_LOG(LOG_DEBUG, "read file data %" PRIu64 "/%" PRIu64 "", context->indexIO,
|
||||||
context->fileSize);
|
context->fileSize);
|
||||||
#endif // HDC_DEBUG
|
#endif // HDC_DEBUG
|
||||||
|
|
||||||
if (req->result == 0 && context->fileSize > 0) {
|
|
||||||
Next(thisClass, context);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!thisClass->SendIOPayload(context, context->indexIO - req->result, bufIO, req->result)) {
|
if (!thisClass->SendIOPayload(context, context->indexIO - req->result, bufIO, req->result)) {
|
||||||
context->ioFinish = true;
|
context->ioFinish = true;
|
||||||
break;
|
break;
|
||||||
|
@ -121,9 +121,6 @@ protected:
|
|||||||
virtual void WhenTransferFinish(CtxFile *context)
|
virtual void WhenTransferFinish(CtxFile *context)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
virtual void TransferSummary(CtxFile *context)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
bool MatchPackageExtendName(string fileName, string extName);
|
bool MatchPackageExtendName(string fileName, string extName);
|
||||||
bool ResetCtx(CtxFile *context, bool full = false);
|
bool ResetCtx(CtxFile *context, bool full = false);
|
||||||
bool SmartSlavePath(string &cwd, string &localPath, const char *optName);
|
bool SmartSlavePath(string &cwd, string &localPath, const char *optName);
|
||||||
@ -150,7 +147,6 @@ private:
|
|||||||
};
|
};
|
||||||
static const uint8_t payloadPrefixReserve = 64;
|
static const uint8_t payloadPrefixReserve = 64;
|
||||||
static void OnFileIO(uv_fs_t *req);
|
static void OnFileIO(uv_fs_t *req);
|
||||||
static void Next(HdcTransferBase *thisClass, CtxFile *context);
|
|
||||||
int SimpleFileIO(CtxFile *context, uint64_t index, uint8_t *sendBuf, int bytes);
|
int SimpleFileIO(CtxFile *context, uint64_t index, uint8_t *sendBuf, int bytes);
|
||||||
bool SendIOPayload(CtxFile *context, uint64_t index, uint8_t *data, int dataSize);
|
bool SendIOPayload(CtxFile *context, uint64_t index, uint8_t *data, int dataSize);
|
||||||
bool RecvIOPayload(CtxFile *context, uint8_t *data, int dataSize);
|
bool RecvIOPayload(CtxFile *context, uint8_t *data, int dataSize);
|
||||||
|
Loading…
Reference in New Issue
Block a user