diff --git a/.gitignore b/.gitignore index c4c7f65..e003da9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.qtc_clangd \ No newline at end of file +.qtc_clangd +build \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..1647735 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1680095136180 + + + + + + \ No newline at end of file diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index b4269a9..0ea4ffe 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -12,7 +12,8 @@ "compilerPath": "/usr/bin/clang", "cStandard": "c17", "cppStandard": "c++17", - "intelliSenseMode": "macos-clang-x64" + "intelliSenseMode": "macos-clang-x64", + "configurationProvider": "ms-vscode.cmake-tools" } ], "version": 4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 85d661a..47ea4e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,11 @@ include_directories( include ) +link_directories( +lib/ +) + + set (SRCS include/DataType.h include/DecodeCardSdk.h @@ -25,6 +30,7 @@ set (SRCS main.cpp ) - add_executable(${CMAKE_PROJECT_NAME} ${SRCS}) +target_link_libraries(${CMAKE_PROJECT_NAME} libhcnetsdk.so) +target_link_libraries(${CMAKE_PROJECT_NAME} libhpr.so) \ No newline at end of file diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user new file mode 100644 index 0000000..995a5eb --- /dev/null +++ b/CMakeLists.txt.user @@ -0,0 +1,417 @@ + + + + + + EnvironmentId + {e8c938e2-c8fa-4354-a6d6-5cb042d4a566} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + true + Builtin.DefaultTidyAndClazy + 4 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + 桌面 + 桌面 + {976a26f7-9753-41c3-a002-83e83b921ad8} + 1 + 0 + 0 + + Debug + 2 + false + + -DCMAKE_GENERATOR:STRING=Unix Makefiles +-DCMAKE_BUILD_TYPE:STRING=Debug +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{buildDir}/.qtc/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} +-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} + /home/kingecg/code/build-hkstreamer-unknown-Debug + + + + + all + + false + + true + 构建 + CMakeProjectManager.MakeStep + + 1 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + + + clean + + false + + true + 构建 + CMakeProjectManager.MakeStep + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Debug + CMakeProjectManager.CMakeBuildConfiguration + + + Release + 2 + false + + -DCMAKE_GENERATOR:STRING=Unix Makefiles +-DCMAKE_BUILD_TYPE:STRING=Release +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{buildDir}/.qtc/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} +-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} + /home/kingecg/code/build-hkstreamer-unknown-Release + + + + + all + + false + + true + 构建 + CMakeProjectManager.MakeStep + + 1 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + + + clean + + false + + true + 构建 + CMakeProjectManager.MakeStep + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Release + CMakeProjectManager.CMakeBuildConfiguration + + + RelWithDebInfo + 2 + false + + -DCMAKE_GENERATOR:STRING=Unix Makefiles +-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{buildDir}/.qtc/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} +-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} + /home/kingecg/code/build-hkstreamer-unknown-RelWithDebInfo + + + + + all + + false + + true + CMakeProjectManager.MakeStep + + 1 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + + + clean + + false + + true + CMakeProjectManager.MakeStep + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Release with Debug Information + CMakeProjectManager.CMakeBuildConfiguration + + + RelWithDebInfo + 2 + false + + -DCMAKE_GENERATOR:STRING=Unix Makefiles +-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{buildDir}/.qtc/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} +-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} + 0 + /home/kingecg/code/build-hkstreamer-unknown-Profile + + + + + all + + false + + true + CMakeProjectManager.MakeStep + + 1 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + + + clean + + false + + true + CMakeProjectManager.MakeStep + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Profile + CMakeProjectManager.CMakeBuildConfiguration + + + MinSizeRel + 2 + false + + -DCMAKE_GENERATOR:STRING=Unix Makefiles +-DCMAKE_BUILD_TYPE:STRING=MinSizeRel +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{buildDir}/.qtc/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} +-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} + /home/kingecg/code/build-hkstreamer-unknown-MinSizeRel + + + + + all + + false + + true + CMakeProjectManager.MakeStep + + 1 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + + + clean + + false + + true + CMakeProjectManager.MakeStep + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Minimum Size Release + CMakeProjectManager.CMakeBuildConfiguration + + 5 + + + 0 + 部署 + 部署 + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + + 2 + + hkstreamer + CMakeProjectManager.CMakeRunConfiguration.hkstreamer + hkstreamer + false + true + true + false + true + /home/kingecg/code/build-hkstreamer-unknown-Release + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/cmake-build-debug/CMakeFiles/clion-log.txt b/cmake-build-debug/CMakeFiles/clion-log.txt new file mode 100644 index 0000000..c452f4f --- /dev/null +++ b/cmake-build-debug/CMakeFiles/clion-log.txt @@ -0,0 +1 @@ +CMakeLists.txt not found in /home/kingecg/code/hkstreamer Select CMakeLists.txt diff --git a/hkstreamer.creator.user b/hkstreamer.creator.user index f1c8a49..256b2fd 100644 --- a/hkstreamer.creator.user +++ b/hkstreamer.creator.user @@ -1,10 +1,10 @@ - + EnvironmentId - {b1d6c31c-e354-4f9b-a89f-0f02a67ed6d1} + {e8c938e2-c8fa-4354-a6d6-5cb042d4a566} ProjectExplorer.Project.ActiveTarget @@ -87,14 +87,14 @@ ProjectExplorer.Project.Target.0 Desktop - Desktop (x86-darwin-generic-mach_o-32bit) - Desktop (x86-darwin-generic-mach_o-32bit) - {ea69aa4c-9f65-4091-af6f-c8dca7313cfe} + 桌面 + 桌面 + {976a26f7-9753-41c3-a002-83e83b921ad8} 0 0 0 - /Users/chengguang/code/hkstreamer + /home/kingecg/code/hkstreamer diff --git a/hkstreamer.creator.user.b1d6c31 b/hkstreamer.creator.user.b1d6c31 new file mode 100644 index 0000000..f1c8a49 --- /dev/null +++ b/hkstreamer.creator.user.b1d6c31 @@ -0,0 +1,175 @@ + + + + + + EnvironmentId + {b1d6c31c-e354-4f9b-a89f-0f02a67ed6d1} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + true + Builtin.DefaultTidyAndClazy + 4 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop (x86-darwin-generic-mach_o-32bit) + Desktop (x86-darwin-generic-mach_o-32bit) + {ea69aa4c-9f65-4091-af6f-c8dca7313cfe} + 0 + 0 + 0 + + /Users/chengguang/code/hkstreamer + + + + all + + true + GenericProjectManager.GenericMakeStep + + 1 + 构建 + 构建 + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + GenericProjectManager.GenericMakeStep + + 1 + 清除 + 清除 + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + 默认 + GenericProjectManager.GenericBuildConfiguration + + 1 + + + 0 + 部署 + 部署 + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + + 2 + + ProjectExplorer.CustomExecutableRunConfiguration + + false + true + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/main.cpp b/main.cpp index 89d9d2c..ea5c916 100644 --- a/main.cpp +++ b/main.cpp @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) error("Must set device address"); } LoginInfo loginInfo = {0}; - strlcpy(loginInfo.sDeviceAddress, pMap.at("d").c_str(), sizeof(pMap.at("d").c_str())); + strcpy(loginInfo.sDeviceAddress, pMap.at("d").c_str()); strcpy(loginInfo.sUserName, pMap.at("u").c_str()); strcpy(loginInfo.sPassword, pMap.at("p").c_str()); if (cmd == "playback")