@@ -231,15 +231,13 @@ nsapi_error_t OdinWiFiInterface::set_credentials(const char *ssid, const char *p
231231 return NSAPI_ERROR_PARAMETER;
232232 }
233233
234- osStatus res = _mutex.lock ();
235- MBED_ASSERT (res == osOK);
234+ _mutex.lock ();
236235
237236 strncpy (_sta.ssid , ssid, cbWLAN_SSID_MAX_LENGTH);
238237 strncpy (_sta.passwd , pass, cbWLAN_MAX_PASSPHRASE_LENGTH);
239238 _sta.security = security;
240239
241- res = _mutex.unlock ();
242- MBED_ASSERT (res == osOK);
240+ _mutex.unlock ();
243241
244242 return NSAPI_ERROR_OK;
245243}
@@ -275,26 +273,18 @@ nsapi_error_t OdinWiFiInterface::set_channel(uint8_t channel)
275273 return NSAPI_ERROR_PARAMETER;
276274 }
277275
278- osStatus res = _mutex.lock ();
279- MBED_ASSERT (res == osOK);
280-
276+ _mutex.lock ();
281277 _sta.channel = channel;
282-
283- res = _mutex.unlock ();
284- MBED_ASSERT (res == osOK);
278+ _mutex.unlock ();
285279
286280 return NSAPI_ERROR_OK;
287281}
288282
289283nsapi_error_t OdinWiFiInterface::set_timeout (int ms)
290284{
291- osStatus res = _mutex.lock ();
292- MBED_ASSERT (res == osOK);
293-
285+ _mutex.lock ();
294286 _sta.timeout_ms = ms;
295-
296- res = _mutex.unlock ();
297- MBED_ASSERT (res == osOK);
287+ _mutex.unlock ();
298288
299289 return NSAPI_ERROR_OK;
300290}
@@ -560,8 +550,7 @@ nsapi_error_t OdinWiFiInterface::set_ap_network(const char *ip_address, const ch
560550{
561551 nsapi_error_t result = NSAPI_ERROR_PARAMETER;
562552
563- osStatus res = _mutex.lock ();
564- MBED_ASSERT (res == osOK);
553+ _mutex.lock ();
565554
566555 if ((ip_address != NULL ) && (netmask != NULL ) && (gateway != NULL ))
567556 {
@@ -583,8 +572,7 @@ nsapi_error_t OdinWiFiInterface::set_ap_network(const char *ip_address, const ch
583572 result = NSAPI_ERROR_OK;
584573 }
585574
586- res = _mutex.unlock ();
587- MBED_ASSERT (res == osOK);
575+ _mutex.unlock ();
588576
589577 return result;
590578}
@@ -593,28 +581,22 @@ nsapi_error_t OdinWiFiInterface::set_ap_network(const char *ip_address, const ch
593581nsapi_error_t OdinWiFiInterface::set_ap_credentials (const char *ssid, const char *pass,
594582 nsapi_security_t security)
595583{
596- osStatus res = _mutex.lock ();
597- MBED_ASSERT (res == osOK);
584+ _mutex.lock ();
598585
599586 _ap.ssid = ssid;
600587 _ap.passwd = pass;
601588 _ap.security = security;
602589
603- res = _mutex.unlock ();
604- MBED_ASSERT (res == osOK);
590+ _mutex.unlock ();
605591
606592 return NSAPI_ERROR_OK;
607593}
608594
609595nsapi_error_t OdinWiFiInterface::set_ap_channel (uint8_t channel)
610596{
611- osStatus res = _mutex.lock ();
612- MBED_ASSERT (res == osOK);
613-
597+ _mutex.lock ();
614598 _ap.channel = channel;
615-
616- res = _mutex.unlock ();
617- MBED_ASSERT (res == osOK);
599+ _mutex.unlock ();
618600
619601 return NSAPI_ERROR_OK;
620602}
@@ -623,13 +605,9 @@ int OdinWiFiInterface::get_ap_connection_count()
623605{
624606 int cnt;
625607
626- osStatus res = _mutex.lock ();
627- MBED_ASSERT (res == osOK);
628-
608+ _mutex.lock ();
629609 cnt = _ap.cnt_connected ;
630-
631- res = _mutex.unlock ();
632- MBED_ASSERT (res == osOK);
610+ _mutex.unlock ();
633611
634612 return cnt;
635613}
@@ -641,13 +619,9 @@ int OdinWiFiInterface::get_ap_max_connection_count()
641619
642620nsapi_error_t OdinWiFiInterface::set_ap_dhcp (bool dhcp)
643621{
644- osStatus res = _mutex.lock ();
645- MBED_ASSERT (res == osOK);
646-
622+ _mutex.lock ();
647623 _ap.use_dhcp = dhcp;
648-
649- res = _mutex.unlock ();
650- MBED_ASSERT (res == osOK);
624+ _mutex.unlock ();
651625
652626 return NSAPI_ERROR_OK;
653627}
@@ -739,13 +713,9 @@ nsapi_error_t OdinWiFiInterface::ap_stop()
739713
740714nsapi_error_t OdinWiFiInterface::set_ap_beacon_interval (uint16_t interval)
741715{
742- osStatus res = _mutex.lock ();
743- MBED_ASSERT (res == osOK);
744-
716+ _mutex.lock ();
745717 _ap.beacon_interval = interval;
746-
747- res = _mutex.unlock ();
748- MBED_ASSERT (res == osOK);
718+ _mutex.unlock ();
749719
750720 return NSAPI_ERROR_OK;
751721}
@@ -860,8 +830,7 @@ void OdinWiFiInterface::handle_in_msg(void)
860830 struct odin_wifi_msg_s *msg = (odin_wifi_msg_s*)evt.value .p ;
861831 MBED_ASSERT (msg != 0 );
862832
863- osStatus res = _mutex.lock ();
864- MBED_ASSERT (res == osOK);
833+ _mutex.lock ();
865834
866835 switch (msg->type ) {
867836 case ODIN_WIFI_MSG_USER_CONNECT:
@@ -949,8 +918,7 @@ void OdinWiFiInterface::handle_in_msg(void)
949918 break ;
950919 }
951920
952- res = _mutex.unlock ();
953- MBED_ASSERT (res == osOK);
921+ _mutex.unlock ();
954922
955923 if (msg != 0 ) {
956924 _msg_pool->free (msg);
@@ -1530,8 +1498,7 @@ void OdinWiFiInterface::handle_wlan_status_ap_down()
15301498
15311499void OdinWiFiInterface::init (bool debug = false )
15321500{
1533- osStatus res = _mutex.lock ();
1534- MBED_ASSERT (res == osOK);
1501+ _mutex.lock ();
15351502
15361503 // Initialise internal variables
15371504 _state = S_NOT_INITIALISED;
@@ -1595,8 +1562,7 @@ void OdinWiFiInterface::init(bool debug = false)
15951562
15961563 _thread.start (callback (wlan_callb_s::odin_thread_fcn, this ));
15971564
1598- res = _mutex.unlock ();
1599- MBED_ASSERT (res == osOK);
1565+ _mutex.unlock ();
16001566}
16011567
16021568void 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
18171783 MBED_ASSERT (ok == osOK);
18181784 }
18191785 else {
1820- osStatus res = _mutex.lock ();
1821- MBED_ASSERT (res == osOK);
1786+ _mutex.lock ();
18221787
18231788 // Add scan result to scan_list
18241789 update_scan_list (scan_info);
18251790
1826- res = _mutex.unlock ();
1827- MBED_ASSERT (res == osOK);
1791+ _mutex.unlock ();
18281792 }
18291793 }
18301794 else {
0 commit comments