@@ -503,7 +503,7 @@ STATIC const mp_obj_type_t esp_socket_type = {
503503
504504#define MODESP_INCLUDE_CONSTANTS (1)
505505
506- static void error_check (bool status , const char * msg ) {
506+ void error_check (bool status , const char * msg ) {
507507 if (!status ) {
508508 nlr_raise (mp_obj_new_exception_msg (& mp_type_OSError , msg ));
509509 }
@@ -534,29 +534,6 @@ STATIC mp_obj_t esp_scan(mp_obj_t cb_in) {
534534}
535535STATIC MP_DEFINE_CONST_FUN_OBJ_1 (esp_scan_obj , esp_scan );
536536
537- STATIC mp_obj_t esp_connect (mp_uint_t n_args , const mp_obj_t * args ) {
538- struct station_config config = {{0 }};
539- mp_uint_t len ;
540- const char * p ;
541-
542- p = mp_obj_str_get_data (args [0 ], & len );
543- memcpy (config .ssid , p , len );
544- p = mp_obj_str_get_data (args [1 ], & len );
545- memcpy (config .password , p , len );
546-
547- error_check (wifi_station_set_config (& config ), "Cannot set STA config" );
548- error_check (wifi_station_connect (), "Cannot connect to AP" );
549-
550- return mp_const_none ;
551- }
552- STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (esp_connect_obj , 2 , 6 , esp_connect );
553-
554- STATIC mp_obj_t esp_disconnect () {
555- error_check (wifi_station_disconnect (), "Cannot disconnect from AP" );
556- return mp_const_none ;
557- }
558- STATIC MP_DEFINE_CONST_FUN_OBJ_0 (esp_disconnect_obj , esp_disconnect );
559-
560537STATIC mp_obj_t esp_status () {
561538 return MP_OBJ_NEW_SMALL_INT (wifi_station_get_connect_status ());
562539}
@@ -616,8 +593,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_flash_id_obj, esp_flash_id);
616593STATIC const mp_map_elem_t esp_module_globals_table [] = {
617594 { MP_OBJ_NEW_QSTR (MP_QSTR___name__ ), MP_OBJ_NEW_QSTR (MP_QSTR_esp ) },
618595
619- { MP_OBJ_NEW_QSTR (MP_QSTR_connect ), (mp_obj_t )& esp_connect_obj },
620- { MP_OBJ_NEW_QSTR (MP_QSTR_disconnect ), (mp_obj_t )& esp_disconnect_obj },
621596 { MP_OBJ_NEW_QSTR (MP_QSTR_scan ), (mp_obj_t )& esp_scan_obj },
622597 { MP_OBJ_NEW_QSTR (MP_QSTR_status ), (mp_obj_t )& esp_status_obj },
623598 { MP_OBJ_NEW_QSTR (MP_QSTR_mac ), (mp_obj_t )& esp_mac_obj },
0 commit comments