@@ -153,7 +153,7 @@ static void network_ninaw10_poll_connect(mp_sched_node_t *node) {
153
153
debug_printf ("poll_connect() status: %d reason %d\n" , status , reason );
154
154
if (nina_connect (self -> ssid , self -> security , self -> key , 0 ) != 0 ) {
155
155
mp_raise_msg_varg (& mp_type_OSError ,
156
- MP_ERROR_TEXT ("could not connect to ssid=%s, sec=%d, key=%s\n " ),
156
+ MP_ERROR_TEXT ("could not connect to ssid=%s, sec=%d, key=%s" ),
157
157
self -> ssid , self -> security , self -> key );
158
158
}
159
159
} else {
@@ -197,14 +197,14 @@ static mp_obj_t network_ninaw10_active(size_t n_args, const mp_obj_t *args) {
197
197
int error = 0 ;
198
198
if ((error = nina_init ()) != 0 ) {
199
199
mp_raise_msg_varg (& mp_type_OSError ,
200
- MP_ERROR_TEXT ("Failed to initialize Nina-W10 module, error: %d\n " ), error );
200
+ MP_ERROR_TEXT ("failed to initialize Nina-W10 module, error: %d" ), error );
201
201
}
202
202
// check firmware version
203
203
uint8_t semver [NINA_FW_VER_LEN ];
204
204
if (nina_fw_version (semver ) != 0 ) {
205
205
nina_deinit ();
206
206
mp_raise_msg_varg (& mp_type_OSError ,
207
- MP_ERROR_TEXT ("Failed to read firmware version, error: %d\n " ), error );
207
+ MP_ERROR_TEXT ("failed to read firmware version, error: %d" ), error );
208
208
}
209
209
// Check the minimum supported firmware version.
210
210
uint32_t fwmin = (NINA_FW_VER_MIN_MAJOR * 100 ) +
@@ -217,7 +217,7 @@ static mp_obj_t network_ninaw10_active(size_t n_args, const mp_obj_t *args) {
217
217
218
218
if (fwver < fwmin ) {
219
219
mp_raise_msg_varg (& mp_type_OSError ,
220
- MP_ERROR_TEXT ("Firmware version mismatch. Minimum supported firmware is v%d.%d.%d found v%d.%d.%d\n " ),
220
+ MP_ERROR_TEXT ("firmware version mismatch, minimum supported firmware is v%d.%d.%d found v%d.%d.%d" ),
221
221
NINA_FW_VER_MIN_MAJOR , NINA_FW_VER_MIN_MINOR , NINA_FW_VER_MIN_PATCH , semver [NINA_FW_VER_MAJOR_OFFS ] - 48 ,
222
222
semver [NINA_FW_VER_MINOR_OFFS ] - 48 , semver [NINA_FW_VER_PATCH_OFFS ] - 48 );
223
223
}
@@ -273,7 +273,7 @@ static mp_obj_t network_ninaw10_connect(mp_uint_t n_args, const mp_obj_t *pos_ar
273
273
const char * ssid = mp_obj_str_get_str (args [ARG_ssid ].u_obj );
274
274
275
275
if (strlen (ssid ) == 0 ) {
276
- mp_raise_msg ( & mp_type_OSError , MP_ERROR_TEXT ("SSID can't be empty! " ));
276
+ mp_raise_ValueError ( MP_ERROR_TEXT ("SSID can't be empty" ));
277
277
}
278
278
279
279
// get encryption key
@@ -292,7 +292,7 @@ static mp_obj_t network_ninaw10_connect(mp_uint_t n_args, const mp_obj_t *pos_ar
292
292
293
293
// Ensure that the key is not empty if a security mode is used.
294
294
if (security != NINA_SEC_OPEN && strlen (key ) == 0 ) {
295
- mp_raise_msg ( & mp_type_OSError , MP_ERROR_TEXT ("Key can't be empty! " ));
295
+ mp_raise_ValueError ( MP_ERROR_TEXT ("key can't be empty" ));
296
296
}
297
297
298
298
// Activate the interface if not active.
@@ -309,7 +309,7 @@ static mp_obj_t network_ninaw10_connect(mp_uint_t n_args, const mp_obj_t *pos_ar
309
309
// Initialize WiFi in Station mode.
310
310
if (nina_connect (ssid , security , key , 0 ) != 0 ) {
311
311
mp_raise_msg_varg (& mp_type_OSError ,
312
- MP_ERROR_TEXT ("could not connect to ssid=%s, sec=%d, key=%s\n " ), ssid , security , key );
312
+ MP_ERROR_TEXT ("could not connect to ssid=%s, sec=%d, key=%s" ), ssid , security , key );
313
313
}
314
314
315
315
// Save connection info to re-connect if needed.
0 commit comments