2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef _ABSTRACT_LAYER_NFCTAG_H_
20 #define _ABSTRACT_LAYER_NFCTAG_H_
22 #include <dpl/shared_ptr.h>
24 #include <Commons/ThreadPool.h>
25 #include "EventTagAction.h"
26 #include "NFCTagProperties.h"
28 using namespace WrtDeviceApis::Commons;
35 NFC_TAGTYPE_GENERIC_PICC = 0x00,
36 NFC_TAGTYPE_ISO14443_A_PICC = 0x01,
37 NFC_TAGTYPE_ISO14443_4A_PICC = 0x02,
38 NFC_TAGTYPE_ISO14443_3A_PICC = 0x03,
39 NFC_TAGTYPE_MIFARE_MINI_PICC = 0x04,
40 NFC_TAGTYPE_MIFARE_1K_PICC = 0x05,
41 NFC_TAGTYPE_MIFARE_4K_PICC = 0x06,
42 NFC_TAGTYPE_MIFARE_ULTRA_PICC = 0x07,
43 NFC_TAGTYPE_MIFARE_DESFIRE_PICC = 0x08,
44 NFC_TAGTYPE_ISO14443_B_PICC = 0x09,
45 NFC_TAGTYPE_ISO14443_4B_PICC = 0x0a,
46 NFC_TAGTYPE_ISO14443_BPRIME_PICC = 0x0b,
47 NFC_TAGTYPE_FELICA_PICC = 0x0c,
48 NFC_TAGTYPE_JEWEL_PICC = 0x0d,
49 NFC_TAGTYPE_ISO15693_PICC = 0x0e,
50 NFC_TAGTYPE_UNKNOWN_TARGET = 0xff
54 public EventRequestReceiver<EventTagActionRead>,
55 public EventRequestReceiver<EventTagActionWrite>,
56 public EventRequestReceiver<EventTagActionTransceive>,
57 public EventRequestReceiver<EventTagActionFormat>
63 virtual void *getHandle() = 0;
64 virtual nfcTagType getTagType() = 0;
65 virtual bool isNDEFSupport() = 0;
66 virtual long getNdefSize() = 0;
67 virtual std::vector<NFCTagProperties> getProperties() = 0;
68 virtual void readNdef(const EventTagActionReadPtr& event) = 0;
69 virtual void writeNdef(const EventTagActionWritePtr& event) = 0;
70 virtual void transceive(const EventTagActionTransceivePtr& event) = 0;
71 virtual void format(const EventTagActionFormatPtr& event) = 0;
73 virtual void setPrivateNFCAdapterPtr(void* priv) {privNFCAdapter = priv;}
74 virtual void *getPrivateNFCAdapterPtr() {return privNFCAdapter;}
77 virtual void OnRequestReceived(const EventTagActionReadPtr& event) = 0;
78 virtual void OnRequestReceived(const EventTagActionWritePtr& event) = 0;
79 virtual void OnRequestReceived(const EventTagActionTransceivePtr& event) = 0;
80 virtual void OnRequestReceived(const EventTagActionFormatPtr& event) = 0;
85 typedef DPL::SharedPtr<INFCTag> INFCTagPtr;
91 #endif /* _ABSTRACT_LAYER_NFCTAG_H_ */