mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-22 01:27:11 +08:00
Merge branch 'feature/perfect_aio_function' into 'master'
Perfect AIO function and logic See merge request sdk/ESP8266_RTOS_SDK!417
This commit is contained in:
@ -137,6 +137,36 @@ typedef struct esp_socket_method {
|
|||||||
int (*close)(void *index);
|
int (*close)(void *index);
|
||||||
} esp_socket_method_t;
|
} esp_socket_method_t;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @brief free an aio control block by calling the callback function
|
||||||
|
*
|
||||||
|
* @param aio asynchronous I/O controlling block
|
||||||
|
* @param aio data handling result
|
||||||
|
*
|
||||||
|
* @return none
|
||||||
|
*/
|
||||||
|
static inline void esp_aio_free(esp_aio_t *aio, int status)
|
||||||
|
{
|
||||||
|
if (aio->cb) {
|
||||||
|
aio->ret = status;
|
||||||
|
aio->cb(aio);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @brief drop an aio control block by disable "pbuf" and "cb"
|
||||||
|
* and then the aio control block has no meaning
|
||||||
|
*
|
||||||
|
* @param aio asynchronous I/O controlling block
|
||||||
|
*
|
||||||
|
* @return none
|
||||||
|
*/
|
||||||
|
static inline void esp_aio_drop(esp_aio_t *aio)
|
||||||
|
{
|
||||||
|
aio->pbuf = NULL;
|
||||||
|
aio->cb = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief create a socket file description
|
* @brief create a socket file description
|
||||||
*
|
*
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#define CRITICAL_EXIT(t)
|
#define CRITICAL_EXIT(t)
|
||||||
|
|
||||||
#ifndef ESP_SOCKET_MAX
|
#ifndef ESP_SOCKET_MAX
|
||||||
#define ESP_SOCKET_MAX 3
|
#define ESP_SOCKET_MAX 2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SET_ERR(err) errno = err
|
#define SET_ERR(err) errno = err
|
||||||
|
Reference in New Issue
Block a user