File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ class ESPNowStream : public AudioStreamX {
348
348
}
349
349
350
350
static void default_recv_cb (const uint8_t *mac_addr, const uint8_t *data,
351
- int data_len) {
351
+ int data_len) {
352
352
LOGD (" rec_cb: %d" , data_len);
353
353
// make sure that the receive buffer is available - moved from begin to make sure that it is only allocated when needed
354
354
ESPNowStreamSelf->setupReceiveBuffer ();
@@ -459,6 +459,17 @@ class UDPStream : public WiFiUDP {
459
459
endPacket ();
460
460
return result;
461
461
}
462
+ // Reads bytes using WiFi::readBytes
463
+ size_t readBytes (uint8_t *buffer, size_t length) override {
464
+ LOGD (LOG_METHOD);
465
+ size_t len = available ();
466
+ size_t bytes_read = 0 ;
467
+ if (len>0 ){
468
+ // get the data now
469
+ bytes_read = WiFiUDP::readBytes ((uint8_t *)buffer, length);
470
+ }
471
+ return bytes_read;
472
+ }
462
473
463
474
protected:
464
475
uint16_t remote_port_ext;
@@ -474,8 +485,8 @@ class UDPStream : public WiFiUDP {
474
485
delay (500 );
475
486
}
476
487
}
477
-
478
- // Performance Hack
488
+
489
+ // Performance Hack
479
490
// client.setNoDelay(true);
480
491
esp_wifi_set_ps (WIFI_PS_NONE);
481
492
You can’t perform that action at this time.
0 commit comments