mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-11 08:07:24 -05:00
P25 Work-in-progress check-in.
This commit is contained in:
@@ -48,6 +48,28 @@ public class SyncPatternMatcher
|
||||
}
|
||||
}
|
||||
|
||||
public SyncPatternMatcher( long sync )
|
||||
{
|
||||
mSync = sync;
|
||||
mMask = getMask( sync );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates an all ones mask corresponding to the sync pattern
|
||||
*/
|
||||
private static long getMask( long sync )
|
||||
{
|
||||
long mask = sync;
|
||||
|
||||
for( int x = 1; x < 64; x *= 2 )
|
||||
{
|
||||
mask |= ( mask >> x );
|
||||
}
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
|
||||
public void receive( boolean bit )
|
||||
{
|
||||
//Left shift the previous value
|
||||
|
||||
Reference in New Issue
Block a user