mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
* #6 DMR decoder feature - work in progress * #6 DMR Decoder. * #6 DMR Decoder. Code review updates. Co-authored-by: Zhenyu Mao <maozhenyu@foxmail.com> Co-authored-by: Denny <denny@denny-desktop>
This commit is contained in:
@@ -834,6 +834,24 @@ public class BinaryMessage extends BitSet
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the twos-complement value of the bits between start and end, inclusive
|
||||
* @param start bit position
|
||||
* @param end bit position
|
||||
* @return twos complement value
|
||||
*/
|
||||
public int getTwosComplement(int start, int end)
|
||||
{
|
||||
BinaryMessage sub = getSubMessage(start, end);
|
||||
boolean negative = sub.get(start);
|
||||
sub.flip(0, sub.size());
|
||||
|
||||
int value = sub.getInt(0, sub.size()) + 1;
|
||||
value *= (negative ? -1 : 1);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the long value represented by the bit range. This method will
|
||||
* parse the bits in big endian or little endian format. The start value
|
||||
|
||||
@@ -33,6 +33,10 @@ public class SoftSyncDetector implements ISyncProcessor
|
||||
mThreshold = threshold;
|
||||
}
|
||||
|
||||
public SoftSyncDetector(long pattern, int threshold) {
|
||||
mPattern = pattern;
|
||||
mThreshold = threshold;
|
||||
}
|
||||
public void dispose()
|
||||
{
|
||||
mListener = null;
|
||||
|
||||
Reference in New Issue
Block a user