Skip to content

Commit

Permalink
Merge pull request #22 from hedrosistemas/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
wjsan authored Sep 11, 2024
2 parents f82b89c + 5351302 commit b8a68f6
Show file tree
Hide file tree
Showing 362 changed files with 36,996 additions and 137,993 deletions.
110 changes: 0 additions & 110 deletions .vscode/bkp.json

This file was deleted.

57 changes: 32 additions & 25 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,36 @@
{
"env": {
"IDF_COMPILER": "C:\\Users\\intec\\.espressif\\tools\\xtensa-esp-elf\\esp-13.2.0_20230928\\xtensa-esp-elf\\bin\\xtensa-esp32-elf-gcc.exe"
},
"configurations": [
{
"name": "windows-gcc-x64",
"compilerPath": "C:/ProgramData/mingw64/mingw64/bin/gcc.exe",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x64",
"compilerArgs": [
""
],
"configurationProvider": "ms-vscode.cmake-tools"
},
{
"name": "esp32",
"forcedInclude": [
"${workspaceFolder}/examples/esp32/build/config/sdkconfig.h"
],
"defines": [
"ESP_PLATFORM"
],
"compilerPath": "C:/Users/BINAR/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe",
"name": "ESP-IDF",
"compilerPath": "${IDF_COMPILER}",
"includePath": [
"${config:idf.espIdfPath}/components/**",
"${config:idf.espIdfPathWin}/components/**",
"${config:idf.espAdfPath}/components/**",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}/include/**"
"${workspaceFolder}/include/**",
"${workspaceFolder}/src/esp32/**",
"${workspaceFolder}/src/proto/**",
"${workspaceFolder}/src/common/**"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${config:idf.espAdfPath}/components/**",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}/examples/esp32/**",
"${workspaceFolder}/src/esp32/**"
],
"${config:idf.espIdfPathWin}/components"
],
"limitSymbolsToIncludedHeaders": false
}
},
"compilerArgs": [
"-DESP_PLATFORM",
"-DIDF_VER"
]
},
{
"name": "esp8266",
Expand Down Expand Up @@ -78,12 +71,26 @@
"-mcpu=cortex-m4"
],
"includePath": [
"../nRF5_SDK_17/components/**",
"../nRF5_SDK_17/components/ant/**",
"../nRF5_SDK_17/components/ble/**",
"../nRF5_SDK_17/components/boards/**",
"../nRF5_SDK_17/components/drivers_ext/**",
"../nRF5_SDK_17/components/drivers_nrf/**",
"../nRF5_SDK_17/components/libraries/**",
"../nRF5_SDK_17/components/nfc/**",
"../nRF5_SDK_17/components/proprietary_rf/**",
"../nRF5_SDK_17/components/serialization/**",
"../nRF5_SDK_17/components/softdevice/common/**",
"../nRF5_SDK_17/components/softdevice/mbr/**",
"../nRF5_SDK_17/components/softdevice/s140/**",
"../nRF5_SDK_17/components/toolchain/**",
"../nRF5_SDK_17/modules/**",
"../nRF5_SDK_17/external/**",
"../nRF5_SDK_17/integration/**",
"${workspaceFolder}/include/**",
"${workspaceFolder}/src/nrf"
"${workspaceFolder}/src/proto/**",
"${workspaceFolder}/src/nrf",
"../hg_ble/**"
],
"forcedInclude": [],
"defines": [
Expand Down
8 changes: 6 additions & 2 deletions CMakelists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

cmake_minimum_required(VERSION 3.5)

add_subdirectory(examples/iot_device)
add_subdirectory(examples/http_server)
add_subdirectory(examples/mqtt_client)
add_subdirectory(examples/nrf_dfu_master)
add_subdirectory(tests)
add_subdirectory(examples/tcp_server)
add_subdirectory(examples/tcp_client)
add_subdirectory(examples/uart)
add_subdirectory(tests)
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
gen:
gen-c:
$(MAKE) gen L=c O=../src/proto -C proto -f Makefile

gen-py:
$(MAKE) gen L=python O=../scripts -C proto -f Makefile

help:
@echo gen: generate proto files
@echo gen-c: generate ANSI-C proto files
@echo gen-py: generate python proto files
51 changes: 16 additions & 35 deletions common/Common.cmake
Original file line number Diff line number Diff line change
@@ -1,44 +1,25 @@
set(CIOT_DIR_RELATIVE ../../)

get_filename_component(CIOT_DIR "${CMAKE_CURRENT_LIST_FILE}/${CIOT_DIR_RELATIVE}" ABSOLUTE)

message(${CIOT_DIR})
get_filename_component(CIOT_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)

set(CIOT_INCLUDE_DIRS
${CIOT_DIR}/include/types
${CIOT_DIR}/include
${CIOT_DIR}/src/mg
${CIOT_DIR}/src/mg/
${CIOT_DIR}/src/proto/protobuf-c
)

set(PROTOBUF_C_DIR ${CIOT_DIR}/src/proto/protobuf-c)

set(PROTO_INCLUDE_DIRS
${PROTOBUF_C_DIR}
${CIOT_DIR}/src/proto
set(CIOT_PB_INCLUDE_DIRS
${CIOT_DIR}/src/proto/
)

FILE(GLOB_RECURSE PROTOBUF_C ${PROTOBUF_C_DIR}/protobuf-c/*.c)
FILE(GLOB_RECURSE PROTO_CIOT ${CIOT_DIR}/src/proto/*.c)

FILE(GLOB_RECURSE CIOT_UNSUPPORTED ${CIOT_DIR}/src/unsupported/*.c)
FILE(GLOB_RECURSE CIOT_COMMON ${CIOT_DIR}/src/common/*.c)
FILE(GLOB_RECURSE CIOT_ESP32 ${CIOT_DIR}/src/esp32/*.c)
FILE(GLOB_RECURSE CIOT_MONGOOSE ${CIOT_DIR}/src/mg/*.c)
FILE(GLOB_RECURSE CIOT_WIN ${CIOT_DIR}/src/win/*.c)
FILE(GLOB_RECURSE CIOT_LINUX ${CIOT_DIR}/src/linux/*.c)

list(APPEND PROTO_SRCS ${PROTOBUF_C})
list(APPEND PROTO_SRCS ${PROTO_CIOT})

list(APPEND CIOT_ESP32_SRCS ${CIOT_COMMON})
list(APPEND CIOT_ESP32_SRCS ${CIOT_ESP32})
FILE(GLOB_RECURSE CIOT_COMMON_SRCS ${CIOT_DIR}/src/common/*.c)
FILE(GLOB_RECURSE CIOT_CORE_SRCS ${CIOT_DIR}/src/core/*.c)
FILE(GLOB_RECURSE CIOT_PB_C_SRCS ${CIOT_DIR}/src/proto/protobuf-c/protobuf-c/*.c)
FILE(GLOB_RECURSE CIOT_PB_V1_SRCS ${CIOT_DIR}/src/proto/ciot/proto/v1/*.c)

list(APPEND CIOT_PC_SRCS ${CIOT_UNSUPPORTED})
list(APPEND CIOT_PC_SRCS ${CIOT_COMMON})
list(APPEND CIOT_PC_SRCS ${CIOT_MONGOOSE})
list(APPEND CIOT_SRCS ${CIOT_COMMON_SRCS})
list(APPEND CIOT_SRCS ${CIOT_CORE_SRCS})
list(APPEND CIOT_SRCS ${CIOT_PB_C_SRCS})

if (UNIX)
list(APPEND CIOT_PC_SRCS ${CIOT_LINUX})
else()
list(APPEND CIOT_PC_SRCS ${CIOT_WIN})
endif()
FILE(GLOB_RECURSE CIOT_NRF_SRCS ${CIOT_DIR}/src/nrf/*.c)
FILE(GLOB_RECURSE CIOT_ESP32_SRCS ${CIOT_DIR}/src/esp32/*.c)
FILE(GLOB_RECURSE CIOT_MG_SRCS ${CIOT_DIR}/src/mg/*.c)
FILE(GLOB_RECURSE CIOT_WIN_SRCS ${CIOT_DIR}/src/win/*.c)
6 changes: 6 additions & 0 deletions common/common.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# PROJ_DIR = ../../..
# HDR_DIR = $(PROJ_DIR)/..
# HG_TCP_DIR = $(HDR_DIR)/hg_tcp
NRF_SDK_12 = F:/projects/hedrosistemas/nRF5_SDK_12
NRF_SDK_17 = F:/projects/hedrosistemas/nRF5_SDK_17
CIOT_DIR = F:/projects/hedrosistemas/hg/ciot_c
20 changes: 20 additions & 0 deletions examples/http_server/CMakelists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include(../../common/Common.cmake)

project(http_server)

FILE(GLOB_RECURSE MAIN_SRCS *.c)

include_directories(
${CIOT_INCLUDE_DIRS}
.
)

add_executable(${PROJECT_NAME}
${CIOT_SRCS}
${CIOT_MG_SRCS}
${MAIN_SRCS}
)

if(WIN32)
target_link_libraries(${PROJECT_NAME} ws2_32)
endif()
36 changes: 36 additions & 0 deletions examples/http_server/ciot_custom_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* @file ciot_custom_config.h
* @author your name ([email protected])
* @brief
* @version 0.1
* @date 2024-06-11
*
* @copyright Copyright (c) 2024
*
*/

#ifndef __CIOT_CUSTOM_CONFIG__H__
#define __CIOT_CUSTOM_CONFIG__H__

#define CIOT_CONFIG_LOG_LEVEL CIOT_LOG_LEVEL_INFO
#define CIOT_CONFIG_APP_VER 0, 1, 0
#define CIOT_CONFIG_HARDWARE_NAME "CIoT HTTP Server"

#define CIOT_CONFIG_FEATURE_STORAGE 0
#define CIOT_CONFIG_FEATURE_SYSTEM 1
#define CIOT_CONFIG_FEATURE_UART 0
#define CIOT_CONFIG_FEATURE_USB 0
#define CIOT_CONFIG_FEATURE_ETHERNET 0
#define CIOT_CONFIG_FEATURE_WIFI 0
#define CIOT_CONFIG_FEATURE_BLE_SCN 0
#define CIOT_CONFIG_FEATURE_GPIO 0
#define CIOT_CONFIG_FEATURE_NTP 0
#define CIOT_CONFIG_FEATURE_OTA 0
#define CIOT_CONFIG_FEATURE_DFU 0
#define CIOT_CONFIG_FEATURE_HTTP_CLIENT 0
#define CIOT_CONFIG_FEATURE_HTTP_SERVER 1
#define CIOT_CONFIG_FEATURE_MQTT_CLIENT 0
#define CIOT_CONFIG_FEATURE_TIMER 0
#define CIOT_CONFIG_FEATURE_SERIALIZER 0

#endif //!__CIOT_CUSTOM_CONFIG__H__
Loading

0 comments on commit b8a68f6

Please sign in to comment.