blob: 36346e359b595158e3b1f96139a6da06ba0d6d34 [file] [log] [blame]
Nick Pellybc21fde2010-10-13 17:25:24 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 * Contains the bare minimum header so that framework NFC jni can link
19 * against NFC native library
20 */
21
22#ifndef __ANDROID_NFC_H__
23#define __ANDROID_NFC_H__
24
Jeff Hamilton5629d512010-11-08 11:36:21 -060025#define LOG_TAG "NdefMessage"
26#include <utils/Log.h>
27
Nick Pellybc21fde2010-10-13 17:25:24 -070028extern "C" {
29
Jeff Hamilton5629d512010-11-08 11:36:21 -060030#if 0
Steve Block28d9f022011-10-12 17:27:03 +010031 #define TRACE(...) ALOG(LOG_DEBUG, "NdefMessage", __VA_ARGS__)
Jeff Hamilton5629d512010-11-08 11:36:21 -060032#else
33 #define TRACE(...)
34#endif
35
Nick Pellybc21fde2010-10-13 17:25:24 -070036typedef struct phFriNfc_NdefRecord {
37 uint8_t Flags;
38 uint8_t Tnf;
39 uint8_t TypeLength;
40 uint8_t *Type;
41 uint8_t IdLength;
42 uint8_t *Id;
43 uint32_t PayloadLength;
44 uint8_t *PayloadData;
45} phFriNfc_NdefRecord_t;
46
47uint16_t phFriNfc_NdefRecord_GetRecords(uint8_t* pBuffer,
48 uint32_t BufferLength,
49 uint8_t* pRawRecords[ ],
50 uint8_t IsChunked[ ],
51 uint32_t* pNumberOfRawRecords
52 );
53uint16_t phFriNfc_NdefRecord_Parse(phFriNfc_NdefRecord_t* pRecord,
54 uint8_t* pRawRecord);
55
56uint16_t phFriNfc_NdefRecord_Generate(phFriNfc_NdefRecord_t* pRecord,
57 uint8_t* pBuffer,
58 uint32_t MaxBufferSize,
59 uint32_t* pBytesWritten
60 );
61}
62
63#endif