32 size_t write(uint8_t c)
override {
return write(&c, 1); }
34 size_t write(
const uint8_t *data,
size_t len)
override {
35 if (
p_out ==
nullptr || len == 0)
return 0;
45 if (
p_out ==
nullptr)
return;
46 p_out->print(
"0\r\n\r\n");
79template <
class Client,
class Server>
143 LOGE(
"Content type is not defined");
181 LOGD(
"copy data...");
189 LOGI(
"max output size reached...");
196 LOGI(
"stop client...");
203 LOGI(
"client was not connected");
321 WiFi.setSleep(
false);
327 Serial.print(
"IP address: ");
337 const char *response =
"HTTP/1.1 200 OK";
339 LOGI(
"%s", response);
348 client_obj.println(
"Content-Disposition: inline");
355 client_obj.println(
"Transfer-Encoding: chunked");
356 LOGI(
"Transfer-Encoding: chunked");
362 LOGE(
"connection was closed");
377 LOGI(
"sendReply - calling callback");
381 }
else if (
in !=
nullptr) {
383 LOGI(
"sendReply - Returning audio stream...");
387 LOGE(
"connection was closed");
405 std::string currentLine;
406 currentLine.reserve(128);
413 LOGI(
"Request: %s", currentLine.c_str());
417 if (currentLine.length() == 0) {
427 }
else if (c !=
'\r') {
static HardwareSerial Serial
Definition Arduino.h:179
@ HEX
Definition Arduino.h:54
#define TRACED()
Definition AudioLoggerIDF.h:31
#define LOGI(...)
Definition AudioLoggerIDF.h:28
#define LOGD(...)
Definition AudioLoggerIDF.h:27
#define LOGE(...)
Definition AudioLoggerIDF.h:30
bool connected()
Definition Arduino.h:167
virtual int read(uint8_t *buffer, size_t len)
Definition Arduino.h:165
void stop()
Definition Arduino.h:164
virtual size_t write(const uint8_t *data, size_t len)
Definition Arduino.h:120
virtual int available()
Definition Arduino.h:139