mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
P25 Work-in-progress check-in.
This commit is contained in:
@@ -87,6 +87,13 @@ public class BitSetBuffer extends BitSet
|
||||
this.or( toCopyFrom );
|
||||
this.mPointer = toCopyFrom.pointer();
|
||||
}
|
||||
|
||||
public BitSetBuffer( BitSet bitset, int size )
|
||||
{
|
||||
this( size );
|
||||
this.or( bitset );
|
||||
this.mPointer = size - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Current pointer index
|
||||
@@ -95,6 +102,11 @@ public class BitSetBuffer extends BitSet
|
||||
{
|
||||
return mPointer;
|
||||
}
|
||||
|
||||
public void setPointer( int index )
|
||||
{
|
||||
mPointer = index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static method to construct a new BitSetBuffer, preloaded with the bits
|
||||
@@ -153,6 +165,11 @@ public class BitSetBuffer extends BitSet
|
||||
{
|
||||
return mSize;
|
||||
}
|
||||
|
||||
public void setSize( int size )
|
||||
{
|
||||
mSize = size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears (sets to false or 0) the bits in this bitset and resets the
|
||||
|
||||
@@ -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