/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/daemon/ |
D | main.cpp | 45 Base::PrintMessage("Background mode, persist.hdc.mode"); in ForkChildCheck() 48 workMode = Base::Trim(workMode); in ForkChildCheck() 111 Base::CloseFd(fd); in BackgroundRun() 152 Base::SetLogLevel(logLevel); in GetDaemonCommandlineOptions() 156 Base::PrintMessage("Option USB enabled"); in GetDaemonCommandlineOptions() 161 Base::PrintMessage("Option TCP enabled"); in GetDaemonCommandlineOptions() 167 Base::PrintMessage("Parament Enable UART"); in GetDaemonCommandlineOptions() 173 Base::PrintMessage("Option:%c non-supported!", ch); in GetDaemonCommandlineOptions() 260 Hdc::Base::SetLogCache(false); in main() 268 string ver = Hdc::Base::GetVersion(); in main() [all …]
|
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() 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::SendToStream((uv_stream_t *)&hSession->ctrlPipe[STREAM_MAIN], ctrl.data(), ctrl.size()); in AcceptClient() 134 Base::ZeroStruct(addr); in SetTCPListen()
|
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 | shell.cpp | 57 Base::CloseFd(fdPTY); in ReadyForRelease() 132 Base::CloseFd(pts); in ChildForkDo() 137 Base::CloseFd(fd); in ChildForkDo() 159 Base::DeInitProcess(); in ShellFork() 162 Base::CloseFd(ptm); in ShellFork() 190 Base::CloseFd(ptm); in CreateSubProcessPTY() 198 Base::CloseFd(ptm); in CreateSubProcessPTY() 226 if ((fdPTY = CreateSubProcessPTY(Base::GetShellPath().c_str(), "-", 0, &pidShell)) < 0) { in StartShell()
|
D | daemon_usb.cpp | 39 Base::CloseFd(controlEp); in ~HdcDaemonUSB() 53 Base::TryCloseHandle((uv_handle_t *)&checkEP); in Stop() 103 ctxRecv.bufSizeMax = Base::GetUsbffsBulkSize(); in Initial() 147 Base::ZeroArray(descUsbFfs.wosDesc.SubCompatibleID); in FillUsbV2Head() 148 Base::ZeroArray(descUsbFfs.wosDesc.Reserved2); in FillUsbV2Head() 208 Base::CloseFd(hUSB->bulkIn); in CloseEndpoint() 209 Base::CloseFd(hUSB->bulkOut); in CloseEndpoint() 211 Base::CloseFd(controlEp); in CloseEndpoint() 364 …Base::StartWorkThread(&daemon->loopMain, daemon->SessionWorkThread, Base::FinishWorkThread, hChild… in PrepareNewSession() 373 …Base::SendToStream((uv_stream_t *)&hChildSession->ctrlPipe[STREAM_MAIN], ctrl.data(), ctrl.size()); in PrepareNewSession() [all …]
|
D | daemon_app.cpp | 69 dstPath += Base::GetPathSep(); in CommandDispatch() 73 ctxNow.transferBegin = Base::GetRuntimeMSec(); in CommandDispatch() 100 echo = Base::ReplaceAll(echo, "\n", " "); in AsyncInstallFinish() 108 …Base::WriteBinFile((UT_TMP_PATH + "/appinstall.result").c_str(), (uint8_t *)MESSAGE_SUCCESS.c_str(… in AsyncInstallFinish() 121 doBuf = Base::StringFormat("bm install %s -p %s", options, package.c_str()); in PackageShell() 123 doBuf = Base::StringFormat("bm uninstall %s -n %s", options, package.c_str()); in PackageShell()
|
D | jdwp.cpp | 35 Base::CloseFd(awakenPollFd); in ~HdcJdwp() 53 Base::TryCloseHandle((const uv_handle_t *)&listenPipe, funcListenPipeClose); in Stop() 83 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() 340 Base::TryCloseHandle((const uv_handle_t *)&ctx->jvmTCP); in SendCallbackJdwpNewFD() 365 …if (Base::SendToStreamEx((uv_stream_t *)&ctx->pipe, (uint8_t *)&ctx->dummy, 1, (uv_stream_t *)&ctx… in SendJdwpNewFD() 576 Base::CloseFd(awakenPollFd); in CreateFdEventPoll()
|
/developtools/hdc/src/host/ |
D | main.cpp | 120 if (path[strlen(path) - 1] != Base::GetPathSep()) { in AppendCwdWhenTransfer() 121 path[strlen(path)] = Base::GetPathSep(); in AppendCwdWhenTransfer() 126 string utf8Path = Base::UnicodeToUtf8(path, true); in AppendCwdWhenTransfer() 127 outCommand += Base::StringFormat("\"%s\"", utf8Path.c_str()); in AppendCwdWhenTransfer() 150 string packageCmd = Base::StringFormat("\"%s\"", argv[i]); in SplitOptionAndCommand() 155 outOption += Base::StringFormat("\"%s\"", argv[i]); in SplitOptionAndCommand() 171 Base::PrintMessage("Initial failed"); in RunServerMode() 181 Base::PrintMessage("Not support command..."); in RunPcDebugMode() 206 Base::PrintMessage("Unknown operation command..."); in RunClientMode() 216 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() 179 int ret = Base::ConnectKey2IPPort(channelHostPort.c_str(), ip, &port); in ExecuteCommand() [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::SendToStream((uv_stream_t *)&hSession->ctrlPipe[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 | 36 Base::TryCloseHandle((uv_handle_t *)&tcpListen); in Stop() 63 Base::ReallocBuf(&context->ioBuf, &context->bufSize, sizeWanted); // sizeWanted default 6k in AcceptClient() 77 string ver = Base::GetVersion() + HDC_MSG_HASH; in AcceptClient() 134 string log = logInfo + Base::StringFormat(msg, vaArgs); in EchoClient() 202 …Base::WriteBinFile((UT_TMP_PATH + "/base-discover.result").c_str(), (uint8_t *)bufString.c_str(), … in OrderFindTargets() 252 Base::TryCloseHandle((const uv_handle_t *)req, Base::CloseTimerCallback); in OrderConnecTargetResult() 269 Base::ZeroBuf(hChannel->bufStd, 2); in NewConnectTry() 273 Base::TimerUvTask(loopMain, hChannel, OrderConnecTargetResult, 10); in NewConnectTry() 328 …Base::WriteBinFile((UT_TMP_PATH + "/base-list.result").c_str(), (uint8_t *)MESSAGE_SUCCESS.c_str(), in GetTargetList() 346 … 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() 121 std::string strPath = Base::UnicodeToUtf8(path, true); in PullupServerWin32() 136 … if (sprintf_s(buf, sizeof(buf), "dummy -l %d -s %s -m", Base::GetLogLevel(), listenString) < 0) { in PullupServerWin32() 188 Base::CloseFd(fd); in PullupServer() 255 …out = Base::StringFormat("%s\t\t%s\t%s\t%s\n", hdi->connectKey.c_str(), sConn.c_str(), sStatus.c_s… in BuildDaemonVisableLine() 259 out = Base::StringFormat("%s\n", hdi->connectKey.c_str()); in BuildDaemonVisableLine() 418 Base::DelayDoSimple(&loopMain, waitDaemonReconnect, funcDelayUsbNotify); in NotifyInstanceSessionFree() 586 Base::TryCloseHandle((uv_handle_t *)&hChannel->hChildWorkTCP); // detch client channel in FetchCommand() [all …]
|
/developtools/hdc/src/common/ |
D | async_cmd.cpp | 44 Base::CloseFd(fd); in ReadyForRelease() 107 Base::DeInitProcess(); in Popen() 114 Base::CloseFd(fds[pipeRead]); in Popen() 115 Base::CloseFd(fds[pipeWrite]); in Popen() 119 string shellPath = Base::GetShellPath(); in Popen() 124 Base::CloseFd(fds[pipeWrite]); in Popen() 127 Base::CloseFd(fds[pipeRead]); in Popen() 143 Base::Trim(cmd, "\""); in ExecuteCommand()
|
D | channel.cpp | 127 Base::TryCloseHandle((uv_handle_t *)tcp); in ReadStream() 178 Base::TryCloseHandle((uv_handle_t *)req->handle); in WriteCallback() 206 uv_close((uv_handle_t *)handle, Base::CloseIdleCallback); in AsyncMainLoopTask() 223 Base::IdleUvTask(thisClass->loopMain, param, AsyncMainLoopTask); in MainAsyncCallback() 319 Base::SendToStreamEx(sendStream, data, sizeNewBuf, nullptr, (void *)WriteCallback, data); in SendChannel() 344 Base::ReallocBuf(&context->ioBuf, &context->bufSize, Base::GetMaxBufSize() * 4); in AllocCallback() 353 uid = static_cast<uint32_t>(Base::GetRandom()); in GetChannelPseudoUid() 399 Base::TryCloseHandle((const uv_handle_t *)handle, Base::CloseIdleCallback); in FreeChannelFinally() 411 Base::TryCloseHandle((uv_handle_t *)handle); in FreeChannelContinue() 419 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() 64 Base::TryCloseHandle((uv_handle_t *)&asyncMainLoop); in ~HdcSessionBase() 125 Base::TryCloseHandle((uv_handle_t *)handle, Base::CloseTimerCallback); in BeginRemoveTask() 127 …Base::TimerUvTask(hTask->runLoop, hTask, taskClassDeleteRetry, (GLOBAL_TIMEOUT * TIME_BASE) / UV_D… in BeginRemoveTask() 184 uv_close((uv_handle_t *)handle, Base::CloseIdleCallback); in ReMainLoopForInstanceClear() 187 Base::IdleUvTask(&loopMain, this, clearSessionsForFinish); in ReMainLoopForInstanceClear() 293 Base::TryCloseHandle((uv_handle_t *)handle, Base::CloseIdleCallback); in AsyncMainLoopTask() 304 Base::IdleUvTask(&thisClass->loopMain, param, AsyncMainLoopTask); in MainAsyncCallback() 391 uid = static_cast<uint32_t>(Base::GetRandom()); in GetSessionPseudoUid() 438 Base::CreateSocketPair(hSession->ctrlFd); in MallocSession() [all …]
|
D | transfer.cpp | 219 Base::GetMaxBufSize() * thisClass->maxTransferBufFactor); in OnFileIO() 345 Base::SplitString(filter, ";", filterStrings); in GetSubFiles() 421 GetSubFilesRecursively(path + Base::GetPathSep() + dent.name, in GetSubFilesRecursively() 422 currentDirname + Base::GetPathSep() + dent.name, out); in GetSubFilesRecursively() 428 out->push_back(currentDirname + Base::GetPathSep() + fileName); in GetSubFilesRecursively() 451 char sep = Base::GetPathSep(); in CheckLocalPath() 453 Base::SplitString(localPath, split, dirsOflocalPath); in CheckLocalPath() 458 if (!Base::IsAbsolutePath(localPath)) { in CheckLocalPath() 474 makedirPath = makedirPath + Base::GetPathSep() + dir; in CheckLocalPath() 475 if (!Base::TryCreateDirectory(makedirPath, errStr)) { in CheckLocalPath() [all …]
|
D | file.cpp | 41 char **argv = Base::SplitCommandToArgs(command.c_str(), &argc); in BeginTransfer() 123 context->localName = Base::GetFullFilePath(context->localPath); in SetMasterParameters() 126 …if (!Base::CheckDirectoryOrPath(context->localPath.c_str(), true, true, errStr, mode) && (mode & S… in SetMasterParameters() 135 context->localDirName = Base::GetPathWithoutFilename(context->localPath); in SetMasterParameters() 171 uint64_t nMSec = Base::GetRuntimeMSec() - in TransferSummary() 219 Base::SplitString(dirMode.fullName, "/", dirsOfOptName); in FileModeSync() 222 Base::SplitString(dirMode.fullName, "\\", dirsOfOptName); in FileModeSync() 232 dirMode.fullName = dirMode.fullName + Base::GetPathSep() + s; in FileModeSync() 287 ctxNow.transferDirBegin = Base::GetRuntimeMSec(); in SlaveCheck() 289 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() 189 Base::TryCloseHandle((uv_handle_t *)&ctx->tcp, true, funcHandleClose); in FreeContext() 194 Base::TryCloseHandle((uv_handle_t *)&ctx->pipe, true, funcHandleClose); in FreeContext() 210 if (bufSize > Base::GetMaxBufSize() * 2) { in SendToTask() 378 string resolvedPath = Base::CanonicalizeSpecPath(sNodeCfg); in SetupDevicePoint() 413 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()
|
/developtools/ace_ets2bundle/compiler/test/pages/ |
D | ImportNest.ets | 16 import { textExtend as tExtend, BaseComponent as Base } from './BaseComponent'; 18 export default Base;
|