ble_gatt_client
|
notes about btgattclient software design More...
#include <sys/epoll.h>
Go to the source code of this file.
Data Structures | |
struct | epoll_event_doc |
epool event structure 4th parameter of epoll_ctl(...) More... | |
Enumerations | |
enum | EPOLL_CTL_DOC { EPOLL_CTL_ADD_DOC =EPOLL_CTL_ADD, EPOLL_CTL_DEL_DOC =EPOLL_CTL_DEL, EPOLL_CTL_MOD_DOC =EPOLL_CTL_MOD } |
EPOLL_CTL_XXX possible values. More... | |
enum | EPOLL_EVENTS_DOC { EPOLLERR_DOC =EPOLLERR, EPOLLET_DOC =EPOLLET, EPOLLHUP_DOC =EPOLLHUP, EPOLLIN_DOC =EPOLLIN, EPOLLONESHOT_DOC =EPOLLONESHOT, EPOLLOUT_DOC =EPOLLOUT, EPOLLPRI_DOC =EPOLLPRI } |
EPOLL_EVENTS possible values. More... | |
Functions | |
int | epoll_ctl_doc (int epfd, int op, int fd, struct epoll_event *event) |
notes about btgattclient software design
We discuss about various topics concerning btgattclient software design and architecture:
Definition in file design_notes.h.
enum EPOLL_CTL_DOC |
EPOLL_CTL_XXX possible values.
Definition at line 54 of file design_notes.h.
enum EPOLL_EVENTS_DOC |
EPOLL_EVENTS possible values.
The events field in the epoll_event structure lists which events to monitor on the given file descriptor. Multiple events can be bitwise-ORed together.
Edge- Versus Level-Triggered Events
If the EPOLLET value is set in the events field of the event parameter passed to epoll_ctl( ), the watch on fd is edge-triggered, as opposed to level-triggered. Consider the following events between a producer and a consumer communicating over a Unix pipe: The producer writes 1 KB of data onto a pipe. The consumer performs an epoll_wait( ) on the pipe, waiting for the pipe to contain data, and thus be readable. With a level-triggered watch, the call to epoll_wait( ) in step 2 will return immediately, showing that the pipe is ready to read. With an edge-triggered watch,this call will not return until after step 1 occurs. That is, even if the pipe is readable at the invocation of epoll_wait( ), the call will not return until the data is written onto the pipe. Level-triggered is the default behavior. It is how poll( ) and select( ) behave, and it is what most developers expect. Edge-triggered behavior requires a different approach to programming, commonly utilizing nonblocking I/O, and careful checking for EAGAIN.
Definition at line 93 of file design_notes.h.
int epoll_ctl_doc | ( | int | epfd, |
int | op, | ||
int | fd, | ||
struct epoll_event * | event | ||
) |
controls the epoll instance associated with epfd
epfd | the epoll context structure |
op | specifies the operation to be taken against the file associated with fd |
fd | file descriptor can be a socket |
event | epool event further constrains the behavior of the operation |