gov.nasa.gsfc.drl.rtstps.core.fs
Class XSynchronizer
java.lang.Object
gov.nasa.gsfc.drl.rtstps.core.fs.AbstractSynchronizer
gov.nasa.gsfc.drl.rtstps.core.fs.XSynchronizer
class XSynchronizer
- extends AbstractSynchronizer
This class handles the frame synchronizer pattern logic for the Frame
Synchronizer subsystem. It handles ambiguous sync patterns. See the
AbstractSynchronizer class description for more information.
Fields inherited from class gov.nasa.gsfc.drl.rtstps.core.fs.AbstractSynchronizer |
frameLength, NOSYNC, s1, s1mask, s2, s2value, s3, s4, s5, s5mask, slippage, syncLength |
Constructor Summary |
XSynchronizer(byte[] pattern,
int frameLength)
Create an XSynchronizer. |
Method Summary |
(package private) Location |
search(byte[] data,
int dataLength,
int start,
int end)
Search for sync in the data array. |
private Location |
testSearch(byte[] data,
int byteOffset,
int bitIndex)
I test a candidate sync pattern. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ambiguousS2
private int[] ambiguousS2
s2plus
private int[][] s2plus
XSynchronizer
XSynchronizer(byte[] pattern,
int frameLength)
- Create an XSynchronizer.
- Parameters:
pattern
- The synchronization pattern. The length may be 1 to 4
bytes.frameLength
- The expected frame length, which includes the sync
pattern.
search
Location search(byte[] data,
int dataLength,
int start,
int end)
- Search for sync in the data array.
- Specified by:
search
in class AbstractSynchronizer
- Parameters:
data
- The data array that may contain frames.dataLength
- The actual length of the data array, which may be
less than data.length.start
- A start byte in data[].end
- An end byte in data[]. It cannot detect partial sync, so
it will adjust the end byte if necessary to be no greater
than dataLength-syncLength.
- Returns:
- A location in data where the first sync pattern was detected
between start and end. It returns null if it did not detect
sync.
testSearch
private Location testSearch(byte[] data,
int byteOffset,
int bitIndex)
- I test a candidate sync pattern.