1. 程式人生 > >PX4 程式碼疑惑(1)

PX4 程式碼疑惑(1)

    px4_pollfd_struct_t fds[] = {
        { .fd = sensor_sub_fd,   .events = POLLIN },
        /* there could be more file descriptors here, in the form like:
         * { .fd = other_sub_fd,   .events = POLLIN },
         */

    };

typedef struct {
    /* This part of the struct is POSIX-like */
    int        fd;       /* The descriptor being polled */
    pollevent_t     events;   /* The input event flags */
    pollevent_t     revents;  /* The output event flags */

    /* Required for PX4 compatibility */
    px4_sem_t   *sem;      /* Pointer to semaphore used to post output event */
    void   *priv;         /* For use by drivers */
} px4_pollfd_struct_t;