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:
Dong Heng
2018-08-22 17:52:35 +08:00
2 changed files with 31 additions and 1 deletions

View File

@ -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
* *

View File

@ -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