| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DEVICE_NFC_NFC_TAG_TECHNOLOGY_H_ | 5 #ifndef DEVICE_NFC_NFC_TAG_TECHNOLOGY_H_ |
| 6 #define DEVICE_NFC_NFC_TAG_TECHNOLOGY_H_ | 6 #define DEVICE_NFC_NFC_TAG_TECHNOLOGY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/macros.h" |
| 9 #include "device/nfc/nfc_ndef_record.h" | 12 #include "device/nfc/nfc_ndef_record.h" |
| 10 | 13 |
| 11 namespace device { | 14 namespace device { |
| 12 | 15 |
| 13 class NfcTag; | 16 class NfcTag; |
| 14 | 17 |
| 15 // NfcTagTechnology represents an NFC technology that allows a certain type of | 18 // NfcTagTechnology represents an NFC technology that allows a certain type of |
| 16 // I/O operation on an NFC tag. NFC tags can support a wide array of protocols. | 19 // I/O operation on an NFC tag. NFC tags can support a wide array of protocols. |
| 17 // The NfcTagTechnology hierarchy allows both raw and high-level I/O operations | 20 // The NfcTagTechnology hierarchy allows both raw and high-level I/O operations |
| 18 // on NFC tags. Do not create instances of these objects directly. Instead, | 21 // on NFC tags. Do not create instances of these objects directly. Instead, |
| 19 // obtain a handle directly from an NfcTag object. | 22 // obtain a handle directly from an NfcTag object. |
| 20 class NfcTagTechnology { | 23 class NfcTagTechnology { |
| 21 public: | 24 public: |
| 22 // The various I/O technologies that an NFC tag can support. | 25 // The various I/O technologies that an NFC tag can support. |
| 23 enum TechnologyType { | 26 enum TechnologyType { |
| 24 kTechnologyTypeNfcA = 1 << 0, | 27 kTechnologyTypeNfcA = 1 << 0, |
| 25 kTechnologyTypeNfcB = 1 << 1, | 28 kTechnologyTypeNfcB = 1 << 1, |
| 26 kTechnologyTypeNfcF = 1 << 2, | 29 kTechnologyTypeNfcF = 1 << 2, |
| 27 kTechnologyTypeNfcV = 1 << 3, | 30 kTechnologyTypeNfcV = 1 << 3, |
| 28 kTechnologyTypeIsoDep = 1 << 4, | 31 kTechnologyTypeIsoDep = 1 << 4, |
| 29 kTechnologyTypeNdef = 1 << 5 | 32 kTechnologyTypeNdef = 1 << 5 |
| 30 }; | 33 }; |
| 31 typedef uint32 TechnologyTypeMask; | 34 typedef uint32_t TechnologyTypeMask; |
| 32 | 35 |
| 33 virtual ~NfcTagTechnology(); | 36 virtual ~NfcTagTechnology(); |
| 34 | 37 |
| 35 // Returns true, if the underlying tag supports the NFC tag technology that | 38 // Returns true, if the underlying tag supports the NFC tag technology that |
| 36 // this instance represents. | 39 // this instance represents. |
| 37 virtual bool IsSupportedByTag() const = 0; | 40 virtual bool IsSupportedByTag() const = 0; |
| 38 | 41 |
| 39 // Returns a pointer to the associated NfcTag instance. | 42 // Returns a pointer to the associated NfcTag instance. |
| 40 NfcTag* tag() const { return tag_; } | 43 NfcTag* tag() const { return tag_; } |
| 41 | 44 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Constructs a technology instance, where |tag| is the NFC tag that this | 117 // Constructs a technology instance, where |tag| is the NFC tag that this |
| 115 // instance will operate on. | 118 // instance will operate on. |
| 116 explicit NfcNdefTagTechnology(NfcTag* tag); | 119 explicit NfcNdefTagTechnology(NfcTag* tag); |
| 117 | 120 |
| 118 DISALLOW_COPY_AND_ASSIGN(NfcNdefTagTechnology); | 121 DISALLOW_COPY_AND_ASSIGN(NfcNdefTagTechnology); |
| 119 }; | 122 }; |
| 120 | 123 |
| 121 } // namespace device | 124 } // namespace device |
| 122 | 125 |
| 123 #endif // DEVICE_NFC_NFC_TAG_TECHNOLOGY_H_ | 126 #endif // DEVICE_NFC_NFC_TAG_TECHNOLOGY_H_ |
| OLD | NEW |