nfctool: Add a handler mechanism for netlink events
[platform/upstream/neard.git] / tools / nfctool / netlink.h
1 /*
2  *
3  *  Near Field Communication nfctool
4  *
5  *  Copyright (C) 2012  Intel Corporation. All rights reserved.
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21 #ifndef __NETLINK_H
22 #define __NETLINK_H
23
24 typedef int (*nfc_event_cb_t)(guint8 cmd, guint32 adapter_idx, gpointer data);
25
26 struct nfc_adapter;
27
28 int nl_init(void);
29
30 void nl_cleanup(void);
31
32 void nl_add_event_handler(guint8 cmd, nfc_event_cb_t cb);
33
34 int nl_get_devices(void);
35
36 int nl_get_targets(struct nfc_adapter *adapter);
37
38 int nl_send_dep_link_up(guint32 idx, guint32 target_idx);
39
40 int nl_start_poll(struct nfc_adapter *adapter, guint8 mode);
41
42 int nl_set_params(struct nfc_adapter *adapter, gint32 lto, gint32 rw,
43                   gint32 miux);
44
45 int nl_get_params(struct nfc_adapter *adapter);
46
47 #endif /* __NETLINK_H */