Skip to content

Commit

Permalink
1. 优化数据模板示例
Browse files Browse the repository at this point in the history
2. 自动代码生成初始置位属性状态为已变化,确保启动后全量上报一次属性状态
3. 更新相关文档
  • Loading branch information
yougaliu committed Nov 14, 2019
1 parent 7f899f9 commit a7c3588
Show file tree
Hide file tree
Showing 12 changed files with 781 additions and 91 deletions.
28 changes: 12 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,33 +57,29 @@ set(FEATURE_AT_DEBUG OFF)
######################CONFIG END######################################

# 设置CMAKE使用编译工具及编译选项
if (PLATFORM STREQUAL "linux" AND COMPILE_TOOLS STREQUAL "gcc")
set(CMAKE_C_COMPILER ${COMPILE_TOOLS})
if(${BUILD_TYPE} STREQUAL "release")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall -Wno-error=sign-compare -Wno-error=format -Os -pthread") # 编译选项
elseif(${BUILD_TYPE} STREQUAL "debug")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Werror -Wall -Wno-error=sign-compare -Wno-error=format -Os -pthread") # 编译选项
endif()
elseif (PLATFORM STREQUAL "linux" AND COMPILE_TOOLS STREQUAL "arm-none-linux-gnueabi-gcc")
set(CMAKE_C_COMPILER ${COMPILE_TOOLS})


if ((NOT COMPILE_TOOLS STREQUAL "gcc") AND (NOT COMPILE_TOOLS STREQUAL "MSVC"))
#用户自定义
set(CMAKE_C_COMPILER ${COMPILE_TOOLS}) # 编译工具
message(WARNING "User defined platform or compile tools!")
endif()

if(CMAKE_COMPILER_IS_GNUCC)
if(${BUILD_TYPE} STREQUAL "release")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall -Wno-error=sign-compare -Wno-error=format -Os -pthread") # 编译选项
elseif(${BUILD_TYPE} STREQUAL "debug")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Werror -Wall -Wno-error=sign-compare -Wno-error=format -Os -pthread") # 编译选项
endif()
elseif (PLATFORM STREQUAL "windows" AND COMPILE_TOOLS STREQUAL "MSVC")
# 去除相应的警告
endif()

if(CMAKE_COMPILER_IS_CLANG)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -D_USE_32BIT_TIME_T)
if(CMAKE_C_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W2" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2")
endif()
else ()
#用户自定义
set(CMAKE_C_COMPILER ${COMPILE_TOOLS}) # 编译工具
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall -Wno-error=sign-compare -Wno-error=format -Os") # 编译选项
message(WARNING "User defined platform or compile tools!")
endif()

# 解析配置
Expand Down
5 changes: 5 additions & 0 deletions device_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,10 @@
"cert_deviceinfo":{
"devCertFile":"YOUR_DEVICE_CERT_FILE_NAME",
"devPrivateKeyFile":"YOUR_DEVICE_PRIVATE_KEY_FILE_NAME"
},

"subDev":{
"sub_productId":"YOUR_SUBDEV_PRODUCT_ID",
"sub_devName":"YOUR_SUBDEV_DEVICE_NAME"
}
}
Loading

0 comments on commit a7c3588

Please sign in to comment.