maximkulkin / esp-homekit

Apple HomeKit accessory server library for ESP-OPEN-RTOS
MIT License
1.11k stars 170 forks source link

Support storing configuration on SPIFFS #2

Closed maximkulkin closed 6 years ago

maximkulkin commented 6 years ago

Currently accessory data (including internal key and pairing info) is stored on a flash by doing raw flash memory reads/writes. For flexibility it should support alternative storage backend - SPIFFS - which would allow accessory developers to choose from different options based on their own needs. Storages should be picked via preprocessor defines which will alias storage functions to particular implementation (e.g. homekit_storage_init() will be aliased either to homekit_flash_storage_init() or homekit_spiffs_storage_init()).

With SPIFFS storage user should be able to specify base directory for HomeKit related configuration files.

maximkulkin commented 6 years ago

Turned out that spiffs is too expensive and actually both approaches can coexist at the same time.