@@ -250,7 +250,9 @@ nsapi_error_t WhdSTAInterface::connect()
250
250
251
251
// initialize wiced, this is noop if already init
252
252
if (!_whd_emac.powered_up ) {
253
- _whd_emac.power_up ();
253
+ if (!_whd_emac.power_up ()) {
254
+ return NSAPI_ERROR_DEVICE_ERROR;
255
+ }
254
256
}
255
257
256
258
res = whd_management_set_event_handler (_whd_emac.ifp , sta_link_change_events,
@@ -322,7 +324,9 @@ nsapi_error_t WhdSTAInterface::connect()
322
324
void WhdSTAInterface::wifi_on ()
323
325
{
324
326
if (!_whd_emac.powered_up ) {
325
- _whd_emac.power_up ();
327
+ if (!_whd_emac.power_up ()) {
328
+ CY_ASSERT (false );
329
+ }
326
330
}
327
331
}
328
332
@@ -384,11 +388,14 @@ int8_t WhdSTAInterface::get_rssi()
384
388
385
389
// initialize wiced, this is noop if already init
386
390
if (!_whd_emac.powered_up ) {
387
- _whd_emac.power_up ();
391
+ if (!_whd_emac.power_up ()) {
392
+ CY_ASSERT (false );
393
+ }
388
394
}
389
395
390
396
res = (whd_result_t )whd_wifi_get_rssi (_whd_emac.ifp , &rssi);
391
397
if (res != 0 ) {
398
+ CY_ASSERT (false );
392
399
return 0 ;
393
400
}
394
401
@@ -463,7 +470,9 @@ int WhdSTAInterface::internal_scan(WiFiAccessPoint *aps, unsigned count, scan_re
463
470
464
471
// initialize wiced, this is noop if already init
465
472
if (!_whd_emac.powered_up ) {
466
- _whd_emac.power_up ();
473
+ if (!_whd_emac.power_up ()) {
474
+ return NSAPI_ERROR_DEVICE_ERROR;
475
+ }
467
476
}
468
477
469
478
interal_scan_data.sema = new Semaphore ();
@@ -476,7 +485,6 @@ int WhdSTAInterface::internal_scan(WiFiAccessPoint *aps, unsigned count, scan_re
476
485
whd_result_t whd_res;
477
486
int res;
478
487
479
-
480
488
whd_res = (whd_result_t )whd_wifi_scan (_whd_emac.ifp , WHD_SCAN_TYPE_ACTIVE, WHD_BSS_TYPE_ANY,
481
489
NULL , NULL , NULL , NULL , whd_scan_handler, &internal_scan_result, &interal_scan_data);
482
490
if (whd_res != WHD_SUCCESS) {
0 commit comments