summaryrefslogtreecommitdiff
path: root/lib/neardal_adapter.h
blob: 64b3e9f6681697fbb7d4c77d239fe49a6c48dc9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
 *     NEARDAL (Neard Abstraction Library)
 *
 *     Copyright 2012-2014 Intel Corporation. All rights reserved.
 *
 *     This program is free software; you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License version 2
 *     as published by the Free Software Foundation.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with this program; if not, write to the Free Software Foundation,
 *     Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */

#ifndef NEARDAL_ADAPTER_H
#define NEARDAL_ADAPTER_H

#include "neard_adapter_proxy.h"
#include "neardal_device.h"
#include "neardal_tag.h"
#include "dbus-properties.h"

#define NEARD_ADP_SIG_PROPCHANGED			"properties-changed"
#define NEARD_ADP_SIG_TAG_FOUND				"tag-found"
#define NEARD_ADP_SIG_TAG_LOST				"tag-lost"

/* NEARDAL Adapter Properties */
typedef struct {
	OrgNeardAdapter		*proxy;		/* The proxy connected to Neard
						Adapter interface */
	Properties		*props;
	gchar			*name;		/* DBus interface name
						(as id) */
	gchar			*mode;		/* NFC radio mode */
	void			*parent;
	gboolean		polling;	/* adapter polling active ? */
	gboolean		powered;	/* adapter powered ? */
	gchar			**protocols;	/* protocols list */
	gsize			lenProtocols;
	gsize			tagNb;
	GList			*tagList;	/* Neard adapter tags list
						available */
	gsize			devNb;
	GList			*devList;	/* Neard adapter devices list
						available */
} AdpProp;

/*****************************************************************************
 * neardal_adp_prv_get_tag: Get NEARDAL tag from name
 ****************************************************************************/
errorCode_t neardal_adp_prv_get_tag(AdpProp * adpProp, gchar *tagName,
				       TagProp * *tagProp);

/*****************************************************************************
 * neardal_adp_prv_get_dev: Get NEARDAL dev from name
 ****************************************************************************/
errorCode_t neardal_adp_prv_get_dev(AdpProp * adpProp, gchar *devName,
				       DevProp * *devProp);

/*****************************************************************************
 * neardal_adp_add: add new NEARDAL adapter, initialize DBus Proxy
 * connection, register adapter signal
 ****************************************************************************/
errorCode_t neardal_adp_add(gchar *adapterName);

/*****************************************************************************
 * neardal_adp_remove: remove NEARDAL adapter, unref DBus Proxy
 * connection, unregister adapter signal
 ****************************************************************************/
errorCode_t neardal_adp_remove(AdpProp *adpProp);

#endif /* NEARDAL_ADAPTER_H */