dect
/
asterisk
Archived
13
0
Fork 0

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>
This commit is contained in:
Patrick McHardy 2010-07-24 22:16:24 +02:00
parent d818c6a4c4
commit 1c68400dff
1 changed files with 6 additions and 5 deletions

View File

@ -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);
}