File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,11 @@ class BridgeUDP final: public UDP {
209209 int read (unsigned char *buffer, size_t len) override {
210210 k_mutex_lock (&udp_mutex, K_FOREVER);
211211 int i = 0 ;
212- while (_remaining && i < len && available ()) {
212+ while (_remaining && i < len) {
213+ if (!temp_buffer.available () && !available ()) {
214+ k_msleep (1 );
215+ continue ;
216+ }
213217 buffer[i++] = temp_buffer.read_char ();
214218 _remaining--;
215219 }
@@ -220,7 +224,11 @@ class BridgeUDP final: public UDP {
220224 int read (char *buffer, size_t len) override {
221225 k_mutex_lock (&udp_mutex, K_FOREVER);
222226 int i = 0 ;
223- while (_remaining && i < len && available ()) {
227+ while (_remaining && i < len) {
228+ if (!temp_buffer.available () && !available ()) {
229+ k_msleep (1 );
230+ continue ;
231+ }
224232 buffer[i++] = static_cast <char >(temp_buffer.read_char ());
225233 _remaining--;
226234 }
@@ -289,9 +297,9 @@ class BridgeUDP final: public UDP {
289297 }
290298 }
291299
292- if (async_res.error .code > NO_ERR) {
293- _connected = false ;
294- }
300+ // if (async_res.error.code > NO_ERR) {
301+ // _connected = false;
302+ // }
295303
296304 k_mutex_unlock (&udp_mutex);
297305 }
You can’t perform that action at this time.
0 commit comments