Package jmri.jmrix.rfid.protocol.coreid
Class CoreIdRfidProtocol
java.lang.Object
jmri.jmrix.rfid.RfidProtocol
jmri.jmrix.rfid.protocol.coreid.CoreIdRfidProtocol
Common routines to extract the Tag information and validate checksum for
implementations that use the CORE-ID / ID-Innovations protocol.
This file is part of JMRI.
This file is part of JMRI.
JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
Field Summary
Fields inherited from class jmri.jmrix.rfid.RfidProtocol
concentratorFirst, concentratorLast, isConcentrator, portPosition -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for CORE-ID RFID Protocol.CoreIdRfidProtocol(char concentratorFirst, char concentratorLast, int portPosition) Constructor for CORE-ID RFID Protocol. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if at the end of this RFID replyWhen available, returns the checksum portion of an RFID replystatic final intgetTag(AbstractMRReply msg) Retrieves RFID Tag information from messageReturns the initialisation string to be sent to an adapter implementing the protocol.booleanbooleanisValid(AbstractMRReply msg) Determines if this RFID reply is validbooleanDetermines if this protocol provides checksum values Default is false.Provides a textual representation of this message for the monitorMethods inherited from class jmri.jmrix.rfid.RfidProtocol
convertHexString, getReaderPort
-
Constructor Details
-
CoreIdRfidProtocol
public CoreIdRfidProtocol()Constructor for CORE-ID RFID Protocol. Used when a single reader is connected directly to a port, not via a concentrator. -
CoreIdRfidProtocol
Constructor for CORE-ID RFID Protocol. Supports the use of concentrators where a character range is used to determine the specific reader port.- Parameters:
concentratorFirst- character representing first concentrator portconcentratorLast- character representing last concentrator portportPosition- position of port character in reply string
-
-
Method Details
-
getMaxSize
-
initString
Description copied from class:RfidProtocolReturns the initialisation string to be sent to an adapter implementing the protocol. For those protocols that do not require one, return a blank string- Specified by:
initStringin classRfidProtocol- Returns:
- initialisation string
-
getTag
Description copied from class:RfidProtocolRetrieves RFID Tag information from message- Overrides:
getTagin classRfidProtocol- Parameters:
msg- Message to decode- Returns:
- String representation of tag
-
providesChecksum
Description copied from class:RfidProtocolDetermines if this protocol provides checksum values Default is false. Protocols that do provide them should override this method.- Overrides:
providesChecksumin classRfidProtocol- Returns:
- true if provided
-
getCheckSum
Description copied from class:RfidProtocolWhen available, returns the checksum portion of an RFID reply- Specified by:
getCheckSumin classRfidProtocol- Parameters:
msg- RFID reply to process- Returns:
- checksum value
-
isValid
Description copied from class:RfidProtocolDetermines if this RFID reply is valid- Specified by:
isValidin classRfidProtocol- Parameters:
msg- RFID reply to process- Returns:
- true if valid
-
isCheckSumValid
-
endOfMessage
Description copied from class:RfidProtocolDetermines if at the end of this RFID reply- Specified by:
endOfMessagein classRfidProtocol- Parameters:
msg- RFID reply to process- Returns:
- true if at end
-
toMonitorString
Description copied from class:RfidProtocolProvides a textual representation of this message for the monitor- Overrides:
toMonitorStringin classRfidProtocol- Parameters:
msg- RFID reply to process- Returns:
- textual representation
-