@@ -395,9 +395,16 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_pycom_wifi_mode_obj, 0, 1, mod_py
395
395
396
396
STATIC mp_obj_t mod_pycom_wifi_ssid_sta (mp_uint_t n_args , const mp_obj_t * args ) {
397
397
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
+ {
399
404
config_set_sta_wifi_ssid ((uint8_t * )(mp_obj_str_get_str (args [0 ])), true);
400
405
}
406
+ else {/*Nothing*/ }
407
+
401
408
} else {
402
409
uint8_t * ssid = (uint8_t * )m_malloc (33 );
403
410
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
418
425
419
426
STATIC mp_obj_t mod_pycom_wifi_pwd_sta (mp_uint_t n_args , const mp_obj_t * args ) {
420
427
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
+ {
422
434
config_set_wifi_sta_pwd ((uint8_t * )(mp_obj_str_get_str (args [0 ])), true);
423
435
}
436
+ else {/*Nothing*/ }
424
437
} else {
425
438
uint8_t * pwd = (uint8_t * )m_malloc (65 );
426
439
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
441
454
442
455
STATIC mp_obj_t mod_pycom_wifi_ssid_ap (mp_uint_t n_args , const mp_obj_t * args ) {
443
456
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
+ {
445
463
config_set_wifi_ap_ssid ((uint8_t * )(mp_obj_str_get_str (args [0 ])));
446
464
}
465
+ else {/*Nothing*/ }
447
466
} else {
448
467
uint8_t * ssid = (uint8_t * )m_malloc (33 );
449
468
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
464
483
465
484
STATIC mp_obj_t mod_pycom_wifi_pwd_ap (mp_uint_t n_args , const mp_obj_t * args ) {
466
485
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
+ {
468
492
config_set_wifi_ap_pwd ((uint8_t * )(mp_obj_str_get_str (args [0 ])));
469
493
}
494
+ else {/*Nothing*/ }
470
495
} else {
471
496
uint8_t * pwd = (uint8_t * )m_malloc (65 );
472
497
mp_obj_t pwd_obj ;
0 commit comments