16be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton/*
26be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton * Copyright (C) 2010 The Android Open Source Project
36be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton *
46be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton * Licensed under the Apache License, Version 2.0 (the "License");
56be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton * you may not use this file except in compliance with the License.
66be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton * You may obtain a copy of the License at
76be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton *
86be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton *      http://www.apache.org/licenses/LICENSE-2.0
96be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton *
106be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton * Unless required by applicable law or agreed to in writing, software
116be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton * distributed under the License is distributed on an "AS IS" BASIS,
126be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
136be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton * See the License for the specific language governing permissions and
146be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton * limitations under the License.
156be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton */
166be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
174e21e1d21a877cce4db5ec8c5786604cc10f2d7eJeff Hamiltonpackage android.nfc.tech;
186be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
196be655c768a82716612c00fdd156254d8dc00f42Jeff Hamiltonimport android.nfc.Tag;
206be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
213fcedf77286a078ebd7ac8c082365bd80703dfdcNick Pellyimport java.io.Closeable;
226be655c768a82716612c00fdd156254d8dc00f42Jeff Hamiltonimport java.io.IOException;
236be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
2474fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly/**
2574fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * {@link TagTechnology} is an interface to a technology in a {@link Tag}.
2674fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <p>
2774fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * Obtain a {@link TagTechnology} implementation by calling the static method <code>get()</code>
2874fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * on the implementation class.
2974fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <p>
3074fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * NFC tags are based on a number of independently developed technologies and offer a
3174fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * wide range of capabilities. The
3274fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * {@link TagTechnology} implementations provide access to these different
3374fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * technologies and capabilities. Some sub-classes map to technology
3474fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * specification (for example {@link NfcA}, {@link IsoDep}, others map to
3574fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * pseudo-technologies or capabilities (for example {@link Ndef}, {@link NdefFormatable}).
3674fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <p>
3774fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * It is mandatory for all Android NFC devices to provide the following
3874fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * {@link TagTechnology} implementations.
3974fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <ul>
4074fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <li>{@link NfcA} (also known as ISO 14443-3A)
4174fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <li>{@link NfcB} (also known as ISO 14443-3B)
4274fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <li>{@link NfcF} (also known as JIS 6319-4)
4374fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <li>{@link NfcV} (also known as ISO 15693)
4474fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <li>{@link IsoDep}
4574fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <li>{@link Ndef} on NFC Forum Type 1, Type 2, Type 3 or Type 4 compliant tags
4674fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * </ul>
4774fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * It is optional for Android NFC devices to provide the following
4874fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * {@link TagTechnology} implementations. If it is not provided, the
4974fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * Android device will never enumerate that class via {@link Tag#getTechList}.
5074fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <ul>
5174fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <li>{@link MifareClassic}
5274fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <li>{@link MifareUltralight}
5374fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <li>{@link NdefFormatable} must only be enumerated on tags for which this Android device
5474fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * is capable of formatting. Proprietary knowledge is often required to format a tag
5574fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * to make it NDEF compatible.
5674fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * </ul>
5774fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <p>
5874fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * {@link TagTechnology} implementations provide methods that fall into two classes:
5974fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <em>cached getters</em> and <em>I/O operations</em>.
6074fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <h4>Cached getters</h4>
6174fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * These methods (usually prefixed by <code>get</code> or <code>is</code>) return
6274fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * properties of the tag, as determined at discovery time. These methods will never
6374fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * block or cause RF activity, and do not require {@link #connect} to have been called.
6474fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * They also never update, for example if a property is changed by an I/O operation with a tag
6574fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * then the cached getter will still return the result from tag discovery time.
6674fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <h4>I/O operations</h4>
6774fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * I/O operations may require RF activity, and may block. They have the following semantics.
6874fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <ul>
6974fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <li>{@link #connect} must be called before using any other I/O operation.
7074fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <li>{@link #close} must be called after completing I/O operations with a
7174fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * {@link TagTechnology}, and it will cancel all other blocked I/O operations on other threads
7274fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * (including {@link #connect} with {@link IOException}.
7374fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <li>Only one {@link TagTechnology} can be connected at a time. Other calls to
7474fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * {@link #connect} will return {@link IOException}.
7574fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * <li>I/O operations may block, and should never be called on the main application
7674fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * thread.
7774fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly * </ul>
7839cf3a445e507f219ecc8a476f6038f095d9d520Nick Pelly *
7939cf3a445e507f219ecc8a476f6038f095d9d520Nick Pelly * <p class="note"><strong>Note:</strong> Methods that perform I/O operations
8039cf3a445e507f219ecc8a476f6038f095d9d520Nick Pelly * require the {@link android.Manifest.permission#NFC} permission.
8174fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly */
823fcedf77286a078ebd7ac8c082365bd80703dfdcNick Pellypublic interface TagTechnology extends Closeable {
836be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    /**
84ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * This technology is an instance of {@link NfcA}.
85ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * <p>Support for this technology type is mandatory.
864e21e1d21a877cce4db5ec8c5786604cc10f2d7eJeff Hamilton     * @hide
876be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton     */
886be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    public static final int NFC_A = 1;
896be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
906be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    /**
91ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * This technology is an instance of {@link NfcB}.
92ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * <p>Support for this technology type is mandatory.
934e21e1d21a877cce4db5ec8c5786604cc10f2d7eJeff Hamilton     * @hide
946be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton     */
956be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    public static final int NFC_B = 2;
966be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
976be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    /**
98ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * This technology is an instance of {@link IsoDep}.
99ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * <p>Support for this technology type is mandatory.
1004e21e1d21a877cce4db5ec8c5786604cc10f2d7eJeff Hamilton     * @hide
1016be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton     */
1026be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    public static final int ISO_DEP = 3;
1036be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
1046be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    /**
105ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * This technology is an instance of {@link NfcF}.
106ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * <p>Support for this technology type is mandatory.
1074e21e1d21a877cce4db5ec8c5786604cc10f2d7eJeff Hamilton     * @hide
1086be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton     */
109641dd62155fd2eeddd93b2036154b13c05b70ba2Jeff Hamilton    public static final int NFC_F = 4;
1106be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
1116be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    /**
112ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * This technology is an instance of {@link NfcV}.
113ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * <p>Support for this technology type is mandatory.
1144e21e1d21a877cce4db5ec8c5786604cc10f2d7eJeff Hamilton     * @hide
1156be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton     */
116641dd62155fd2eeddd93b2036154b13c05b70ba2Jeff Hamilton    public static final int NFC_V = 5;
1176be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
1186be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    /**
119ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * This technology is an instance of {@link Ndef}.
120ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * <p>Support for this technology type is mandatory.
1214e21e1d21a877cce4db5ec8c5786604cc10f2d7eJeff Hamilton     * @hide
1226be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton     */
123641dd62155fd2eeddd93b2036154b13c05b70ba2Jeff Hamilton    public static final int NDEF = 6;
1246be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
1256be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    /**
126ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * This technology is an instance of {@link NdefFormatable}.
127ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * <p>Support for this technology type is mandatory.
1284e21e1d21a877cce4db5ec8c5786604cc10f2d7eJeff Hamilton     * @hide
12939f91ed5290e8b27c795f8aec181a6dd4431d317Martijn Coenen     */
130641dd62155fd2eeddd93b2036154b13c05b70ba2Jeff Hamilton    public static final int NDEF_FORMATABLE = 7;
13139f91ed5290e8b27c795f8aec181a6dd4431d317Martijn Coenen
13239f91ed5290e8b27c795f8aec181a6dd4431d317Martijn Coenen    /**
133ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * This technology is an instance of {@link MifareClassic}.
134ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * <p>Support for this technology type is optional. If a stack doesn't support this technology
135ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * type tags using it must still be discovered and present the lower level radio interface
136ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * technologies in use.
1374e21e1d21a877cce4db5ec8c5786604cc10f2d7eJeff Hamilton     * @hide
1386be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton     */
139641dd62155fd2eeddd93b2036154b13c05b70ba2Jeff Hamilton    public static final int MIFARE_CLASSIC = 8;
1406be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
1416be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    /**
142ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * This technology is an instance of {@link MifareUltralight}.
143ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * <p>Support for this technology type is optional. If a stack doesn't support this technology
144ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * type tags using it must still be discovered and present the lower level radio interface
145ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * technologies in use.
1464e21e1d21a877cce4db5ec8c5786604cc10f2d7eJeff Hamilton     * @hide
1476be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton     */
148641dd62155fd2eeddd93b2036154b13c05b70ba2Jeff Hamilton    public static final int MIFARE_ULTRALIGHT = 9;
1496be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
1506be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    /**
1518f862ef9f74f2d2ebf767c645ce39db8412dd08fMartijn Coenen     * This technology is an instance of {@link NfcBarcode}.
1528f862ef9f74f2d2ebf767c645ce39db8412dd08fMartijn Coenen     * <p>Support for this technology type is optional. If a stack doesn't support this technology
1538f862ef9f74f2d2ebf767c645ce39db8412dd08fMartijn Coenen     * type tags using it must still be discovered and present the lower level radio interface
1548f862ef9f74f2d2ebf767c645ce39db8412dd08fMartijn Coenen     * technologies in use.
1558f862ef9f74f2d2ebf767c645ce39db8412dd08fMartijn Coenen     * @hide
1568f862ef9f74f2d2ebf767c645ce39db8412dd08fMartijn Coenen     */
1578f862ef9f74f2d2ebf767c645ce39db8412dd08fMartijn Coenen    public static final int NFC_BARCODE = 10;
1588f862ef9f74f2d2ebf767c645ce39db8412dd08fMartijn Coenen
1598f862ef9f74f2d2ebf767c645ce39db8412dd08fMartijn Coenen    /**
16074fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * Get the {@link Tag} object backing this {@link TagTechnology} object.
16174fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * @return the {@link Tag} backing this {@link TagTechnology} object.
1626be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton     */
1636be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    public Tag getTag();
1646be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
1656be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    /**
16674fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * Enable I/O operations to the tag from this {@link TagTechnology} object.
16774fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * <p>May cause RF activity and may block. Must not be called
16874fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * from the main application thread. A blocked call will be canceled with
16974fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * {@link IOException} by calling {@link #close} from another thread.
17074fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * <p>Only one {@link TagTechnology} object can be connected to a {@link Tag} at a time.
17174fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * <p>Applications must call {@link #close} when I/O operations are complete.
172ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     *
17339cf3a445e507f219ecc8a476f6038f095d9d520Nick Pelly     * <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
17439cf3a445e507f219ecc8a476f6038f095d9d520Nick Pelly     *
175ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * @see #close()
17674fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * @throws TagLostException if the tag leaves the field
17774fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * @throws IOException if there is an I/O failure, or connect is canceled
1786be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton     */
1796be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    public void connect() throws IOException;
1806be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton
1816be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton    /**
182ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * Re-connect to the {@link Tag} associated with this connection. Reconnecting to a tag can be
183ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * used to reset the state of the tag itself.
184ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     *
18574fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * <p>May cause RF activity and may block. Must not be called
18674fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * from the main application thread. A blocked call will be canceled with
18774fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * {@link IOException} by calling {@link #close} from another thread.
188ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     *
18939cf3a445e507f219ecc8a476f6038f095d9d520Nick Pelly     * <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
19039cf3a445e507f219ecc8a476f6038f095d9d520Nick Pelly     *
191ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * @see #connect()
192ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * @see #close()
19374fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * @throws TagLostException if the tag leaves the field
19474fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * @throws IOException if there is an I/O failure, or connect is canceled
195f003e26df96067b4b136f0859012cb7ec3ed930fNick Pelly     * @hide
1960d27f999f4b1ad51da11946800b40d2978fc6326Martijn Coenen     */
1970d27f999f4b1ad51da11946800b40d2978fc6326Martijn Coenen    public void reconnect() throws IOException;
1980d27f999f4b1ad51da11946800b40d2978fc6326Martijn Coenen
1990d27f999f4b1ad51da11946800b40d2978fc6326Martijn Coenen    /**
20074fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * Disable I/O operations to the tag from this {@link TagTechnology} object, and release resources.
20174fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * <p>Also causes all blocked I/O operations on other thread to be canceled and
20274fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * return with {@link IOException}.
203ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     *
20439cf3a445e507f219ecc8a476f6038f095d9d520Nick Pelly     * <p class="note">Requires the {@link android.Manifest.permission#NFC} permission.
20539cf3a445e507f219ecc8a476f6038f095d9d520Nick Pelly     *
206ce3224cda51f946871daa1e11e3976e25c59e6faJeff Hamilton     * @see #connect()
2076be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton     */
2083fcedf77286a078ebd7ac8c082365bd80703dfdcNick Pelly    public void close() throws IOException;
209f003e26df96067b4b136f0859012cb7ec3ed930fNick Pelly
210f003e26df96067b4b136f0859012cb7ec3ed930fNick Pelly    /**
21174fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * Helper to indicate if I/O operations should be possible.
21274fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     *
21374fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * <p>Returns true if {@link #connect} has completed, and {@link #close} has not been
21474fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * called, and the {@link Tag} is not known to be out of range.
21574fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * <p>Does not cause RF activity, and does not block.
21639cf3a445e507f219ecc8a476f6038f095d9d520Nick Pelly     *
21774fe6c6b245ebe7d3b3d96962c32980d88dca4f5Nick Pelly     * @return true if I/O operations should be possible
218f003e26df96067b4b136f0859012cb7ec3ed930fNick Pelly     */
219f003e26df96067b4b136f0859012cb7ec3ed930fNick Pelly    public boolean isConnected();
2206be655c768a82716612c00fdd156254d8dc00f42Jeff Hamilton}
221