/developtools/hdc/src/test/ |
D | ut_mod.cpp | 29 if ((bytesIO = Base::ReadBinFile((UT_TMP_PATH + "/base-discover.result").c_str(), in TestBaseCommand() 43 if ((bytesIO = Base::ReadBinFile((UT_TMP_PATH + "/base-list.result").c_str(), in TestBaseCommand() 54 if ((bytesIO = Base::ReadBinFile((UT_TMP_PATH + "/base-any.result").c_str(), in TestBaseCommand() 84 if ((bytesIO = Base::ReadBinFile((UT_TMP_PATH + "/" + resultFile).c_str(), in TestShellExecute() 88 Base::RunPipeComand(const_cast<const char *>("id"), bufString, sizeof(bufString), false); in TestShellExecute() 98 if ((bytesIO = Base::ReadBinFile((UT_TMP_PATH + "/" + resultFile).c_str(), in TestShellExecute() 102 …Base::RunPipeComand(const_cast<const char *>("cat /etc/passwd"), bufString, sizeof(bufString), fal… in TestShellExecute() 139 string localFile = Base::StringFormat("%s/file.local", UT_TMP_PATH.c_str()); in TestFileCommand() 140 string remoteFile = Base::StringFormat("%s/file.remote", UT_TMP_PATH.c_str()); in TestFileCommand() 143 string cmd = Base::StringFormat("find /usr > %s", localFile.c_str()); in TestFileCommand() [all …]
|
D | ut_runtime.cpp | 26 Base::SetLogLevel(Hdc::LOG_INFO); in Runtime() 41 Base::TryCloseLoop(&loopMain, "Runtime childUV"); in ~Runtime() 63 Base::TryCloseHandle((uv_handle_t *)&thisClass->checkServerStop); in CheckStopServer() 93 Base::TryCloseHandle((uv_handle_t *)&thisClass->checkDaemonStop); in CheckStopDaemon() 159 uv_close((uv_handle_t *)handle, Base::CloseIdleCallback); in DoCheck() 180 Base::StartWorkThread(&loopMain, StartServer, funcServerFinish, this); in Initial() 181 Base::StartWorkThread(&loopMain, StartDaemon, funcDaemonFinish, this); in Initial() 182 Base::TimerUvTask(&loopMain, this, DoCheck, sleepTime); in Initial() 214 string utFile = Base::StringFormat("%s/%s", UT_TMP_PATH.c_str(), file.c_str()); in ResetUtTmpFile()
|
D | main.cpp | 24 GTEST_ASSERT_LE(1, Base::GetRuntimeMSec()); in TEST() 25 GTEST_ASSERT_LE(10, Base::GetRandomNum(10, 12)); in TEST() 26 GTEST_ASSERT_EQ(0, Base::ConnectKey2IPPort("127.0.0.1:8080", bufString, &num)); in TEST() 28 Base::SplitCommandToArgs("xx p1 p2 p3", &argc); in TEST()
|
/developtools/hdc/src/host/ |
D | main.cpp | 119 if (path[strlen(path) - 1] != Base::GetPathSep()) { in AppendCwdWhenTransfer() 120 path[strlen(path)] = Base::GetPathSep(); in AppendCwdWhenTransfer() 125 string utf8Path = Base::UnicodeToUtf8(path, true); in AppendCwdWhenTransfer() 126 outCommand += Base::StringFormat("\"%s\"", utf8Path.c_str()); in AppendCwdWhenTransfer() 149 string packageCmd = Base::StringFormat("\"%s\"", argv[i]); in SplitOptionAndCommand() 154 outOption += Base::StringFormat("\"%s\"", argv[i]); in SplitOptionAndCommand() 170 Base::PrintMessage("Initial failed"); in RunServerMode() 180 Base::PrintMessage("Not support command..."); in RunPcDebugMode() 205 Base::PrintMessage("Unknown operation command..."); in RunClientMode() 215 if (isPullServer && Base::ProgramMutex(SERVER_NAME.c_str(), true) == 0) { in RunClientMode() [all …]
|
D | client.cpp | 34 Base::ZeroStruct(terminalState); in HdcClient() 46 Base::TryCloseLoop(loopMain, "ExecuteCommand finish"); in ~HdcClient() 67 … string path = Base::StringFormat("%s%c.%s.pid", bufPath, Base::GetPathSep(), SERVER_NAME.c_str()); in GetLastPID() 68 Base::ReadBinFile(path.c_str(), reinterpret_cast<void **>(&pidBuf), BUF_SIZE_TINY); in GetLastPID() 75 bool isNowRunning = Base::ProgramMutex(SERVER_NAME.c_str(), true) != 0; in StartKillServer() 96 Base::PrintMessage("Kill server finish"); in StartKillServer() 101 Base::PrintMessage("Kill server failed %s", buf); in StartKillServer() 128 Base::PrintMessage("Unknown command"); in DoCtrlServiceWork() 130 Base::TryCloseHandle((const uv_handle_t *)handle); in DoCtrlServiceWork() 200 string hdcPath = Base::GetHdcAbsolutePath(); in GetHilogPath() [all …]
|
D | host_tcp.cpp | 105 if ((hSession->fdChildWorkTCP = Base::DuplicateUvSocket(&hSession->hWorkTCP)) < 0) { in Connect() 109 Base::SetTcpOptions((uv_tcp_t *)&hSession->hWorkTCP); in Connect() 111 …Base::StartWorkThread(&ptrConnect->loopMain, ptrConnect->SessionWorkThread, Base::FinishWorkThread… in Connect() 116 Base::SendToPollFd(hSession->ctrlFd[STREAM_MAIN], ctrl.data(), ctrl.size()); in Connect() 127 if (Base::ConnectKey2IPPort(connectKey.c_str(), ip, &port) < 0) { in ConnectDaemon()
|
D | ext_client.cpp | 41 string hdcPath = Base::GetHdcAbsolutePath(); in GetPath() 42 int index = hdcPath.find_last_of(Base::GetPathSep()); in GetPath() 43 return (hdcPath.substr(0, index) + Base::GetPathSep() + path); in GetPath() 61 return Base::CheckDirectoryOrPath(path.c_str(), true, true); in SharedLibraryExist() 177 all = Base::ReplaceAll(all, "\n", "\texternal\n"); in ListTargets() 178 Base::PrintMessage("%s", all.c_str()); in ListTargets() 180 Base::PrintMessage("%s", extdevs.c_str()); in ListTargets() 192 Base::SplitString(str, "\n", devs); in UpdateList() 292 char **argv = Base::SplitCommandToArgs(cmd.c_str(), &argc); in RemoveRemoteCwd() 298 … std::string remove = Base::StringFormat("%s %s \"%s\" ", argv[i], argv[i + 1], argv[i + 2]); in RemoveRemoteCwd() [all …]
|
D | server_for_client.cpp | 39 Base::TryCloseHandle((uv_handle_t *)&tcpListen); in Stop() 66 Base::ReallocBuf(&context->ioBuf, &context->bufSize, sizeWanted); // sizeWanted default 6k in AcceptClient() 80 string ver = Base::GetVersion() + HDC_MSG_HASH; in AcceptClient() 178 string log = logInfo + Base::StringFormat(msg, vaArgs); in EchoClient() 246 …Base::WriteBinFile((UT_TMP_PATH + "/base-discover.result").c_str(), (uint8_t *)bufString.c_str(), … in OrderFindTargets() 297 Base::TryCloseHandle((const uv_handle_t *)req, Base::CloseTimerCallback); in OrderConnecTargetResult() 322 Base::ZeroBuf(hChannel->bufStd, 2); in NewConnectTry() 326 Base::TimerUvTask(loopMain, hChannel, OrderConnecTargetResult, 10); in NewConnectTry() 381 …Base::WriteBinFile((UT_TMP_PATH + "/base-list.result").c_str(), (uint8_t *)MESSAGE_SUCCESS.c_str(), in GetTargetList() 399 … Base::WriteBinFile((UT_TMP_PATH + "/base-any.result").c_str(), (uint8_t *)MESSAGE_SUCCESS.c_str(), in GetAnyTarget() [all …]
|
D | server.cpp | 43 Base::TryCloseLoop(&loopMain, "HdcServer::~HdcServer"); in ClearInstanceResource() 83 if (Base::ProgramMutex(SERVER_NAME.c_str(), false) != 0) { in Initial() 87 Base::RemoveLogFile(); in Initial() 125 std::string strPath = Base::UnicodeToUtf8(path, true); in PullupServerWin32() 140 … if (sprintf_s(buf, sizeof(buf), "dummy -l %d -s %s -m", Base::GetLogLevel(), listenString) < 0) { in PullupServerWin32() 192 Base::CloseFd(fd); in PullupServer() 259 …out = Base::StringFormat("%s\t\t%s\t%s\t%s\n", hdi->connectKey.c_str(), sConn.c_str(), sStatus.c_s… in BuildDaemonVisableLine() 263 out = Base::StringFormat("%s\n", hdi->connectKey.c_str()); in BuildDaemonVisableLine() 422 Base::DelayDoSimple(&loopMain, waitDaemonReconnect, funcDelayUsbNotify); in NotifyInstanceSessionFree() 591 Base::TryCloseHandle((uv_handle_t *)&hChannel->hChildWorkTCP); // detch client channel in FetchCommand() [all …]
|
/developtools/hdc/src/daemon/ |
D | main.cpp | 44 Base::PrintMessage("Background mode, persist.hdc.mode"); in ForkChildCheck() 47 workMode = Base::Trim(workMode); in ForkChildCheck() 110 Base::CloseFd(fd); in BackgroundRun() 151 Base::SetLogLevel(logLevel); in GetDaemonCommandlineOptions() 155 Base::PrintMessage("Option USB enabled"); in GetDaemonCommandlineOptions() 160 Base::PrintMessage("Option TCP enabled"); in GetDaemonCommandlineOptions() 166 Base::PrintMessage("Parament Enable UART"); in GetDaemonCommandlineOptions() 172 Base::PrintMessage("Option:%c non-supported!", ch); in GetDaemonCommandlineOptions() 272 string ver = Hdc::Base::GetVersion(); in main() 284 Base::PrintMessage("TCP, USB and Uart are disable, cannot run continue\n"); in main() [all …]
|
D | daemon_tcp.cpp | 49 Base::TryCloseHandle((const uv_handle_t *)&servUDP); in Stop() 50 Base::TryCloseHandle((const uv_handle_t *)&servTCP); in Stop() 62 string sendBuf = Base::StringFormat("%s-%d", HANDSHAKE_MESSAGE.c_str(), tcpListenPort); in TransmitConfig() 85 if ((hSession->fdChildWorkTCP = Base::DuplicateUvSocket(&hSession->hWorkTCP)) < 0) { in AcceptClient() 88 Base::TryCloseHandle((uv_handle_t *)&hSession->hWorkTCP); in AcceptClient() 89 Base::StartWorkThread(ptrLoop, ptrConnect->SessionWorkThread, Base::FinishWorkThread, hSession); in AcceptClient() 94 Base::SendToPollFd(hSession->ctrlFd[STREAM_MAIN], ctrl.data(), ctrl.size()); in AcceptClient() 134 Base::ZeroStruct(addr); in SetTCPListen()
|
D | system_depend.cpp | 43 string stringBuf = Base::StringFormat("param set %s %s", key, value); in SetDevItem() 44 Base::RunPipeComand(stringBuf.c_str(), outBuf, sizeof(outBuf), true); in SetDevItem() 59 string sFailString = Base::StringFormat("Get parameter \"%s\" fail", key); in GetDevItem() 61 Base::RunPipeComand(stringBuf.c_str(), tmpStringBuf, BUF_SIZE_MEDIUM - 1, true); in GetDevItem() 65 Base::ZeroStruct(tmpStringBuf); in GetDevItem()
|
D | daemon_app.cpp | 62 dstPath += Base::GetPathSep(); in CommandDispatch() 66 ctxNow.transferBegin = Base::GetRuntimeMSec(); in CommandDispatch() 80 Base::SplitString(bufString, " ", segments); in CommandDispatch() 104 echo = Base::ReplaceAll(echo, "\n", " "); in AsyncInstallFinish() 112 …Base::WriteBinFile((UT_TMP_PATH + "/appinstall.result").c_str(), (uint8_t *)MESSAGE_SUCCESS.c_str(… in AsyncInstallFinish() 130 doBuf = Base::StringFormat("bm install %s -p %s", options, package.c_str()); in PackageShell() 133 doBuf = Base::StringFormat("bm install %s %s", options, package.c_str()); in PackageShell() 140 doBuf = Base::StringFormat("bm uninstall %s -n %s", options, package.c_str()); in PackageShell() 143 doBuf = Base::StringFormat("bm uninstall %s %s", options, package.c_str()); in PackageShell()
|
D | daemon_forward.cpp | 36 Base::TryCloseHandle((const uv_handle_t *)handle, Base::CloseIdleCallback); in SetupJdwpPointCallBack() 58 Base::CreateSocketPair(fds); in SetupJdwpPoint() 78 Base::CloseSocketPair(fds); in SetupJdwpPoint() 83 Base::IdleUvTask(loopTask, ctxPoint, SetupJdwpPointCallBack); in SetupJdwpPoint()
|
D | daemon_usb.cpp | 48 Base::CloseFd(controlEp); in ~HdcDaemonUSB() 62 Base::TryCloseHandle((uv_handle_t *)&checkEP); in Stop() 112 ctxRecv.bufSizeMax = Base::GetUsbffsBulkSize(); in Initial() 204 Base::CloseFd(hUSB->bulkIn); in CloseEndpoint() 205 Base::CloseFd(hUSB->bulkOut); in CloseEndpoint() 207 Base::CloseFd(controlEp); in CloseEndpoint() 364 …Base::StartWorkThread(&daemon->loopMain, daemon->SessionWorkThread, Base::FinishWorkThread, hChild… in PrepareNewSession() 373 Base::SendToPollFd(hChildSession->ctrlFd[STREAM_MAIN], ctrl.data(), ctrl.size()); in PrepareNewSession() 376 Base::TryCloseHandle(reinterpret_cast<uv_handle_t *>(handle), Base::CloseTimerCallback); in PrepareNewSession() 378 Base::TimerUvTask(&daemon->loopMain, hChildSession, funcNewSessionUp); in PrepareNewSession() [all …]
|
D | shell.cpp | 60 Base::CloseFd(fdPTY); in ReadyForRelease() 201 Base::DeInitProcess(); in ShellFork() 233 Base::CloseFd(ptm); in CreateSubProcessPTY() 241 Base::CloseFd(ptm); in CreateSubProcessPTY() 269 if ((fdPTY = CreateSubProcessPTY(Base::GetShellPath().c_str(), "-", 0, &pidShell)) < 0) { in StartShell()
|
D | jdwp.cpp | 33 Base::CloseFd(awakenPollFd); in ~HdcJdwp() 51 Base::TryCloseHandle((const uv_handle_t *)&listenPipe, funcListenPipeClose); in Stop() 81 Base::TryCloseHandle((const uv_handle_t *)&ctx->pipe); in FreeContext() 88 Base::TryCloseHandle((uv_handle_t *)handle, Base::CloseIdleCallback); in FreeContext() 91 Base::IdleUvTask(loop, ctx, funcReqClose); in FreeContext() 162 Base::ZeroArray(ctxJdwp->buf); in ReadStream() 264 Base::ZeroStruct(saddr); in UvPipeBind() 343 Base::TryCloseHandle((const uv_handle_t *)&ctx->jvmTCP); in SendCallbackJdwpNewFD() 368 …if (Base::SendToStreamEx((uv_stream_t *)&ctx->pipe, (uint8_t *)&ctx->dummy, 1, (uv_stream_t *)&ctx… in SendJdwpNewFD() 582 Base::CloseFd(awakenPollFd); in CreateFdEventPoll()
|
/developtools/integration_verification/tools/fotff/pkg/gitee_common/ |
D | get_newer_ci.go | 106 if filepath.Base(p) == cur { 109 logrus.Infof("new package found, name: %s", filepath.Base(p)) 119 if _, err := parseTime(filepath.Base(url)); err != nil { 120 logrus.Errorf("can not get package time from %s, skipping", filepath.Base(url)) 121 return "", fmt.Errorf("can not get package time from %s, skipping", filepath.Base(url)) 132 f, err := os.Create(filepath.Join(m.ArchiveDir, filepath.Base(url))) 141 return filepath.Base(url), nil
|
/developtools/hdc/src/common/ |
D | channel.cpp | 128 Base::TryCloseHandle((uv_handle_t *)tcp); in ReadStream() 179 Base::TryCloseHandle((uv_handle_t *)req->handle); in WriteCallback() 207 uv_close((uv_handle_t *)handle, Base::CloseIdleCallback); in AsyncMainLoopTask() 224 Base::IdleUvTask(thisClass->loopMain, param, AsyncMainLoopTask); in MainAsyncCallback() 323 Base::SendToStreamEx(sendStream, data, sizeNewBuf, nullptr, (void *)WriteCallback, data); in SendChannel() 349 Base::ReallocBuf(&context->ioBuf, &context->bufSize, Base::GetMaxBufSize() * 4); in AllocCallback() 358 uid = static_cast<uint32_t>(Base::GetRandom()); in GetChannelPseudoUid() 404 Base::TryCloseHandle((const uv_handle_t *)handle, Base::CloseIdleCallback); in FreeChannelFinally() 416 Base::TryCloseHandle((uv_handle_t *)handle); in FreeChannelContinue() 424 Base::TryCloseHandle((uv_handle_t *)&hChannel->stdinTty, closeChannelHandle); in FreeChannelContinue() [all …]
|
D | session.cpp | 25 WRITE_LOG(LOG_INFO, "Program running. %s Pid:%u", Base::GetVersion().c_str(), getpid()); in HdcSessionBase() 65 Base::TryCloseHandle((uv_handle_t *)&asyncMainLoop); in ~HdcSessionBase() 128 Base::TryCloseHandle((uv_handle_t *)handle, Base::CloseTimerCallback); in BeginRemoveTask() 130 …Base::TimerUvTask(hTask->runLoop, hTask, taskClassDeleteRetry, (GLOBAL_TIMEOUT * TIME_BASE) / UV_D… in BeginRemoveTask() 189 uv_close((uv_handle_t *)handle, Base::CloseIdleCallback); in ReMainLoopForInstanceClear() 192 Base::IdleUvTask(&loopMain, this, clearSessionsForFinish); in ReMainLoopForInstanceClear() 298 Base::TryCloseHandle((uv_handle_t *)handle, Base::CloseIdleCallback); in AsyncMainLoopTask() 309 Base::IdleUvTask(&thisClass->loopMain, param, AsyncMainLoopTask); in MainAsyncCallback() 396 uid = static_cast<uint32_t>(Base::GetRandom()); in GetSessionPseudoUid() 439 Base::CreateSocketPair(hSession->ctrlFd); in MallocSession() [all …]
|
D | transfer.cpp | 81 size_t bufMaxSize = static_cast<size_t>(Base::GetUsbffsBulkSize() - payloadPrefixReserve); in SimpleFileIO() 237 Base::GetMaxBufSize() * thisClass->maxTransferBufFactor); in OnFileIO() 379 Base::SplitString(filter, ";", filterStrings); in GetSubFiles() 455 GetSubFilesRecursively(path + Base::GetPathSep() + dent.name, in GetSubFilesRecursively() 456 currentDirname + Base::GetPathSep() + dent.name, out); in GetSubFilesRecursively() 462 out->push_back(currentDirname + Base::GetPathSep() + fileName); in GetSubFilesRecursively() 485 char sep = Base::GetPathSep(); in CheckLocalPath() 487 Base::SplitString(localPath, split, dirsOflocalPath); in CheckLocalPath() 492 if (!Base::IsAbsolutePath(localPath)) { in CheckLocalPath() 508 makedirPath = makedirPath + Base::GetPathSep() + dir; in CheckLocalPath() [all …]
|
D | async_cmd.cpp | 50 Base::CloseFd(fd); in ReadyForRelease() 160 Base::DeInitProcess(); in Popen() 175 string shellPath = Base::GetShellPath(); in Popen() 179 Base::CloseFd(fds[pipeWrite]); in Popen() 182 Base::CloseFd(fds[pipeRead]); in Popen() 198 Base::Trim(cmd, "\""); in ExecuteCommand()
|
D | file.cpp | 42 char **argv = Base::SplitCommandToArgs(command.c_str(), &argc); in BeginTransfer() 124 context->localName = Base::GetFullFilePath(context->localPath); in SetMasterParameters() 127 …if (!Base::CheckDirectoryOrPath(context->localPath.c_str(), true, true, errStr, mode) && (mode & S… in SetMasterParameters() 136 context->localDirName = Base::GetPathWithoutFilename(context->localPath); in SetMasterParameters() 173 uint64_t nMSec = Base::GetRuntimeMSec() - in TransferSummary() 222 Base::SplitString(dirMode.fullName, "/", dirsOfOptName); in FileModeSync() 225 Base::SplitString(dirMode.fullName, "\\", dirsOfOptName); in FileModeSync() 235 dirMode.fullName = dirMode.fullName + Base::GetPathSep() + s; in FileModeSync() 290 ctxNow.transferDirBegin = Base::GetRuntimeMSec(); in SlaveCheck() 292 ctxNow.transferBegin = Base::GetRuntimeMSec(); in SlaveCheck() [all …]
|
D | forward.cpp | 115 ctx->id = Base::GetRuntimeMSec(); in MallocContext() 128 Base::DoNextLoop(loopTask, ctx, [this](const uint8_t flag, string &msg, const void *data) { in FreeContextCallBack() 143 Base::CloseFd(ctx->fd); in FreeJDWP() 157 Base::TryCloseHandle((uv_handle_t *)handle, funcIdleHandleClose); in FreeJDWP() 160 Base::IdleUvTask(loopTask, ctx, funcReqClose); in FreeJDWP() 190 Base::TryCloseHandle((uv_handle_t *)&ctx->tcp, true, funcHandleClose); in FreeContext() 195 Base::TryCloseHandle((uv_handle_t *)&ctx->pipe, true, funcHandleClose); in FreeContext() 212 if (bufSize > Base::GetMaxBufSize() * 2) { in SendToTask() 381 string resolvedPath = Base::CanonicalizeSpecPath(sNodeCfg); in SetupDevicePoint() 416 Base::ZeroStruct(addr); in LocalAbstractConnect() [all …]
|
D | auth.cpp | 162 vector<uint8_t> vec = Base::Base64Encode((const uint8_t *)&publicKey, sizeof(RSAPublicKey)); in WritePublicKeyfile() 168 ret = Base::WriteBinFile(path.c_str(), vec.data(), vec.size(), true); in WritePublicKeyfile() 258 string dir = string(buf) + Base::GetPathSep() + string(harmoneyPath) + Base::GetPathSep(); in GetUserKeyPath() 259 path = Base::CanonicalizeSpecPath(dir); in GetUserKeyPath() 310 ret = Base::ReadBinFile(path.c_str(), (void **)data, len); in GetPublicKeyFileBuf() 338 Base::ReverseBytes(modulusBuffer, sizeof(modulusBuffer)); in RSAPublicKey2RSA() 389 …ret = Base::Base64DecodeBuf(reinterpret_cast<uint8_t *>(buf), strlen(buf), reinterpret_cast<uint8_… in ReadDaemonKeys()
|