libwebsockets.h (2.2.0) | | libwebsockets.h (2.2.1) |
| | |
skipping to change at line 458 ¶ | | skipping to change at line 458 ¶ |
short events; /**< which POLL... events to respond to */ | | short events; /**< which POLL... events to respond to */ |
short revents; /**< which POLL... events occurred */ | | short revents; /**< which POLL... events occurred */ |
}; | | }; |
#define POLLIN 0x0001 | | #define POLLIN 0x0001 |
#define POLLPRI 0x0002 | | #define POLLPRI 0x0002 |
#define POLLOUT 0x0004 | | #define POLLOUT 0x0004 |
#define POLLERR 0x0008 | | #define POLLERR 0x0008 |
#define POLLHUP 0x0010 | | #define POLLHUP 0x0010 |
#define POLLNVAL 0x0020 | | #define POLLNVAL 0x0020 |
| | |
| | #include <freertos/FreeRTOS.h> |
| | #include <freertos/event_groups.h> |
| | #include <string.h> |
| | #include "esp_wifi.h" |
| | #include "esp_system.h" |
| | #include "esp_event.h" |
| | #include "esp_event_loop.h" |
| | #include "nvs.h" |
| | #include "driver/gpio.h" |
| | #include "esp_spi_flash.h" |
#include "freertos/timers.h" | | #include "freertos/timers.h" |
| | |
#if !defined(CONFIG_FREERTOS_HZ) | | #if !defined(CONFIG_FREERTOS_HZ) |
#define CONFIG_FREERTOS_HZ 100 | | #define CONFIG_FREERTOS_HZ 100 |
#endif | | #endif |
| | |
typedef TimerHandle_t uv_timer_t; | | typedef TimerHandle_t uv_timer_t; |
typedef void uv_cb_t(uv_timer_t *); | | typedef void uv_cb_t(uv_timer_t *); |
typedef void * uv_handle_t; | | typedef void * uv_handle_t; |
| | |
| | |
skipping to change at line 511 ¶ | | skipping to change at line 521 ¶ |
{ | | { |
xTimerStop(*t, 0); | | xTimerStop(*t, 0); |
} | | } |
| | |
static inline void uv_close(uv_handle_t *h, void *v) | | static inline void uv_close(uv_handle_t *h, void *v) |
{ | | { |
free(pvTimerGetTimerID((uv_timer_t)h)); | | free(pvTimerGetTimerID((uv_timer_t)h)); |
xTimerDelete(*(uv_timer_t *)h, 0); | | xTimerDelete(*(uv_timer_t *)h, 0); |
} | | } |
| | |
| | /* ESP32 helper declarations */ |
| | |
| | #define LWS_PLUGIN_STATIC |
| | |
| | /* user code provides these */ |
| | |
| | extern char lws_esp32_model[16]; |
| | |
| | extern int |
| | lws_esp32_is_booting_in_ap_mode(void); |
| | extern void |
| | lws_esp32_identify_physical_device(void); |
| | |
| | /* lws-plat-esp32 provides these */ |
| | |
| | extern void (*lws_cb_scan_done)(void *); |
| | extern void *lws_cb_scan_done_arg; |
| | |
| | extern char lws_esp32_serial[], lws_esp32_force_ap, lws_esp32_region; |
| | |
| | extern esp_err_t |
| | lws_esp32_event_passthru(void *ctx, system_event_t *event); |
| | extern void |
| | lws_esp32_wlan_config(void); |
| | extern void |
| | lws_esp32_wlan_start(void); |
| | struct lws_context_creation_info; |
| | extern struct lws_context * |
| | lws_esp32_init(struct lws_context_creation_info *, unsigned int _romfs); |
| | |
#else | | #else |
typedef int lws_sockfd_type; | | typedef int lws_sockfd_type; |
typedef int lws_filefd_type; | | typedef int lws_filefd_type; |
#define lws_sockfd_valid(sfd) (sfd >= 0) | | #define lws_sockfd_valid(sfd) (sfd >= 0) |
#endif | | #endif |
#endif | | #endif |
| | |
#define lws_pollfd pollfd | | #define lws_pollfd pollfd |
#define LWS_POLLHUP (POLLHUP|POLLERR) | | #define LWS_POLLHUP (POLLHUP|POLLERR) |
#define LWS_POLLIN (POLLIN) | | #define LWS_POLLIN (POLLIN) |
| | |
skipping to change at line 3555 ¶ | | skipping to change at line 3595 ¶ |
| | |
/** | | /** |
* lws_callback_all_protocol() - Callback all connections using | | * lws_callback_all_protocol() - Callback all connections using |
* the given protocol with the given reason | | * the given protocol with the given reason |
* | | * |
* \param context: lws_context | | * \param context: lws_context |
* \param protocol: Protocol whose connections will get callbacks | | * \param protocol: Protocol whose connections will get callbacks |
* \param reason: Callback reason index | | * \param reason: Callback reason index |
* | | * |
* - Which: connections using this protocol on ALL VHOSTS | | * - Which: connections using this protocol on ALL VHOSTS |
* - When: when the individual connection becomes writeable | | * - When: before returning |
* - What: reason | | * - What: reason |
| | * |
| | * This isn't normally what you want... normally any update of connection- |
| | * specific information can wait until a network-related callback like rx, |
| | * writable, or close. |
*/ | | */ |
LWS_VISIBLE LWS_EXTERN int | | LWS_VISIBLE LWS_EXTERN int |
lws_callback_all_protocol(struct lws_context *context, | | lws_callback_all_protocol(struct lws_context *context, |
const struct lws_protocols *protocol, int reason); | | const struct lws_protocols *protocol, int reason); |
| | |
/** | | /** |
* lws_callback_all_protocol_vhost() - Callback all connections using | | * lws_callback_all_protocol_vhost() - Callback all connections using |
* the given protocol with the given reason | | * the given protocol with the given reason |
* | | * |
* \param vh: Vhost whose connections will get callbacks | | * \param vh: Vhost whose connections will get callbacks |
| | |
skipping to change at line 4409 ¶ | | skipping to change at line 4453 ¶ |
lws_vfs_file_seek_set(lws_fop_fd_t fop_fd, lws_fileofs_t offset); | | lws_vfs_file_seek_set(lws_fop_fd_t fop_fd, lws_fileofs_t offset); |
/** | | /** |
* lws_vfs_file_seek_end() - seek relative to end of file | | * lws_vfs_file_seek_end() - seek relative to end of file |
* | | * |
* \param fop_fd: fop_fd we are seeking in | | * \param fop_fd: fop_fd we are seeking in |
* \param offset: offset from start of file | | * \param offset: offset from start of file |
*/ | | */ |
LWS_VISIBLE LWS_EXTERN lws_fileofs_t | | LWS_VISIBLE LWS_EXTERN lws_fileofs_t |
lws_vfs_file_seek_end(lws_fop_fd_t fop_fd, lws_fileofs_t offset); | | lws_vfs_file_seek_end(lws_fop_fd_t fop_fd, lws_fileofs_t offset); |
| | |
LWS_VISIBLE LWS_EXTERN struct lws_plat_file_ops fops_zip; | | extern struct lws_plat_file_ops fops_zip; |
| | |
/** | | /** |
* lws_plat_file_open() - open vfs filepath | | * lws_plat_file_open() - open vfs filepath |
* | | * |
* \param fops: file ops struct that applies to this descriptor | | * \param fops: file ops struct that applies to this descriptor |
* \param vfs_path: filename to open | | * \param vfs_path: filename to open |
* \param flags: pointer to open flags | | * \param flags: pointer to open flags |
* | | * |
* The vfs_path is scanned for known fops signatures, and the open directed | | * The vfs_path is scanned for known fops signatures, and the open directed |
* to any matching fops open. | | * to any matching fops open. |
| | |
End of changes. 5 change blocks. |
2 lines changed or deleted | | 46 lines changed or added |
|