public class TagOperator extends Object
Constructor and Description |
---|
TagOperator(cipherlab.rfid.device1800.config.Connector connector)
Initializes a new instance of the TagOperator with a given Connector that
is already connected.
|
Modifier and Type | Method and Description |
---|---|
void |
RFIDDirectCancelInventoryRound()
Stops the 1800 device from tag scanning during an inventory round.
|
DeviceResponse |
RFIDDirectKillTag(byte[] password,
byte[] epc)
Automatically triggers the 1800 device to kill a RFID tag with a given
EPC.
|
DeviceResponse |
RFIDDirectLockTag(byte[] password,
byte[] epc,
cipherlab.rfid.device1800.config.LockTarget targetBank)
Automatically triggers the 1800 device to lock a RFID tag memory bank
with a given EPC.
|
DeviceResponse |
RFIDDirectPermanentLockTag(byte[] password,
byte[] epc,
cipherlab.rfid.device1800.config.LockTarget targetBank)
Automatically triggers the 1800 device to permanently lock a RFID tag
memory bank with a given EPC.
|
void |
RFIDDirectReadTagByEPC(byte[] password,
byte[] epc,
RFIDMemoryBank bank,
int start,
int length,
int retry)
Automatically triggers a RFID tag read on the 1800 device with a given
EPC.
|
void |
RFIDDirectReadTagByTID(byte[] password,
byte[] tid,
RFIDMemoryBank bank,
int start,
int length,
int retry)
Automatically triggers a RFID tag read on the 1800 device with a given
TID.
|
void |
RFIDDirectStartInventoryRound(InventoryType type,
int count)
Automatically triggers a RFID inventory round on the 1800 device.
|
DeviceResponse |
RFIDDirectUnlockTag(byte[] password,
byte[] epc,
cipherlab.rfid.device1800.config.LockTarget targetBank)
Automatically triggers the 1800 device to unlock a RFID tag memory bank
with a given EPC.
|
DeviceResponse |
RFIDDirectWriteTagByEPC(byte[] password,
byte[] epc,
RFIDMemoryBank bank,
int start,
int retry,
byte[] data)
Automatically triggers a RFID tag write on the 1800 device with a given
EPC.
|
DeviceResponse |
RFIDDirectWriteTagByTID(byte[] password,
byte[] tid,
RFIDMemoryBank bank,
int start,
int retry,
byte[] data)
Automatically triggers a RFID tag write on the 1800 device with a given
TID.
|
void |
RFIDReadTagMassive(byte[] password,
RFIDMemoryBank bank,
int start,
int length)
Prepares the 1800 device for trigger-pressed read.
|
void |
RFIDWriteTagMassive(byte[] password,
RFIDMemoryBank bank,
byte[] data,
int start,
int length)
Prepares the 1800 device for trigger-pressed write.
|
void |
SetLogPath(String path)
The path parameter is not empty, log messages are written to a single log
file.
|
public TagOperator(cipherlab.rfid.device1800.config.Connector connector) throws ConfiguratorException
ConfiguratorException
public void SetLogPath(String path)
import cipherlab.rfid.device1800.config.TagOperator; BluetoothSocketConnector mConnector = new BluetoothSocketConnector(this); TagOperator mOperator = new TagOperator(mConnector); operator.SetLogPath("test.log");
public void RFIDReadTagMassive(byte[] password, RFIDMemoryBank bank, int start, int length) throws ConfiguratorException
import cipherlab.rfid.device1800.config; mOperator.RFIDReadTagMassive(NULL, RFIDMemoryBank.User, 0, 0);
password
- Tag access passwordbank
- Tag memory bank to read fromstart
- Start byte position in bank memorylength
- Number of bytes to readConfiguratorException
RFIDWriteTagMassive(byte[], cipherlab.rfid.device1800.config.RFIDMemoryBank, byte[], int, int)
public void RFIDWriteTagMassive(byte[] password, RFIDMemoryBank bank, byte[] data, int start, int length) throws ConfiguratorException
import cipherlab.rfid.device1800.config.TagOperator; mOperator.RFIDWriteTagMassive(NULL, RFIDMemoryBank.User, "Test", 0, 4);
password
- Tag access passwordbank
- Tag memory bank to read fromdata
- Data to write to the given RFID tag memory bankstart
- Start byte position in bank memorylength
- Number of bytes to readConfiguratorException
RFIDReadTagMassive(byte[], cipherlab.rfid.device1800.config.RFIDMemoryBank, int, int)
public void RFIDDirectStartInventoryRound(InventoryType type, int count) throws ConfiguratorException
import cipherlab.rfid.device1800.config.TagOperator; public void onClick(View v) { mOperator.RFIDDirectStartInventoryRound(InventoryType.EPC, 1); } public class listener implements IConfigEventListener { public void onConnected() { } public void onDisconnected() { } public void onDeviceEvent(int value) { } public void onDataTransmission(EPCData data) { } public void onInventory(InventoryData data, DeviceResponse response) { switch (response) { case OperationSuccess: if (data != null && mSelect[0].isChecked()) { mReceive[0].setText(data.EPCData); } break; case OperationFinish: { Toast t = Toast.makeText(MainActivity.this, R.string.str_success, Toast.LENGTH_SHORT); t.show(); break; } case OperationFail: case DeviceTimeOut: { Toast t = Toast.makeText(MainActivity.this, R.string.str_failed, Toast.LENGTH_SHORT); t.show(); * break; } case DeviceBusy: Toast t = Toast.makeText(MainActivity.this, R.string.str_busy, Toast.LENGTH_SHORT); t.show(); break; default: break; } } public void onReadTag(byte[] data, DeviceResponse response) { } }
type
- Format of the collected data in the inventory roundcount
- Number of reads in one inventory roundConfiguratorException
RFIDDirectCancelInventoryRound()
public void RFIDDirectCancelInventoryRound() throws ConfiguratorException
import cipherlab.rfid.device1800.config.TagOperator; public void onClick(View v) { mOperator.RFIDDirectCancelInventoryRound(); }
public void RFIDDirectReadTagByEPC(byte[] password, byte[] epc, RFIDMemoryBank bank, int start, int length, int retry) throws ConfiguratorException
import cipherlab.rfid.device1800.config.TagOperator; public void onClick(View v) { byte[] EPCByteArray = new byte[] { 0x35, 0x15, 0xFD, 0x85, 0x60, 0x08, 0x23, 0x50, 0x00, 0x00, 0x00, 0x02 }; mOperator.RFIDDirectReadTagByEPC(null, EPCByteArray, RFIDMemoryBank.User, 0, 0, 0); } public class listener implements IConfigEventListener { public void onConnected() { } public void onDisconnected() { } public void onDeviceEvent(int value) { } public void onDataTransmission(EPCData data) { } public void onInventory(InventoryData data, DeviceResponse response) { } public void onReadTag(byte[] data, DeviceResponse response) { switch (response) { case OperationSuccess: { break; } case OperationFinish: { Toast t = Toast.makeText(MainActivity.this, R.string.str_success, Toast.LENGTH_SHORT); t.show(); break; } case OperationFail: case DeviceTimeOut: { Toast t = Toast.makeText(MainActivity.this, R.string.str_failed, Toast.LENGTH_SHORT); t.show(); break; } case DeviceBusy: Toast t = Toast.makeText(MainActivity.this, R.string.str_busy, Toast.LENGTH_SHORT); t.show(); break; default: break; } } }
password
- Tag access passwordepc
- EPC used to pick out the tag to readbank
- Tag memory bank to read fromstart
- Start byte position in bank memorylength
- Number of bytes to readretry
- Number of retries if initial read failsConfiguratorException
RFIDDirectWriteTagByEPC(byte[], byte[], cipherlab.rfid.device1800.config.RFIDMemoryBank, int, int, byte[])
public DeviceResponse RFIDDirectWriteTagByEPC(byte[] password, byte[] epc, RFIDMemoryBank bank, int start, int retry, byte[] data) throws ConfiguratorException
import cipherlab.rfid.device1800.config.TagOperator; public void onClick(View v) { byte[] DataArray = new byte[] { 0x31, 0x32, 0x33, 0x34 }; byte[] EPCByteArray = new byte[] { 0x35, 0x15, 0xFD, 0x85, 0x60, 0x08, 0x23, 0x50, 0x00, 0x00, 0x00, 0x02 }; mOperator.RFIDDirectWriteTagByEPC(null, EPCByteArray, RFIDMemoryBank.User, 0, 0, 0, DataArray); }
password
- Tag access passwordepc
- EPC used to pick out the tag to readbank
- Tag memory bank to read fromstart
- Start byte position in bank memoryretry
- Number of retries if initial read failsdata
- Data to write to the given RFID tag memory bankDeviceResponse
ConfiguratorException
RFIDDirectReadTagByEPC(byte[], byte[], cipherlab.rfid.device1800.config.RFIDMemoryBank, int, int, int)
public void RFIDDirectReadTagByTID(byte[] password, byte[] tid, RFIDMemoryBank bank, int start, int length, int retry) throws ConfiguratorException
import cipherlab.rfid.device1800.config.TagOperator; public void onClick(View v) { byte[] TIDByteArray = new byte[] { 0x35, 0x15, 0xFD, 0x85, 0x60, 0x08, 0x23, 0x50, 0x00, 0x00, 0x00, 0x02 }; mOperator.RFIDDirectReadTagByTID(null, TIDByteArray, RFIDMemoryBank.User, 0, 0, 0); } public class listener implements IConfigEventListener { public void onConnected() { } public void onDisconnected() { } public void onDeviceEvent(int value) { } public void onDataTransmission(EPCData data) { } public void onInventory(InventoryData data, DeviceResponse response) { } public void onReadTag(byte[] data, DeviceResponse response) { switch (response) { case OperationSuccess: { break; } case OperationFinish: { Toast t = Toast.makeText(MainActivity.this, R.string.str_success, Toast.LENGTH_SHORT); t.show(); break; } case OperationFail: case DeviceTimeOut: { Toast t = Toast.makeText(MainActivity.this, R.string.str_failed, Toast.LENGTH_SHORT); t.show(); break; } case DeviceBusy: Toast t = Toast.makeText(MainActivity.this, R.string.str_busy, Toast.LENGTH_SHORT); t.show(); break; default: break; } } }
password
- Tag access passwordtid
- TID used to pick out the tag to readbank
- Tag memory bank to read fromstart
- Start byte position in bank memorylength
- Number of bytes to readretry
- Number of retries if initial read failsConfiguratorException
RFIDDirectWriteTagByTID(byte[], byte[], cipherlab.rfid.device1800.config.RFIDMemoryBank, int, int, byte[])
public DeviceResponse RFIDDirectWriteTagByTID(byte[] password, byte[] tid, RFIDMemoryBank bank, int start, int retry, byte[] data) throws ConfiguratorException
import cipherlab.rfid.device1800.config.TagOperator; public void onClick(View v) { byte[] DataArray = new byte[] { 0x31, 0x32, 0x33, 0x34 }; byte[] TIDByteArray = new byte[] { 0x35, 0x15, 0xFD, 0x85, 0x60, 0x08, 0x23, 0x50, 0x00, 0x00, 0x00, 0x02 }; mOperator.RFIDDirectWriteTagByTID(null, TIDByteArray, RFIDMemoryBank.User, 0, 0, 0, DataArray); }
password
- Tag access passwordtid
- TID used to pick out the tag to writebank
- Tag memory bank to read fromstart
- Start byte position in bank memoryretry
- Number of retries if initial read failsdata
- Data to write to the given RFID tag memory bankDeviceResponse
ConfiguratorException
RFIDDirectReadTagByTID(byte[], byte[], cipherlab.rfid.device1800.config.RFIDMemoryBank, int, int, int)
public DeviceResponse RFIDDirectKillTag(byte[] password, byte[] epc) throws ConfiguratorException
import cipherlab.rfid.device1800.config.TagOperator; public void onClick(View v) { byte[] password = new byte[] { 0x31, 0x32, 0x33, 0x34 }; byte[] epc = new byte[] { 0x35, 0x15, 0xFD, 0x85, 0x60, 0x08, 0x23, 0x50, 0x00, 0x00, 0x00, 0x02 }; if (mOperator.RFIDDirectKillTag(password, epc) == DeviceResponse.OperationSuccess) { // tag killed } else { // handle error } }
password
- Tag kill passwordepc
- EPC used to pick out the tag to killDeviceResponse
ConfiguratorException
public DeviceResponse RFIDDirectUnlockTag(byte[] password, byte[] epc, cipherlab.rfid.device1800.config.LockTarget targetBank) throws ConfiguratorException
import cipherlab.rfid.device1800.config.TagOperator; public void onClick(View v) { byte[] password = new byte[] { 0x31, 0x32, 0x33, 0x34 }; byte[] epc = new byte[] { 0x35, 0x15, 0xFD, 0x85, 0x60, 0x08, 0x23, 0x50, 0x00, 0x00, 0x00, 0x02 }; if (mOperator.RFIDDirectUnlockTag(password, epc, LockTarget.EPC) == DeviceResponse.OperationSuccess) { // epc bank unlocked } else { // handle error } }
password
- Tag access passwordepc
- EPC used to pick out the tag to unlocktargetBank
- Tag memory bank which will be unlockedDeviceResponse
ConfiguratorException
RFIDDirectLockTag(byte[], byte[], cipherlab.rfid.device1800.config.LockTarget)
public DeviceResponse RFIDDirectLockTag(byte[] password, byte[] epc, cipherlab.rfid.device1800.config.LockTarget targetBank) throws ConfiguratorException
import cipherlab.rfid.device1800.config.TagOperator; public void onClick(View v) { byte[] password = new byte[] { 0x31, 0x32, 0x33, 0x34 }; byte[] epc = new byte[] { 0x35, 0x15, 0xFD, 0x85, 0x60, 0x08, 0x23, 0x50, 0x00, 0x00, 0x00, 0x02 }; if (mOperator.RFIDDirectLockTag(password, epc, LockTarget.EPC) == DeviceResponse.OperationSuccess) { // epc bank locked } else { // handle error } }
password
- Tag access passwordepc
- EPC used to pick out the tag to locktargetBank
- Tag memory bank which will be lockedDeviceResponse
ConfiguratorException
RFIDDirectUnlockTag(byte[], byte[], cipherlab.rfid.device1800.config.LockTarget)
public DeviceResponse RFIDDirectPermanentLockTag(byte[] password, byte[] epc, cipherlab.rfid.device1800.config.LockTarget targetBank) throws ConfiguratorException
import cipherlab.rfid.device1800.config.TagOperator; public void onClick(View v) { byte[] password = new byte[] { 0x31, 0x32, 0x33, 0x34 }; byte[] epc = new byte[] { 0x35, 0x15, 0xFD, 0x85, 0x60, 0x08, 0x23, 0x50, 0x00, 0x00, 0x00, 0x02 }; if (mOperator.RFIDDirectPermanentLockTag(password, epc, LockTarget.EPC) == DeviceResponse.OperationSuccess) { // epc bank permanent locked } else { // handle error } }
password
- Tag access passwordepc
- EPC used to pick out the tag to permanently locktargetBank
- Tag memory bank which will be permanently lockedDeviceResponse
ConfiguratorException
RFIDDirectLockTag(byte[], byte[], cipherlab.rfid.device1800.config.LockTarget)