| /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 | host_tcp.cpp | 106 if ((hSession->fdChildWorkTCP = Base::DuplicateUvSocket(&hSession->hWorkTCP)) < 0) { in Connect() 111 Base::SetTcpOptions((uv_tcp_t *)&hSession->hWorkTCP); in Connect() 113 …Base::StartWorkThread(&ptrConnect->loopMain, ptrConnect->SessionWorkThread, Base::FinishWorkThread… in Connect() 118 Base::SendToPollFd(hSession->ctrlFd[STREAM_MAIN], ctrl.data(), ctrl.size()); in Connect() 129 if (Base::ConnectKey2IPPort(connectKey.c_str(), ip, &port) < 0) { in ConnectDaemon()
|
| 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() 98 Base::PrintMessage("Kill server finish"); in StartKillServer() 103 Base::PrintMessage("Kill server failed %s", buf); in StartKillServer() 130 Base::PrintMessage("Unknown command"); in DoCtrlServiceWork() 132 Base::TryCloseHandle((const uv_handle_t *)handle); in DoCtrlServiceWork() 202 string hdcPath = Base::GetHdcAbsolutePath(); in GetHilogPath() [all …]
|
| 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.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() 126 std::string strPath = Base::UnicodeToUtf8(path, true); in PullupServerWin32() 141 … if (sprintf_s(buf, sizeof(buf), "dummy -l %d -s %s -m", Base::GetLogLevel(), listenString) < 0) { in PullupServerWin32() 193 Base::CloseFd(fd); in PullupServer() 260 …out = Base::StringFormat("%s\t\t%s\t%s\t%s\n", hdi->connectKey.c_str(), sConn.c_str(), sStatus.c_s… in BuildDaemonVisableLine() 264 out = Base::StringFormat("%s\n", hdi->connectKey.c_str()); in BuildDaemonVisableLine() 424 Base::DelayDoSimple(&loopMain, waitDaemonReconnect, funcDelayUsbNotify); in NotifyInstanceSessionFree() 581 Base::TryCloseHandle((uv_handle_t *)&hChannel->hChildWorkTCP); // detch client channel in FetchCommand() [all …]
|
| D | server_for_client.cpp | 39 Base::TryCloseHandle((uv_handle_t *)&tcpListen); in Stop() 69 Base::ReallocBuf(&context->ioBuf, &context->bufSize, sizeWanted); // sizeWanted default 6k in AcceptClient() 83 string ver = Base::GetVersion() + HDC_MSG_HASH; in AcceptClient() 181 string log = logInfo + Base::StringFormat(msg, vaArgs); in EchoClient() 253 …Base::WriteBinFile((UT_TMP_PATH + "/base-discover.result").c_str(), (uint8_t *)bufString.c_str(), … in OrderFindTargets() 304 Base::TryCloseHandle((const uv_handle_t *)req, Base::CloseTimerCallback); in OrderConnecTargetResult() 329 Base::ZeroBuf(hChannel->bufStd, 2); in NewConnectTry() 333 Base::TimerUvTask(loopMain, hChannel, OrderConnecTargetResult, 10); in NewConnectTry() 390 …Base::WriteBinFile((UT_TMP_PATH + "/base-list.result").c_str(), (uint8_t *)MESSAGE_SUCCESS.c_str(), in GetTargetList() 408 … Base::WriteBinFile((UT_TMP_PATH + "/base-any.result").c_str(), (uint8_t *)MESSAGE_SUCCESS.c_str(), in GetAnyTarget() [all …]
|
| /developtools/hdc/src/daemon/ |
| D | main.cpp | 47 Base::PrintMessage("Background mode, persist.hdc.mode"); in ForkChildCheck() 50 workMode = Base::Trim(workMode); in ForkChildCheck() 113 Base::CloseFd(fd); in BackgroundRun() 154 Base::SetLogLevel(logLevel); in GetDaemonCommandlineOptions() 158 Base::PrintMessage("Option USB enabled"); in GetDaemonCommandlineOptions() 163 Base::PrintMessage("Option TCP enabled"); in GetDaemonCommandlineOptions() 169 Base::PrintMessage("Parament Enable UART"); in GetDaemonCommandlineOptions() 175 Base::PrintMessage("Option:%c non-supported!", ch); in GetDaemonCommandlineOptions() 284 string ver = Hdc::Base::GetVersion(); in main() 296 Base::PrintMessage("TCP, USB and Uart are disable, cannot run continue\n"); in main() [all …]
|
| D | daemon_forward.cpp | 37 Base::TryCloseHandle((const uv_handle_t *)handle, Base::CloseIdleCallback); in SetupJdwpPointCallBack() 60 Base::CreateSocketPair(fds); in SetupJdwpPoint() 80 Base::CloseSocketPair(fds); in SetupJdwpPoint() 85 Base::IdleUvTask(loopTask, ctxPoint, SetupJdwpPointCallBack); in SetupJdwpPoint() 114 Base::CreateSocketPair(fds); in SetupArkPoint() 121 Base::CloseSocketPair(fds); in SetupArkPoint() 130 Base::CloseSocketPair(fds); in SetupArkPoint() 134 Base::IdleUvTask(loopTask, ctxPoint, SetupJdwpPointCallBack); in SetupArkPoint()
|
| 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_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() 87 if ((hSession->fdChildWorkTCP = Base::DuplicateUvSocket(&hSession->hWorkTCP)) < 0) { in AcceptClient() 91 Base::TryCloseHandle((uv_handle_t *)&hSession->hWorkTCP); in AcceptClient() 92 Base::StartWorkThread(ptrLoop, ptrConnect->SessionWorkThread, Base::FinishWorkThread, hSession); in AcceptClient() 97 Base::SendToPollFd(hSession->ctrlFd[STREAM_MAIN], ctrl.data(), ctrl.size()); in AcceptClient() 137 Base::ZeroStruct(addr); in SetTCPListen()
|
| D | daemon_app.cpp | 66 dstPath += Base::GetPathSep(); in CommandDispatch() 70 ctxNow.transferBegin = Base::GetRuntimeMSec(); in CommandDispatch() 84 Base::SplitString(bufString, " ", segments); in CommandDispatch() 108 echo = Base::ReplaceAll(echo, "\n", " "); in AsyncInstallFinish() 116 …Base::WriteBinFile((UT_TMP_PATH + "/appinstall.result").c_str(), (uint8_t *)MESSAGE_SUCCESS.c_str(… in AsyncInstallFinish() 134 doBuf = Base::StringFormat("bm install %s -p %s", options, package.c_str()); in PackageShell() 137 doBuf = Base::StringFormat("bm install %s %s", options, package.c_str()); in PackageShell() 144 doBuf = Base::StringFormat("bm uninstall %s -n %s", options, package.c_str()); in PackageShell() 147 doBuf = Base::StringFormat("bm uninstall %s %s", options, package.c_str()); in PackageShell()
|
| D | daemon_usb.cpp | 48 Base::CloseFd(controlEp); in ~HdcDaemonUSB() 62 Base::TryCloseHandle((uv_handle_t *)&checkEP); in Stop() 113 ctxRecv.bufSizeMax = Base::GetUsbffsBulkSize(); in Initial() 205 Base::CloseFd(hUSB->bulkIn); in CloseEndpoint() 206 Base::CloseFd(hUSB->bulkOut); in CloseEndpoint() 208 Base::CloseFd(controlEp); in CloseEndpoint() 368 …Base::StartWorkThread(&daemon->loopMain, daemon->SessionWorkThread, Base::FinishWorkThread, hChild… in PrepareNewSession() 377 Base::SendToPollFd(hChildSession->ctrlFd[STREAM_MAIN], ctrl.data(), ctrl.size()); in PrepareNewSession() 380 Base::TryCloseHandle(reinterpret_cast<uv_handle_t *>(handle), Base::CloseTimerCallback); in PrepareNewSession() 382 Base::TimerUvTask(&daemon->loopMain, hChildSession, funcNewSessionUp); in PrepareNewSession() [all …]
|
| D | shell.cpp | 65 Base::CloseFd(fdPTY); in ReadyForRelease() 227 Base::DeInitProcess(); in ShellFork() 259 Base::CloseFd(ptm); in CreateSubProcessPTY() 267 Base::CloseFd(ptm); in CreateSubProcessPTY() 294 if ((fdPTY = CreateSubProcessPTY(Base::GetShellPath().c_str(), "-", 0, &pidShell)) < 0) { in StartShell()
|
| /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 | 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() 132 Base::TryCloseHandle((uv_handle_t *)handle, Base::CloseTimerCallback); in BeginRemoveTask() 134 …Base::TimerUvTask(hTask->runLoop, hTask, taskClassDeleteRetry, (GLOBAL_TIMEOUT * TIME_BASE) / UV_D… in BeginRemoveTask() 193 uv_close((uv_handle_t *)handle, Base::CloseIdleCallback); in ReMainLoopForInstanceClear() 196 Base::IdleUvTask(&loopMain, this, clearSessionsForFinish); in ReMainLoopForInstanceClear() 302 Base::TryCloseHandle((uv_handle_t *)handle, Base::CloseIdleCallback); in AsyncMainLoopTask() 313 Base::IdleUvTask(&thisClass->loopMain, param, AsyncMainLoopTask); in MainAsyncCallback() 400 uid = static_cast<uint32_t>(Base::GetRandom()); in GetSessionPseudoUid() 447 Base::CreateSocketPair(hSession->ctrlFd); in MallocSession() [all …]
|
| D | channel.cpp | 130 Base::TryCloseHandle((uv_handle_t *)tcp); in ReadStream() 186 Base::TryCloseHandle((uv_handle_t *)req->handle); in WriteCallback() 213 uv_close((uv_handle_t *)handle, Base::CloseIdleCallback); in AsyncMainLoopTask() 231 Base::IdleUvTask(thisClass->loopMain, param, AsyncMainLoopTask); in MainAsyncCallback() 333 Base::SendToStreamEx(sendStream, data, sizeNewBuf, nullptr, (void *)WriteCallback, data); in SendChannel() 361 Base::ReallocBuf(&context->ioBuf, &context->bufSize, Base::GetMaxBufSize() * 4); in AllocCallback() 370 uid = static_cast<uint32_t>(Base::GetRandom()); in GetChannelPseudoUid() 423 Base::TryCloseHandle((const uv_handle_t *)handle, Base::CloseIdleCallback); in FreeChannelFinally() 435 Base::TryCloseHandle((uv_handle_t *)handle); in FreeChannelContinue() 443 Base::TryCloseHandle((uv_handle_t *)&hChannel->stdinTty, closeChannelHandle); in FreeChannelContinue() [all …]
|
| D | async_cmd.cpp | 54 Base::CloseFd(fd); in ReadyForRelease() 63 Base::CloseFd(fd); in DoRelease() 114 string sFailString = Base::StringFormat("Get parameter \"%s\" fail", key); in GetDevItem() 116 Base::RunPipeComand(stringBuf.c_str(), tmpStringBuf, BUF_SIZE_MEDIUM - 1, true); in GetDevItem() 120 Base::ZeroArray(tmpStringBuf); in GetDevItem() 219 Base::DeInitProcess(); in Popen() 234 string shellPath = Base::GetShellPath(); in Popen() 238 Base::CloseFd(fds[pipeWrite]); in Popen() 241 Base::CloseFd(fds[pipeRead]); in Popen() 257 Base::Trim(cmd, "\""); in ExecuteCommand()
|
| D | transfer.cpp | 80 size_t bufMaxSize = static_cast<size_t>(Base::GetUsbffsBulkSize() - payloadPrefixReserve); in SimpleFileIO() 236 Base::GetMaxBufSize() * thisClass->maxTransferBufFactor); in OnFileIO() 375 Base::SplitString(filter, ";", filterStrings); in GetSubFiles() 449 GetSubFilesRecursively(path + Base::GetPathSep() + dent.name, in GetSubFilesRecursively() 450 currentDirname + Base::GetPathSep() + dent.name, out); in GetSubFilesRecursively() 456 out->push_back(currentDirname + Base::GetPathSep() + fileName); in GetSubFilesRecursively() 479 char sep = Base::GetPathSep(); in CheckLocalPath() 481 Base::SplitString(localPath, split, dirsOflocalPath); in CheckLocalPath() 486 if (!Base::IsAbsolutePath(localPath)) { in CheckLocalPath() 502 makedirPath = makedirPath + Base::GetPathSep() + dir; in CheckLocalPath() [all …]
|
| 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() 172 uint64_t nMSec = Base::GetRuntimeMSec() - in TransferSummary() 220 Base::SplitString(dirMode.fullName, "/", dirsOfOptName); in FileModeSync() 223 Base::SplitString(dirMode.fullName, "\\", dirsOfOptName); in FileModeSync() 233 dirMode.fullName = dirMode.fullName + Base::GetPathSep() + s; in FileModeSync() 288 ctxNow.transferDirBegin = Base::GetRuntimeMSec(); in SlaveCheck() 290 ctxNow.transferBegin = Base::GetRuntimeMSec(); in SlaveCheck() [all …]
|
| D | forward.cpp | 122 ctx->id = Base::GetRuntimeMSec(); in MallocContext() 135 Base::DoNextLoop(loopTask, ctx, [this](const uint8_t flag, string &msg, const void *data) { in FreeContextCallBack() 151 Base::CloseFd(ctx->fd); in FreeJDWP() 165 Base::TryCloseHandle((uv_handle_t *)handle, funcIdleHandleClose); in FreeJDWP() 168 Base::IdleUvTask(loopTask, ctx, funcReqClose); in FreeJDWP() 199 Base::TryCloseHandle((uv_handle_t *)&ctx->tcp, true, funcHandleClose); in FreeContext() 204 Base::TryCloseHandle((uv_handle_t *)&ctx->pipe, true, funcHandleClose); in FreeContext() 221 if (bufSize > Base::GetMaxBufSize() * 2) { in SendToTask() 396 string resolvedPath = Base::CanonicalizeSpecPath(sNodeCfg); in SetupDevicePoint() 431 Base::ZeroStruct(addr); in LocalAbstractConnect() [all …]
|
| /developtools/hdc/hdc_rust/src/common/ |
| D | hdctransfer.rs | 20 use crate::common::base::Base; 116 if f.is_dir() && !transfer.local_path.ends_with(Base::get_path_sep()) { in check_local_path() 119 .push_str(Base::get_path_sep().to_string().as_str()); in check_local_path() 122 let mut op = _optional_name.replace('\\', Base::get_path_sep().to_string().as_str()); in check_local_path() 123 op = op.replace('/', Base::get_path_sep().to_string().as_str()); in check_local_path() 125 if op.contains(Base::get_path_sep()) && !transfer.local_path.ends_with(Base::get_path_sep()) { in check_local_path() 128 .push_str(Base::get_path_sep().to_string().as_str()); in check_local_path() 131 if transfer.local_path.ends_with(Base::get_path_sep()) { in check_local_path() 134 if transfer.local_path.ends_with(Base::get_path_sep()) { in check_local_path() 137 let last = transfer.local_path.rfind(Base::get_path_sep()); in check_local_path()
|
| D | base.rs | 18 pub struct Base {} struct 20 impl Base { implementation 117 if !Base::is_absolute_path(_path) { in extract_relative_path()
|