14 #ifndef __ESP_EXAMPLE_SH2_LIB_H_ 15 #define __ESP_EXAMPLE_SH2_LIB_H_ 18 #include <nghttp2/nghttp2.h> 43 #define DATA_RECV_RST_STREAM 1 45 #define DATA_RECV_FRAME_COMPLETE 2 201 #define SH2LIB_MAKE_NV(NAME, VALUE, FLAGS) \ 203 (uint8_t *)NAME, (uint8_t *)VALUE, strlen(NAME), strlen(VALUE), FLAGS \ sh2lib_frame_data_recv_cb_t data_recv_cb
Definition: sh2lib.h:88
int(* sh2lib_putpost_data_cb_t)(struct sh2lib_handle *handle, char *data, size_t len, uint32_t *data_flags)
Function Prototype for callback to send data in PUT/POST.
Definition: sh2lib.h:83
sh2lib_putpost_data_cb_t send_cb
Definition: sh2lib.h:86
Handle for working with sh2lib APIs.
Definition: sh2lib.h:35
struct esp_tls * http2_tls
Definition: sh2lib.h:38
int sh2lib_do_get_with_nv(struct sh2lib_handle *hd, const nghttp2_nv *nva, size_t nvlen, sh2lib_callbacks *callbacks)
Setup an HTTP GET request stream with custom name-value pairs.
sh2lib_frame_data_header_cb_t header_recv_cb
Definition: sh2lib.h:87
static spi_device_handle_t handle
Definition: u8g2_esp32_hal.cpp:14
void sh2lib_free(struct sh2lib_handle *hd)
Free a sh2lib handle.
const path
Definition: oauth-server.js:26
char * hostname
Definition: sh2lib.h:37
int sh2lib_do_get(struct sh2lib_handle *hd, const char *path, sh2lib_callbacks *callbacks)
Setup an HTTP GET request stream.
int sh2lib_do_put(struct sh2lib_handle *hd, const char *path, sh2lib_callbacks *callbacks)
Setup an HTTP PUT request stream.
int sh2lib_connect(struct sh2lib_handle *hd, const char *uri, mbedtls_x509_crt *cacerts)
Connect to a URI using HTTP/2.
int sh2lib_execute(struct sh2lib_handle *hd)
Execute send/receive on an HTTP/2 connection.
int sh2lib_do_putpost_with_nv(struct sh2lib_handle *hd, const nghttp2_nv *nva, size_t nvlen, sh2lib_callbacks *callbacks)
Setup an HTTP PUT/POST request stream with custom name-value pairs.
int(* sh2lib_frame_data_recv_cb_t)(struct sh2lib_handle *handle, const char *data, size_t len, int flags)
Definition: sh2lib.h:65
nghttp2_session * http2_sess
Definition: sh2lib.h:36
void * userdata
Definition: sh2lib.h:39
int sh2lib_do_post(struct sh2lib_handle *hd, const char *path, sh2lib_callbacks *callbacks)
Setup an HTTP POST request stream.
int(* sh2lib_frame_data_header_cb_t)(struct sh2lib_handle *handle, const char *name, size_t namelen, const char *value, size_t valuelen, int flags)
Function Prototype for data receive callback.
Definition: sh2lib.h:64