@@ -836,7 +836,7 @@ STATIC mp_obj_t wlan_make_new(const mp_obj_type_t *type, size_t n_args, size_t n
836836 if (n_args > 1 || n_kw > 0 ) {
837837 // check the peripheral id
838838 if (args [0 ].u_int != 0 ) {
839- mp_raise_msg ( & mp_type_OSError , mpexception_os_resource_not_avaliable );
839+ mp_raise_OSError ( MP_ENODEV );
840840 }
841841 // start the peripheral
842842 wlan_init_helper (self , & args [1 ]);
@@ -860,7 +860,7 @@ STATIC mp_obj_t wlan_scan(mp_obj_t self_in) {
860860
861861 // check for correct wlan mode
862862 if (wlan_obj .mode == ROLE_AP ) {
863- mp_raise_msg ( & mp_type_OSError , mpexception_os_request_not_possible );
863+ mp_raise_OSError ( MP_EPERM );
864864 }
865865
866866 Sl_WlanNetworkEntry_t wlanEntry ;
@@ -914,7 +914,7 @@ STATIC mp_obj_t wlan_connect(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_
914914
915915 // check for the correct wlan mode
916916 if (wlan_obj .mode == ROLE_AP ) {
917- mp_raise_msg ( & mp_type_OSError , mpexception_os_request_not_possible );
917+ mp_raise_OSError ( MP_EPERM );
918918 }
919919
920920 // parse args
@@ -962,7 +962,7 @@ STATIC mp_obj_t wlan_connect(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_
962962 modwlan_Status_t status ;
963963 status = wlan_do_connect (ssid , ssid_len , bssid , auth , key , key_len , timeout );
964964 if (status == MODWLAN_ERROR_TIMEOUT ) {
965- mp_raise_msg ( & mp_type_OSError , mpexception_os_operation_failed );
965+ mp_raise_OSError ( MP_ETIMEDOUT );
966966 } else if (status == MODWLAN_ERROR_INVALID_PARAMS ) {
967967 mp_raise_ValueError (mpexception_value_invalid_arguments );
968968 }
@@ -993,7 +993,7 @@ STATIC mp_obj_t wlan_ifconfig (mp_uint_t n_args, const mp_obj_t *pos_args, mp_ma
993993
994994 // check the interface id
995995 if (args [0 ].u_int != 0 ) {
996- mp_raise_msg ( & mp_type_OSError , mpexception_os_resource_not_avaliable );
996+ mp_raise_OSError ( MP_EPERM );
997997 }
998998
999999 // get the configuration
@@ -1224,13 +1224,13 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wlan_irq_obj, 1, wlan_irq);
12241224// strcpy(urn, p);
12251225//
12261226// if (sl_NetAppSet(SL_NET_APP_DEVICE_CONFIG_ID, NETAPP_SET_GET_DEV_CONF_OPT_DEVICE_URN, len, (unsigned char *)urn) < 0) {
1227- // mp_raise_msg(&mp_type_OSError, mpexception_os_operation_failed );
1227+ // mp_raise_OSError(MP_EIO );
12281228// }
12291229// }
12301230// else {
12311231// // get the URN
12321232// if (sl_NetAppGet(SL_NET_APP_DEVICE_CONFIG_ID, NETAPP_SET_GET_DEV_CONF_OPT_DEVICE_URN, &len, (uint8_t *)urn) < 0) {
1233- // mp_raise_msg(&mp_type_OSError, mpexception_os_operation_failed );
1233+ // mp_raise_OSError(MP_EIO );
12341234// }
12351235// return mp_obj_new_str(urn, (len - 1), false);
12361236// }
0 commit comments