2 // Tizen Web Device API
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #ifndef __TIZEN_NFC_NFCTAG_H_
19 #define __TIZEN_NFC_NFCTAG_H_
24 #include "NdefRecord.h"
25 #include "NdefMessage.h"
26 #include "NFCCallbackData.h"
33 typedef std::shared_ptr<NFCTag> NFCTagPtr;
34 typedef std::pair<std::string, UCharVector> PropertyPair;
36 class NFCTag : public Common::SecurityAccessor
39 NFCTag(nfc_tag_h handle);
42 nfc_tag_type_e getType();
43 std::string getTypeString();
44 bool isSupportedNDEF();
46 std::vector<PropertyPair> getProperties();
48 void writeNDEF(NdefMessageCallbackData* callback);
49 void readNDEF(NdefMessageCallbackData *callback);
51 void addTagProperty(const char *key, UCharVector &value);
53 void transceive(ByteArraySuccessCallback* callback);
57 std::vector<PropertyPair> m_properties;
58 // idle (i.e. not-busy) transceive flag
59 static bool transceive_idle;
60 static void transceiveCB(nfc_error_e result, unsigned char* buffer,
61 int buffer_size, void* user_data);
68 #endif // __TIZEN_NFC_NFCTAG_H_