File tree 1 file changed +16
-3
lines changed
1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -655,8 +655,15 @@ IPv6Address WiFiSTAClass::localIPv6()
655
655
bool WiFiSTAClass::_smartConfigStarted = false ;
656
656
bool WiFiSTAClass::_smartConfigDone = false ;
657
657
658
-
659
- bool WiFiSTAClass::beginSmartConfig () {
658
+ /* *
659
+ * @brief
660
+ *
661
+ * @param type Select type of SmartConfig. Default type is SC_TYPE_ESPTOUCH
662
+ * @param crypt_key When using type SC_TYPE_ESPTOUTCH_V2 crypt key needed, else ignored. Lenght should be 16 chars.
663
+ * @return true if configuration is successful.
664
+ * @return false if configuration fails.
665
+ */
666
+ bool WiFiSTAClass::beginSmartConfig (smartconfig_type_t type, char * crypt_key) {
660
667
esp_err_t err;
661
668
if (_smartConfigStarted) {
662
669
return false ;
@@ -668,7 +675,13 @@ bool WiFiSTAClass::beginSmartConfig() {
668
675
esp_wifi_disconnect ();
669
676
670
677
smartconfig_start_config_t conf = SMARTCONFIG_START_CONFIG_DEFAULT ();
671
- err = esp_smartconfig_set_type (SC_TYPE_ESPTOUCH);
678
+
679
+ if (type == SC_TYPE_ESPTOUCH_V2){
680
+ conf.esp_touch_v2_enable_crypt = true ;
681
+ conf.esp_touch_v2_key = crypt_key;
682
+ }
683
+
684
+ err = esp_smartconfig_set_type (type);
672
685
if (err != ESP_OK) {
673
686
log_e (" SmartConfig Set Type Failed!" );
674
687
return false ;
You can’t perform that action at this time.
0 commit comments