@@ -231,15 +231,13 @@ nsapi_error_t OdinWiFiInterface::set_credentials(const char *ssid, const char *p
231
231
return NSAPI_ERROR_PARAMETER;
232
232
}
233
233
234
- osStatus res = _mutex.lock ();
235
- MBED_ASSERT (res == osOK);
234
+ _mutex.lock ();
236
235
237
236
strncpy (_sta.ssid , ssid, cbWLAN_SSID_MAX_LENGTH);
238
237
strncpy (_sta.passwd , pass, cbWLAN_MAX_PASSPHRASE_LENGTH);
239
238
_sta.security = security;
240
239
241
- res = _mutex.unlock ();
242
- MBED_ASSERT (res == osOK);
240
+ _mutex.unlock ();
243
241
244
242
return NSAPI_ERROR_OK;
245
243
}
@@ -275,26 +273,18 @@ nsapi_error_t OdinWiFiInterface::set_channel(uint8_t channel)
275
273
return NSAPI_ERROR_PARAMETER;
276
274
}
277
275
278
- osStatus res = _mutex.lock ();
279
- MBED_ASSERT (res == osOK);
280
-
276
+ _mutex.lock ();
281
277
_sta.channel = channel;
282
-
283
- res = _mutex.unlock ();
284
- MBED_ASSERT (res == osOK);
278
+ _mutex.unlock ();
285
279
286
280
return NSAPI_ERROR_OK;
287
281
}
288
282
289
283
nsapi_error_t OdinWiFiInterface::set_timeout (int ms)
290
284
{
291
- osStatus res = _mutex.lock ();
292
- MBED_ASSERT (res == osOK);
293
-
285
+ _mutex.lock ();
294
286
_sta.timeout_ms = ms;
295
-
296
- res = _mutex.unlock ();
297
- MBED_ASSERT (res == osOK);
287
+ _mutex.unlock ();
298
288
299
289
return NSAPI_ERROR_OK;
300
290
}
@@ -560,8 +550,7 @@ nsapi_error_t OdinWiFiInterface::set_ap_network(const char *ip_address, const ch
560
550
{
561
551
nsapi_error_t result = NSAPI_ERROR_PARAMETER;
562
552
563
- osStatus res = _mutex.lock ();
564
- MBED_ASSERT (res == osOK);
553
+ _mutex.lock ();
565
554
566
555
if ((ip_address != NULL ) && (netmask != NULL ) && (gateway != NULL ))
567
556
{
@@ -583,8 +572,7 @@ nsapi_error_t OdinWiFiInterface::set_ap_network(const char *ip_address, const ch
583
572
result = NSAPI_ERROR_OK;
584
573
}
585
574
586
- res = _mutex.unlock ();
587
- MBED_ASSERT (res == osOK);
575
+ _mutex.unlock ();
588
576
589
577
return result;
590
578
}
@@ -593,28 +581,22 @@ nsapi_error_t OdinWiFiInterface::set_ap_network(const char *ip_address, const ch
593
581
nsapi_error_t OdinWiFiInterface::set_ap_credentials (const char *ssid, const char *pass,
594
582
nsapi_security_t security)
595
583
{
596
- osStatus res = _mutex.lock ();
597
- MBED_ASSERT (res == osOK);
584
+ _mutex.lock ();
598
585
599
586
_ap.ssid = ssid;
600
587
_ap.passwd = pass;
601
588
_ap.security = security;
602
589
603
- res = _mutex.unlock ();
604
- MBED_ASSERT (res == osOK);
590
+ _mutex.unlock ();
605
591
606
592
return NSAPI_ERROR_OK;
607
593
}
608
594
609
595
nsapi_error_t OdinWiFiInterface::set_ap_channel (uint8_t channel)
610
596
{
611
- osStatus res = _mutex.lock ();
612
- MBED_ASSERT (res == osOK);
613
-
597
+ _mutex.lock ();
614
598
_ap.channel = channel;
615
-
616
- res = _mutex.unlock ();
617
- MBED_ASSERT (res == osOK);
599
+ _mutex.unlock ();
618
600
619
601
return NSAPI_ERROR_OK;
620
602
}
@@ -623,13 +605,9 @@ int OdinWiFiInterface::get_ap_connection_count()
623
605
{
624
606
int cnt;
625
607
626
- osStatus res = _mutex.lock ();
627
- MBED_ASSERT (res == osOK);
628
-
608
+ _mutex.lock ();
629
609
cnt = _ap.cnt_connected ;
630
-
631
- res = _mutex.unlock ();
632
- MBED_ASSERT (res == osOK);
610
+ _mutex.unlock ();
633
611
634
612
return cnt;
635
613
}
@@ -641,13 +619,9 @@ int OdinWiFiInterface::get_ap_max_connection_count()
641
619
642
620
nsapi_error_t OdinWiFiInterface::set_ap_dhcp (bool dhcp)
643
621
{
644
- osStatus res = _mutex.lock ();
645
- MBED_ASSERT (res == osOK);
646
-
622
+ _mutex.lock ();
647
623
_ap.use_dhcp = dhcp;
648
-
649
- res = _mutex.unlock ();
650
- MBED_ASSERT (res == osOK);
624
+ _mutex.unlock ();
651
625
652
626
return NSAPI_ERROR_OK;
653
627
}
@@ -739,13 +713,9 @@ nsapi_error_t OdinWiFiInterface::ap_stop()
739
713
740
714
nsapi_error_t OdinWiFiInterface::set_ap_beacon_interval (uint16_t interval)
741
715
{
742
- osStatus res = _mutex.lock ();
743
- MBED_ASSERT (res == osOK);
744
-
716
+ _mutex.lock ();
745
717
_ap.beacon_interval = interval;
746
-
747
- res = _mutex.unlock ();
748
- MBED_ASSERT (res == osOK);
718
+ _mutex.unlock ();
749
719
750
720
return NSAPI_ERROR_OK;
751
721
}
@@ -860,8 +830,7 @@ void OdinWiFiInterface::handle_in_msg(void)
860
830
struct odin_wifi_msg_s *msg = (odin_wifi_msg_s*)evt.value .p ;
861
831
MBED_ASSERT (msg != 0 );
862
832
863
- osStatus res = _mutex.lock ();
864
- MBED_ASSERT (res == osOK);
833
+ _mutex.lock ();
865
834
866
835
switch (msg->type ) {
867
836
case ODIN_WIFI_MSG_USER_CONNECT:
@@ -949,8 +918,7 @@ void OdinWiFiInterface::handle_in_msg(void)
949
918
break ;
950
919
}
951
920
952
- res = _mutex.unlock ();
953
- MBED_ASSERT (res == osOK);
921
+ _mutex.unlock ();
954
922
955
923
if (msg != 0 ) {
956
924
_msg_pool->free (msg);
@@ -1530,8 +1498,7 @@ void OdinWiFiInterface::handle_wlan_status_ap_down()
1530
1498
1531
1499
void OdinWiFiInterface::init (bool debug = false )
1532
1500
{
1533
- osStatus res = _mutex.lock ();
1534
- MBED_ASSERT (res == osOK);
1501
+ _mutex.lock ();
1535
1502
1536
1503
// Initialise internal variables
1537
1504
_state = S_NOT_INITIALISED;
@@ -1595,8 +1562,7 @@ void OdinWiFiInterface::init(bool debug = false)
1595
1562
1596
1563
_thread.start (callback (wlan_callb_s::odin_thread_fcn, this ));
1597
1564
1598
- res = _mutex.unlock ();
1599
- MBED_ASSERT (res == osOK);
1565
+ _mutex.unlock ();
1600
1566
}
1601
1567
1602
1568
void OdinWiFiInterface::send_user_response_msg (unsigned int type, nsapi_error_t error_code)
@@ -1817,14 +1783,12 @@ void OdinWiFiInterface::wlan_scan_indication(cbWLAN_ScanIndicationInfo *scan_inf
1817
1783
MBED_ASSERT (ok == osOK);
1818
1784
}
1819
1785
else {
1820
- osStatus res = _mutex.lock ();
1821
- MBED_ASSERT (res == osOK);
1786
+ _mutex.lock ();
1822
1787
1823
1788
// Add scan result to scan_list
1824
1789
update_scan_list (scan_info);
1825
1790
1826
- res = _mutex.unlock ();
1827
- MBED_ASSERT (res == osOK);
1791
+ _mutex.unlock ();
1828
1792
}
1829
1793
}
1830
1794
else {
0 commit comments