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
|
/*
*
* neard - Near Field Communication manager
*
* Copyright (C) 2012 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
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdint.h>
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
#include <linux/socket.h>
#include <linux/nfc.h>
#include <near/log.h>
#include <near/types.h>
#include <near/adapter.h>
#include <near/target.h>
#include <near/tag.h>
#include <near/ndef.h>
#include <near/tlv.h>
#include "p2p.h"
static near_bool_t handover_read(int client_fd,
uint32_t adapter_idx, uint32_t target_idx,
near_tag_io_cb cb)
{
DBG("");
cb(adapter_idx, target_idx, 0);
return FALSE;
}
struct near_p2p_driver handover_driver = {
.name = "Handover",
.service_name = "urn:nfc:sn:handover",
.read = handover_read,
};
int handover_init(void)
{
return near_p2p_register(&handover_driver);
}
void handover_exit(void)
{
near_p2p_unregister(&handover_driver);
}
|