Home | History | Annotate | Download | only in jni
      1 /*
      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 
     25 #define LOG_TAG "NdefMessage"
     26 #include <utils/Log.h>
     27 
     28 extern "C" {
     29 
     30 #if 0
     31   #define TRACE(...) ALOG(LOG_DEBUG, "NdefMessage", __VA_ARGS__)
     32 #else
     33   #define TRACE(...)
     34 #endif
     35 
     36 typedef 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 
     47 uint16_t phFriNfc_NdefRecord_GetRecords(uint8_t*      pBuffer,
     48                                         uint32_t      BufferLength,
     49                                         uint8_t*      pRawRecords[ ],
     50                                         uint8_t       IsChunked[ ],
     51                                         uint32_t*     pNumberOfRawRecords
     52                                         );
     53 uint16_t phFriNfc_NdefRecord_Parse(phFriNfc_NdefRecord_t* pRecord,
     54                                    uint8_t*               pRawRecord);
     55 
     56 uint16_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
     64