From 2cf3483ca6fc2bd9a83e086f501b2b466b05305b Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Tue, 29 Jun 2010 21:06:14 +0000 Subject: [PATCH] added data_source flags --- include/btstack/run_loop.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/btstack/run_loop.h b/include/btstack/run_loop.h index 7c35009cd..080c27654 100644 --- a/include/btstack/run_loop.h +++ b/include/btstack/run_loop.h @@ -41,6 +41,10 @@ #include +// flags for data_source +#define DS_FLAG_ACTIVE 1 +#define DS_FLAG_POLL 2 + typedef enum { RUN_LOOP_POSIX = 1, RUN_LOOP_COCOA, @@ -49,14 +53,15 @@ typedef enum { typedef struct data_source { linked_item_t item; - int fd; // <-- file descriptors to watch or 0 - int (*process)(struct data_source *ds); // <-- do processing + int fd; // <-- file descriptors to watch or 0 + int (*process)(struct data_source *ds); // <-- do processing + int flags; // <-- RL_FLAG } data_source_t; typedef struct timer { linked_item_t item; - struct timeval timeout; // <-- next timeout - void (*process)(struct timer *ts); // <-- do processing + struct timeval timeout; // <-- next timeout + void (*process)(struct timer *ts); // <-- do processing } timer_source_t; // init must be called before any other run_loop call