!12 update bin. code check happy

Merge pull request !12 from zako/master
This commit is contained in:
openharmony_ci 2021-07-02 03:07:12 +00:00 committed by Gitee
commit 2add6c9c5b
9 changed files with 1336 additions and 1299 deletions

11
prebuilt/README_zh.md Normal file
View File

@ -0,0 +1,11 @@
# 几点说明:
[1.通过git clone方式下载](#section662115419449)
建议通过gitclone方式下载该仓 命令为:
**git clone git@gitee.com:openharmony/developtools_hdc_standard.git**
[2.通过网页形式下载](#section15908143623714)
通过网页形式下载prebuilt请 使用类似如下URL打开网页 https://gitee.com/openharmony/developtools_hdc_standard/blob/master/prebuilt/windows/hdc-std.exe 点击中间下载方式进行下载windows版本文件大小在**5M左右**linux版本在**2M左右**,不要使用右击另存为方式进行保存下载,下载后检查文件大小。
[3.支持环境](#section161941989596)
支持运行环境 linux版本建议ubuntu20 CentOS8 64位其他版本相近也应该可以libc++.so引用错误请使用ldd\readelf等命令检查库引用 windows版本建议windows10 64位windows8也应该可以Windows7等EOF版本尚未测试如果低版本windows winusb库缺失请使用zadia更新库。

View File

@ -164,13 +164,14 @@ namespace Base {
va_end(ap);
}
// if can linkwith -lstdc++fs, use std::filesystem::path(path).filename();
string GetFileNameAny(string &path)
{
// if can linkwith -lstdc++fs, use std::filesystem::path(path).filename();
string tmpString = path;
size_t tmpNum = 0;
if ((tmpNum = tmpString.rfind('/')) == std::string::npos) {
if ((tmpNum = tmpString.rfind('\\')) == std::string::npos) {
size_t tmpNum = tmpString.rfind('/');
if (tmpNum == std::string::npos) {
tmpNum = tmpString.rfind('\\');
if (tmpNum == std::string::npos) {
return tmpString;
}
}
@ -1098,7 +1099,7 @@ namespace Base {
uv_os_sock_t dupFd = -1;
#ifdef _WIN32
WSAPROTOCOL_INFO info;
memset(&info, 0, sizeof(info));
ZeroStruct(info);
if (WSADuplicateSocketA(tcp->socket, GetCurrentProcessId(), &info) < 0) {
return dupFd;
}

File diff suppressed because it is too large Load Diff

1294
src/common/serial_struct_define.h Executable file

File diff suppressed because it is too large Load Diff

View File

@ -211,6 +211,26 @@ string HdcServer::GetDaemonMapList(uint8_t opType)
return ret;
}
void HdcServer::GetDaemonMapOnlyOne(HDaemonInfo &hDaemonInfoInOut)
{
uv_rwlock_rdlock(&daemonAdmin);
string key;
for (auto &i : mapDaemon) {
if (i.second->connStatus == STATUS_CONNECTED) {
if (key == STRING_EMPTY) {
key = i.first;
} else {
key = STRING_EMPTY;
break;
}
}
}
if (key.size() > 0) {
hDaemonInfoInOut = mapDaemon[key];
}
uv_rwlock_rdunlock(&daemonAdmin);
}
string HdcServer::AdminDaemonMap(uint8_t opType, const string &connectKey, HDaemonInfo &hDaemonInfoInOut)
{
string sRet;
@ -261,22 +281,7 @@ string HdcServer::AdminDaemonMap(uint8_t opType, const string &connectKey, HDaem
break;
}
case OP_GET_ONLY: {
uv_rwlock_rdlock(&daemonAdmin);
string key;
for (auto &i : mapDaemon) {
if (i.second->connStatus == STATUS_CONNECTED) {
if (key == STRING_EMPTY) {
key = i.first;
} else {
key = STRING_EMPTY;
break;
}
}
}
if (key.size() > 0) {
hDaemonInfoInOut = mapDaemon[key];
}
uv_rwlock_rdunlock(&daemonAdmin);
GetDaemonMapOnlyOne(hDaemonInfoInOut);
break;
}
case OP_UPDATE: { // Cannot update the Object HDi lower key value by direct value

View File

@ -52,6 +52,7 @@ private:
bool HandServerAuth(HSession hSession, SessionHandShake &handshake);
string GetDaemonMapList(uint8_t opType);
bool ServerSessionHandshake(HSession hSession, uint8_t *payload, int payloadSize);
void GetDaemonMapOnlyOne(HDaemonInfo &hDaemonInfoInOut);
uv_rwlock_t daemonAdmin;
map<string, HDaemonInfo> mapDaemon;

View File

@ -112,13 +112,14 @@ int TestTaskCommand(int method, const string &debugServerPort, const string &deb
"install /d/a.hap /mnt/hgfs/vtmp/b.hap /mnt/hgfs/vtmp -lrtsdpg"); // hap
break;
case UT_TEST_TMP:
TestRunClient(debugServerPort, debugConnectKey, "shell pwd");
#ifdef DEF_NULL
while (true) {
uv_sleep(50);
TestRunClient(debugServerPort, debugConnectKey, "list targets");
TestRunClient(debugServerPort, debugConnectKey, "shell id");
TestRunClient(debugServerPort, debugConnectKey, "shell bm dump -a");
}
#ifdef DEF_NULL
TestRunClient(debugServerPort, debugConnectKey, "install /d/helloworld.hap");
TestRunClient(debugServerPort, debugConnectKey, "target mount");
TestRunClient(debugServerPort, debugConnectKey, "shell pwd");