From 34ea95ef5bca970a0ad5edd3f12776f9842b74b3 Mon Sep 17 00:00:00 2001 From: maccoylton Date: Fri, 29 Nov 2019 20:03:16 +0000 Subject: [PATCH] udpated latest components and added wiifi check interval --- components/esp-homekit | 2 +- components/esp-homekit-common-functions | 2 +- src/Makefile | 2 +- src/main.c | 12 ++++++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/components/esp-homekit b/components/esp-homekit index 0c5139f..c11c005 160000 --- a/components/esp-homekit +++ b/components/esp-homekit @@ -1 +1 @@ -Subproject commit 0c5139f192adf24081a3e11a96d440e93b14b451 +Subproject commit c11c0059229cf43b7e53197fa601a84787bce9b9 diff --git a/components/esp-homekit-common-functions b/components/esp-homekit-common-functions index cbacffb..f155c8f 160000 --- a/components/esp-homekit-common-functions +++ b/components/esp-homekit-common-functions @@ -1 +1 @@ -Subproject commit cbacffb81ccc89a0338e3a7925c9191b2f9c5fcb +Subproject commit f155c8fd4d8c2484d74e6d3c4e00e32f65a9e3dc diff --git a/src/Makefile b/src/Makefile index 0c19fa2..b3ac7a4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -28,7 +28,7 @@ HOMEKIT_SMALL = 0 HOMEKIT_SPI_FLASH_BASE_ADDR ?= 0x8c000 EXTRA_CFLAGS += -I../.. -DHOMEKIT_SHORT_APPLE_UUIDS -EXTRA_CFLAGS += -DHOMEKIT_DEBUG +#EXTRA_CFLAGS += -DHOMEKIT_DEBUG EXTRA_CFLAGS += -DHOMEKIT_OVERCLOCK_PAIR_VERIFY EXTRA_CFLAGS += -DHOMEKIT_OVERCLOCK_PAIR_SETUP EXTRA_CFLAGS += -DUDPLOG_PRINTF_TO_UDP diff --git a/src/main.c b/src/main.c index c62cb92..06d5c26 100644 --- a/src/main.c +++ b/src/main.c @@ -53,6 +53,8 @@ void switch_on_callback(homekit_characteristic_t *_ch, homekit_value_t on, void *context); homekit_characteristic_t wifi_reset = HOMEKIT_CHARACTERISTIC_(CUSTOM_WIFI_RESET, false, .setter=wifi_reset_set); +homekit_characteristic_t wifi_check_interval = HOMEKIT_CHARACTERISTIC_(CUSTOM_WIFI_CHECK_INTERVAL, 10, .setter=wifi_check_interval_set); +/* checks the wifi is connected and flashes status led to indicated connected */ homekit_characteristic_t ota_trigger = API_OTA_TRIGGER; homekit_characteristic_t name = HOMEKIT_CHARACTERISTIC_(NAME, DEVICE_NAME); homekit_characteristic_t manufacturer = HOMEKIT_CHARACTERISTIC_(MANUFACTURER, DEVICE_MANUFACTURER); @@ -72,7 +74,7 @@ const int LED_GPIO = 13; const int button_gpio = 0; int led_off_value=1; /* global varibale to support LEDs set to 0 where the LED is connected to GND, 1 where +3.3v */ -const int status_led_gpio = 13; /*set the gloabl variable for the led to be sued for showing status */ +const int status_led_gpio = 13; /*set the gloabl variable for the led to be used for showing status */ @@ -129,6 +131,12 @@ homekit_accessory_t *accessories[] = { NULL }; + +void accessory_init_not_paired (void) { + /* initalise anything you don't want started until wifi and homekit imitialisation is confirmed, but not paired */ +} + + void accessory_init (void ){ /* initalise anything you don't want started until wifi and pairing is confirmed */ @@ -147,7 +155,7 @@ void user_init(void) { gpio_init(); - wifi_config_init("SonoffS20", NULL, on_wifi_ready); + wifi_config_init(DEVICE_NAME, NULL, on_wifi_ready); }