10 #include <linux/input.h>
11 /*#include <sys/timerfd.h>*/
13 #include "dialdetector.h"
15 #include "tapi-ioctl.h"
17 #include "tapi-device.h"
18 #include "tapi-port.h"
20 static struct tapi_device dev
;
21 static struct tapi_port ports
[2];
23 void dial_callback(struct tapi_port
*port
, size_t num_digits
, const unsigned char *digits
)
29 if (port
->id
== digits
[0] || digits
[0] > 1)
32 tapi_port_set_ring(&ports
[digits
[0]], true);
34 tapi_session_alloc(&dev
, port
, &ports
[digits
[0]]);
37 int main(int argc
, char *argv
[])
39 struct dialdetector
*dd
, *dd2
;
41 unsigned char buf
[1024];
44 tapi_device_open(0, &dev
);
45 tapi_port_open(0, 0, &ports
[0]);
46 tapi_port_open(0, 1, &ports
[1]);
48 dd
= dialdetector_alloc(&ports
[0]);
49 dd
->dial_callback
= dial_callback
;
50 dd2
= dialdetector_alloc(&ports
[1]);
51 dd2
->dial_callback
= dial_callback
;
This page took 0.064434 seconds and 5 git commands to generate.