diff --git a/.gitignore b/.gitignore index 1e47516..3384325 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ esp-homekit-sonoff-mini.xcodeproj/ build/ firmware/ src/.DS_Store +src/udplog-client .DS_Store diff --git a/src/Makefile b/src/Makefile index b495348..5a1bde1 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 531b8a3..744fe00 100644 --- a/src/main.c +++ b/src/main.c @@ -54,6 +54,10 @@ void switch_on_callback(homekit_characteristic_t *_ch, homekit_value_t on, void 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 task_stats = HOMEKIT_CHARACTERISTIC_(CUSTOM_TASK_STATS, false , .setter=task_stats_set); + 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); @@ -132,6 +136,8 @@ homekit_accessory_t *accessories[] = { &switch_on, &ota_trigger, &wifi_reset, + &wifi_check_interval, + &task_stats, NULL }), NULL @@ -139,6 +145,11 @@ 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 */