@@ -395,9 +395,16 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_pycom_wifi_mode_obj, 0, 1, mod_py
395395
396396STATIC mp_obj_t mod_pycom_wifi_ssid_sta (mp_uint_t n_args , const mp_obj_t * args ) {
397397 if (n_args ) {
398- if (MP_OBJ_IS_STR (args [0 ])) {
398+ if (args [0 ] == mp_const_none )
399+ {
400+ config_set_sta_wifi_ssid (NULL , true);
401+ }
402+ else if (MP_OBJ_IS_STR (args [0 ]))
403+ {
399404 config_set_sta_wifi_ssid ((uint8_t * )(mp_obj_str_get_str (args [0 ])), true);
400405 }
406+ else {/*Nothing*/ }
407+
401408 } else {
402409 uint8_t * ssid = (uint8_t * )m_malloc (33 );
403410 mp_obj_t ssid_obj ;
@@ -418,9 +425,15 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_pycom_wifi_ssid_sta_obj, 0, 1, mo
418425
419426STATIC mp_obj_t mod_pycom_wifi_pwd_sta (mp_uint_t n_args , const mp_obj_t * args ) {
420427 if (n_args ) {
421- if (MP_OBJ_IS_STR (args [0 ])) {
428+ if (args [0 ] == mp_const_none )
429+ {
430+ config_set_wifi_sta_pwd (NULL , true);
431+ }
432+ else if (MP_OBJ_IS_STR (args [0 ]))
433+ {
422434 config_set_wifi_sta_pwd ((uint8_t * )(mp_obj_str_get_str (args [0 ])), true);
423435 }
436+ else {/*Nothing*/ }
424437 } else {
425438 uint8_t * pwd = (uint8_t * )m_malloc (65 );
426439 mp_obj_t pwd_obj ;
@@ -441,9 +454,15 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_pycom_wifi_pwd_sta_obj, 0, 1, mod
441454
442455STATIC mp_obj_t mod_pycom_wifi_ssid_ap (mp_uint_t n_args , const mp_obj_t * args ) {
443456 if (n_args ) {
444- if (MP_OBJ_IS_STR (args [0 ])) {
457+ if (args [0 ] == mp_const_none )
458+ {
459+ config_set_wifi_ap_ssid (NULL );
460+ }
461+ else if (MP_OBJ_IS_STR (args [0 ]))
462+ {
445463 config_set_wifi_ap_ssid ((uint8_t * )(mp_obj_str_get_str (args [0 ])));
446464 }
465+ else {/*Nothing*/ }
447466 } else {
448467 uint8_t * ssid = (uint8_t * )m_malloc (33 );
449468 mp_obj_t ssid_obj ;
@@ -464,9 +483,15 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_pycom_wifi_ssid_ap_obj, 0, 1, mod
464483
465484STATIC mp_obj_t mod_pycom_wifi_pwd_ap (mp_uint_t n_args , const mp_obj_t * args ) {
466485 if (n_args ) {
467- if (MP_OBJ_IS_STR (args [0 ])) {
486+ if (args [0 ] == mp_const_none )
487+ {
488+ config_set_wifi_ap_pwd (NULL );
489+ }
490+ else if (MP_OBJ_IS_STR (args [0 ]))
491+ {
468492 config_set_wifi_ap_pwd ((uint8_t * )(mp_obj_str_get_str (args [0 ])));
469493 }
494+ else {/*Nothing*/ }
470495 } else {
471496 uint8_t * pwd = (uint8_t * )m_malloc (65 );
472497 mp_obj_t pwd_obj ;
0 commit comments