abfall/src/http_client.h

28 lines
729 B
C
Raw Normal View History

2023-01-02 14:28:51 +01:00
#pragma once
#include <string>
#include "lwip/apps/http_client.h"
#include "pico/cyw43_arch.h"
#include "pico/stdlib.h"
static char myBuffer[2048];
extern "C" void result_callback(void *arg, httpc_result_t httpc_result, u32_t rx_content_len,
u32_t srv_res, err_t err);
extern "C" err_t headers_callback(httpc_state_t *connection, void *arg, struct pbuf *hdr,
u16_t hdr_len, u32_t content_len);
extern "C" err_t body_callback(void *arg, struct altcp_pcb *conn, struct pbuf *p, err_t err);
class HttpClient {
public:
HttpClient();
std::string retrieveWasteDatesAsCsv();
bool m_received{false};
private:
httpc_connection_t m_settings;
};