feat(esptouch_v2): support esptouch_v2

This commit is contained in:
chenwen
2020-11-11 18:43:45 +08:00
committed by Dong Heng
parent 48be630192
commit b9628e8608
17 changed files with 179 additions and 43 deletions

View File

@ -28,6 +28,7 @@ typedef enum {
SC_TYPE_ESPTOUCH = 0, /**< protocol: ESPTouch */
SC_TYPE_AIRKISS, /**< protocol: AirKiss */
SC_TYPE_ESPTOUCH_AIRKISS, /**< protocol: ESPTouch and AirKiss */
SC_TYPE_ESPTOUCH_V2, /**< protocol: ESPTouch V2*/
} smartconfig_type_t;
/** Smartconfig event declarations */
@ -54,12 +55,16 @@ typedef struct {
/** Configure structure for esp_smartconfig_start */
typedef struct {
bool enable_log; /**< Enable smartconfig logs. */
bool enable_log; /**< Enable smartconfig logs. */
bool esp_touch_v2_enable_crypt; /**< Enable ESPTOUCH V2 crypt. */
char* esp_touch_v2_key; /**< ESPTOUCH V2 crypt key, len should be 16. */
} smartconfig_start_config_t;
#define SMARTCONFIG_START_CONFIG_DEFAULT() { \
.enable_log = false \
};
.enable_log = false, \
.esp_touch_v2_enable_crypt = false,\
.esp_touch_v2_key = NULL \
};
/**
* @brief Get the version of SmartConfig.
@ -139,6 +144,18 @@ esp_err_t esp_smartconfig_set_type(smartconfig_type_t type);
*/
esp_err_t esp_smartconfig_fast_mode(bool enable);
/**
* @brief Get reserved data of ESPTouch_v2.
*
* @param rvd_data reserved data
* @param len length of reserved data
*
* @return
* - ESP_OK: succeed
* - others: fail
*/
esp_err_t esp_smartconfig_get_rvd_data(uint8_t* rvd_data, uint8_t len);
#ifdef __cplusplus
}
#endif