aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_dect.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2010-07-24 22:16:24 +0200
committerPatrick McHardy <kaber@trash.net>2011-02-26 22:06:05 +0100
commit1c68400dffef5ce62abf114674e6ffca56222540 (patch)
treecd6f028bf7feabd0df5af982e3a11fa0cfb90c67 /channels/chan_dect.c
parentd818c6a4c439e1840c957d842af623e7a3ba5c1d (diff)
chan_dect: adapt to libdect IO changes
Use dect_fd_priv() and dect_handle_fd(). Also fix a compilation error from the debugging changes. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'channels/chan_dect.c')
-rw-r--r--channels/chan_dect.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/channels/chan_dect.c b/channels/chan_dect.c
index 7f6bb3af4..6a8cd6089 100644
--- a/channels/chan_dect.c
+++ b/channels/chan_dect.c
@@ -29,6 +29,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision")
#include <dect/libdect.h>
#include <dect/terminal.h>
+#include <dect/debug.h>
#define CONFIG_FILE "dect.conf"
@@ -1390,7 +1391,6 @@ static void dect_show_debug(enum dect_debug_subsys subsys,
const char *fmt, va_list ap)
{
ast_verbose_ap(fmt, ap);
- return 0;
}
static int dect_load_config(void)
@@ -1625,14 +1625,14 @@ static int dect_io_callback(int *id, int fd, short io_events, void *data)
events |= DECT_FD_READ;
if (io_events & AST_IO_OUT)
events |= DECT_FD_WRITE;
- dfd->callback(dh, dfd, events);
+ dect_handle_fd(dh, dfd, events);
return 1;
}
static int dect_register_fd(const struct dect_handle *dh, struct dect_fd *dfd,
uint32_t events)
{
- struct dect_fd_priv *priv = (struct dect_fd_priv *)dfd->priv;
+ struct dect_fd_priv *priv = dect_fd_priv(dfd);
short io_events = 0;
if (events & DECT_FD_READ)
@@ -1640,13 +1640,14 @@ static int dect_register_fd(const struct dect_handle *dh, struct dect_fd *dfd,
if (events & DECT_FD_WRITE)
io_events |= AST_IO_OUT;
- priv->id = ast_io_add(io, dfd->fd, dect_io_callback, io_events, dfd);;
+ priv->id = ast_io_add(io, dect_fd_num(dfd), dect_io_callback,
+ io_events, dfd);;
return priv->id ? 0 : -1;
}
static void dect_unregister_fd(const struct dect_handle *dh, struct dect_fd *dfd)
{
- struct dect_fd_priv *priv = (struct dect_fd_priv *)dfd->priv;
+ struct dect_fd_priv *priv = dect_fd_priv(dfd);
ast_io_remove(io, priv->id);
}