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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
/*
*
* neard - Near Field Communication manager
*
* Copyright (C) 2011 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU 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 St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include <glib.h>
#include "log.h"
#include <near/types.h>
struct near_adapter;
struct near_target;
int __near_log_init(const char *debug, gboolean detach);
void __near_log_cleanup(void);
#include <near/dbus.h>
int __near_dbus_init(DBusConnection *conn);
void __near_dbus_cleanup(void);
DBusMessage *__near_error_failed(DBusMessage *msg, int errnum);
DBusMessage *__near_error_invalid_arguments(DBusMessage *msg);
DBusMessage *__near_error_permission_denied(DBusMessage *msg);
DBusMessage *__near_error_passphrase_required(DBusMessage *msg);
DBusMessage *__near_error_not_registered(DBusMessage *msg);
DBusMessage *__near_error_not_unique(DBusMessage *msg);
DBusMessage *__near_error_not_supported(DBusMessage *msg);
DBusMessage *__near_error_not_implemented(DBusMessage *msg);
DBusMessage *__near_error_not_found(DBusMessage *msg);
DBusMessage *__near_error_no_carrier(DBusMessage *msg);
DBusMessage *__near_error_in_progress(DBusMessage *msg);
DBusMessage *__near_error_already_exists(DBusMessage *msg);
DBusMessage *__near_error_already_enabled(DBusMessage *msg);
DBusMessage *__near_error_already_disabled(DBusMessage *msg);
DBusMessage *__near_error_already_connected(DBusMessage *msg);
DBusMessage *__near_error_not_connected(DBusMessage *msg);
DBusMessage *__near_error_operation_aborted(DBusMessage *msg);
DBusMessage *__near_error_operation_timeout(DBusMessage *msg);
DBusMessage *__near_error_invalid_service(DBusMessage *msg);
DBusMessage *__near_error_invalid_property(DBusMessage *msg);
int __near_manager_adapter_add(guint32 idx, const char *name, guint32 protocols);
void __near_manager_adapter_remove(guint32 idx);
int __near_manager_init(DBusConnection *conn);
void __near_manager_cleanup(void);
struct near_adapter * __near_adapter_create(guint32 idx,
const char *name, guint32 protocols);
void __near_adapter_destroy(struct near_adapter *adapter);
const char *__near_adapter_get_path(struct near_adapter *adapter);
struct near_adapter *__near_adapter_get(guint32 idx);
int __near_adapter_add(struct near_adapter *adapter);
void __near_adapter_remove(struct near_adapter *adapter);
int __near_adapter_add_target(guint32 idx, struct near_target *target);
int __near_adapter_remove_target(guint32 idx);
void __near_adapter_list(DBusMessageIter *iter, void *user_data);
int __near_adapter_init(void);
void __near_adapter_cleanup(void);
enum near_target_type {
NEAR_TARGET_TYPE_TAG = 0,
NEAR_TARGET_TYPE_DEVICE = 1,
};
const char *__near_target_get_path(struct near_target *target);
int __near_target_add(guint32 adapter_idx, guint32 target_idx,
guint32 protocols, enum near_target_type type);
void __near_target_remove(guint32 target_idx);
int __near_target_init(void);
void __near_target_cleanup(void);
int __near_netlink_get_adapters(void);
int __near_netlink_start_poll(int idx, guint32 protocols);
int __near_netlink_stop_poll(int idx);
int __near_netlink_init(void);
void __near_netlink_cleanup(void);
|