diff --git a/components/UDPlogger b/components/UDPlogger index 4c4090f..6975d0d 160000 --- a/components/UDPlogger +++ b/components/UDPlogger @@ -1 +1 @@ -Subproject commit 4c4090f65326713edaa2690eca9fa9f812bce432 +Subproject commit 6975d0d7288f965cb6976398550f187644669ae3 diff --git a/components/esp-adv-button b/components/esp-adv-button index 7a47c65..2cb3973 160000 --- a/components/esp-adv-button +++ b/components/esp-adv-button @@ -1 +1 @@ -Subproject commit 7a47c659b5b5e17a5c69afc4524730daa7ce6335 +Subproject commit 2cb3973d96c002cbb79e5f1b8fe56798b011aaba diff --git a/components/esp-homekit b/components/esp-homekit index 62e2501..b869862 160000 --- a/components/esp-homekit +++ b/components/esp-homekit @@ -1 +1 @@ -Subproject commit 62e25013da3a33fee795896ae6a1252ffe4883f3 +Subproject commit b869862d2c89ff84fb46c641c8afd83cabb12f48 diff --git a/components/esp-homekit-common-functions b/components/esp-homekit-common-functions index 26bed52..69705bd 160000 --- a/components/esp-homekit-common-functions +++ b/components/esp-homekit-common-functions @@ -1 +1 @@ -Subproject commit 26bed5216da6e252ac631705569ddee5045bafc6 +Subproject commit 69705bdc07007bb3467ac0d1c4667f5b66bafc2d diff --git a/components/esp-wifi-config b/components/esp-wifi-config index fe2e989..06901b7 160000 --- a/components/esp-wifi-config +++ b/components/esp-wifi-config @@ -1 +1 @@ -Subproject commit fe2e98971c4af763b2f71c0a03a1d63a26883ece +Subproject commit 06901b7d115572b62d0f638157b31e3299010731 diff --git a/components/esp-wolfssl b/components/esp-wolfssl index 7021efd..790b040 160000 --- a/components/esp-wolfssl +++ b/components/esp-wolfssl @@ -1 +1 @@ -Subproject commit 7021efd84f54c7dab11e85d33541a93f67b33d61 +Subproject commit 790b040170e36381e280d881bb882ba8b414d86c diff --git a/src/Makefile b/src/Makefile index 5a1bde1..e45d791 100644 --- a/src/Makefile +++ b/src/Makefile @@ -33,6 +33,7 @@ EXTRA_CFLAGS += -DHOMEKIT_OVERCLOCK_PAIR_VERIFY EXTRA_CFLAGS += -DHOMEKIT_OVERCLOCK_PAIR_SETUP EXTRA_CFLAGS += -DUDPLOG_PRINTF_TO_UDP EXTRA_CFLAGS += -DUDPLOG_PRINTF_ALSO_SERIAL +EXTRA_CFLAGS += -DconfigUSE_TRACE_FACILITY diff --git a/src/main.c b/src/main.c index 744fe00..b50566e 100644 --- a/src/main.c +++ b/src/main.c @@ -146,13 +146,28 @@ homekit_accessory_t *accessories[] = { }; +void recover_from_reset (int reason){ + /* called if we restarted abnormally */ + printf ("%s: reason %d\n", __func__, reason); + load_characteristic_from_flash(&switch_on); + relay_write(switch_on.value.bool_value, relay_gpio); +} + +void save_characteristics ( ){ + /* called on a timer to save an values yuo want save after update */ + printf ("%s:\n", __func__); + /* save_characteristic_to_flash(&switch_on, switch_on.value); don't reall need to sabve state of a light switch */ + save_characteristic_to_flash(&wifi_check_interval, wifi_check_interval.value); +} + + 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 */ - + homekit_characteristic_notify(&switch_on, switch_on.value); } homekit_server_config_t config = {