Skip to content

Commit

Permalink
add bin and ESP Launchpad support
Browse files Browse the repository at this point in the history
  • Loading branch information
lisir233 committed Sep 23, 2023
1 parent 9f98ce6 commit a7cfec1
Show file tree
Hide file tree
Showing 54 changed files with 9,969 additions and 0 deletions.
Binary file added bin/esp32c3_switch_v1_0.bin
Binary file not shown.
65 changes: 65 additions & 0 deletions components/esp_hap_core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
set(HAP_SDK_VER "4.0")
execute_process (
COMMAND bash -c "git log --pretty=format:\"%h\" -1"
OUTPUT_VARIABLE GIT_COMMIT
WORKING_DIRECTORY ${COMPONENT_DIR}
)
#execute_process(COMMAND "git log --pretty=format:\"%h\"" -1 OUTPUT_VARIABLE GIT_COMMIT)
set(MFI_VER ${HAP_SDK_VER}-${GIT_COMMIT})
message(STATUS ${MFI_VER})


# CORE
set(srcs src/byte_convert.c
src/esp_hap_acc.c
src/esp_hap_bct.c
src/esp_hap_char.c
src/esp_hap_controllers.c
src/esp_hap_database.c
src/esp_hap_ip_services.c
src/esp_hap_keystore.c
src/esp_hap_main.c
src/esp_hap_mdns.c
src/esp_hap_network_io.c
src/esp_hap_pair_common.c
src/esp_hap_pair_setup.c
src/esp_hap_pair_verify.c
src/esp_hap_pairings.c
src/esp_hap_serv.c
src/esp_hap_wifi.c
src/esp_hap_setup_payload.c
src/hexbin.c
src/hexdump.c
src/esp_mfi_debug.c)

set(priv_includes src/priv_includes)

if(CONFIG_HAP_MFI_ENABLE)
list(APPEND srcs src/mfi/esp_mfi_auth.c src/mfi/esp_mfi_coprocessor.c src/mfi/esp_mfi_element.c src/mfi/esp_mfi_sap.c src/mfi/esp_mfi_pair_setup.c src/mfi/esp_hap_secure_message.c src/mfi/esp_mfi_wac.c src/mfi/esp_hap_wifi_transport.c)
list(APPEND priv_includes src/mfi)
else()
list(APPEND srcs src/esp_mfi_dummy.c)

endif()

set(priv_req libsodium esp_http_server hkdf-sha mu_srp json_generator json_parser esp_hap_platform esp_hap_apple_profiles mdns)
# esp_timer component was introduced in v4.2
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER "4.1")
list(APPEND priv_req esp_timer)
endif()

if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0")
list(APPEND priv_req esp_wifi)
list(APPEND req esp_event)
endif()

idf_component_register(SRCS ${srcs}
INCLUDE_DIRS "include"
PRIV_INCLUDE_DIRS ${priv_includes}
REQUIRES ${req}
PRIV_REQUIRES ${priv_req})
component_compile_options(-Wno-unused-function)
target_compile_definitions(${COMPONENT_TARGET} PRIVATE "-D MFI_VER=\"${MFI_VER}\"")
# Added just to automatically trigger re-runs of CMake
git_describe(ESP_HOMEKIT_VERSION ${COMPONENT_DIR})
message(STATUS "ESP HomeKit SDK Project commit: " ${ESP_HOMEKIT_VERSION})
21 changes: 21 additions & 0 deletions components/esp_hap_core/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
menu "HomeKit"

config HAP_MFI_ENABLE
bool "Enable MFi"
default n
help
If you have the MFi variant of the SDK, set this to true to use features like
HW authentication, software token authentication and WAC.

config HAP_SESSION_KEEP_ALIVE_ENABLE
bool "Enable Keep Alive on sessions"
default n
depends on !HAP_MFI_ENABLE
help
Enable Keep Alive on Controller Sessions so that stale connections do not stay
open indefinitely. Note that the HomeKit Specs do not allow this and so, this
should be enabled at your own risk. Even without this option, the HomeKit core
will close stale session using the HTTP Server's Least Recently Used (LRU) purge
logic.

endmenu
18 changes: 18 additions & 0 deletions components/esp_hap_core/component.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Component Makefile
#
HAP_SDK_VER := "4.0"
COMPONENT_SRCDIRS := src
COMPONENT_PRIV_INCLUDEDIRS := src/priv_includes
MFI_VER := $(HAP_SDK_VER)-$(shell git log --pretty=format:"%h" -1)

ifdef CONFIG_HAP_MFI_ENABLE
COMPONENT_SRCDIRS += src/mfi
COMPONENT_OBJEXCLUDE += src/esp_mfi_dummy.o
COMPONENT_PRIV_INCLUDEDIRS += src/mfi
endif

CPPFLAGS += -D MFI_VER=\"$(MFI_VER)\"

CFLAGS += -Wno-unused-function
COMPONENT_ADD_INCLUDEDIRS := include
10 changes: 10 additions & 0 deletions components/esp_hap_core/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## IDF Component Manager Manifest File
dependencies:
espressif/libsodium:
version: "~1.0.20"
rules:
- if: "idf_version >=5.0"
espressif/mdns:
rules:
- if: "idf_version >=5.0"

Loading

0 comments on commit a7cfec1

Please sign in to comment.