3 * neard - Near Field Communication manager
5 * Copyright (C) 2012 Intel Corporation. All rights reserved.
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.
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.
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
22 #ifndef __NEAR_DEVICE_H
23 #define __NEAR_DEVICE_H
31 typedef void (*near_device_io_cb) (uint32_t adapter_idx, uint32_t target_idx,
34 struct near_ndef_message;
36 #define NEAR_DEVICE_PRIORITY_LOW -100
37 #define NEAR_DEVICE_PRIORITY_DEFAULT 0
38 #define NEAR_DEVICE_PRIORITY_HIGH 100
40 #define NEAR_DEVICE_SN_NPP "com.android.npp"
41 #define NEAR_DEVICE_SN_SNEP "urn:nfc:sn:snep"
42 #define NEAR_DEVICE_SN_HANDOVER "urn:nfc:sn:handover"
44 struct near_device_driver {
47 int (*listen)(uint32_t adapter_idx, near_device_io_cb cb);
48 int (*push)(uint32_t adapter_idx, uint32_t target_idx,
49 struct near_ndef_message *ndef,
51 near_device_io_cb cb);
54 struct near_device *near_device_get_device(uint32_t adapter_idx,
56 int near_device_add_data(uint32_t adapter_idx, uint32_t target_idx,
57 uint8_t *data, size_t data_length);
58 int near_device_add_records(struct near_device *device, GList *records,
59 near_device_io_cb cb, int status);
60 int near_device_driver_register(struct near_device_driver *driver);
61 void near_device_driver_unregister(struct near_device_driver *driver);