mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
French MPT1327 fixes. Discovered that entire bit stream is inverted, and system is using SYNC (0xB433) and SYNT (0x4BCC) sync patterns.
This commit is contained in:
@@ -75,19 +75,18 @@ public enum SyncPattern
|
||||
}),
|
||||
|
||||
/**
|
||||
* French variant of MPT-1327. This variant uses the following reversal
|
||||
* pattern and sync pattern:
|
||||
* French variant of MPT-1327. This variant uses the following a different
|
||||
* sync pattern:
|
||||
*
|
||||
* REV: 0101 0101 0100 1011
|
||||
* SYNC: 1100 1100 0111 1111
|
||||
* SYNC: 1011 0100 0011 0011
|
||||
*/
|
||||
MPT1327_CONTROL_FRENCH( new boolean[]
|
||||
{
|
||||
true, false, true, true, //Includes final 4 of 16 rev bits
|
||||
true, true, false, false, //1100 0xA
|
||||
true, true, false, false, //1100 0xA
|
||||
false, true, true, true, //0111 0x7
|
||||
true, true, true, true, //1111 0xF
|
||||
true, false, true, false, //Includes final 4 of 16 rev bits
|
||||
true, false, true, true, //1011 0xB
|
||||
false, true, false, false, //0100 0x4
|
||||
false, false, true, true, //0011 0x3
|
||||
false, false, true, true //0011 0x3
|
||||
}),
|
||||
|
||||
/* Revs (0xA) and Sync(0x3B28) = 1010 0011101100101000 */
|
||||
@@ -100,6 +99,21 @@ public enum SyncPattern
|
||||
true, false, false, false //1000 0x8
|
||||
}),
|
||||
|
||||
/**
|
||||
* French variant of MPT-1327. This variant uses the following a different
|
||||
* sync pattern:
|
||||
*
|
||||
* SYNT: 0100 1011 1100 1100
|
||||
*/
|
||||
MPT1327_TRAFFIC_FRENCH( new boolean[]
|
||||
{
|
||||
true, false, true, false, //Includes final 4 of 16 rev bits
|
||||
false, true, false, false, //0100 0x4
|
||||
true, false, true, true, //1011 0xB
|
||||
true, true, false, false, //1100 0xC
|
||||
true, true, false, false //1100 0xC
|
||||
}),
|
||||
|
||||
/* Sync (0x158) = 1101011000 */
|
||||
PASSPORT( new boolean[]
|
||||
{
|
||||
|
||||
@@ -19,6 +19,8 @@ package crc;
|
||||
|
||||
import java.util.BitSet;
|
||||
|
||||
import log.Log;
|
||||
|
||||
/**
|
||||
* Fleetsync CRC checksum utility
|
||||
*
|
||||
@@ -204,4 +206,47 @@ public class CRCFleetsync
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public static void main( String[] args )
|
||||
{
|
||||
BitSet test = new BitSet();
|
||||
|
||||
int[] msg = new int[]
|
||||
{ 1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,0,
|
||||
0,0,1,1,1,1,1,1,1,1,0,1,0,1,1,0,
|
||||
0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
|
||||
0,1,0,0,1,0,1,1,1,1,0,0,1,1,0,0 };
|
||||
|
||||
for( int x = 0; x < msg.length; x++ )
|
||||
{
|
||||
if( msg[ x ] == 0 )
|
||||
{
|
||||
test.clear( x );
|
||||
}
|
||||
else if( msg[ x ] == 1 )
|
||||
{
|
||||
test.set( x );
|
||||
}
|
||||
}
|
||||
CRC result = check( test );
|
||||
|
||||
Log.info( "CRC:" + result.toString() );
|
||||
|
||||
// for( int y = 0; y < 64; y++ )
|
||||
// {
|
||||
// BitSet test2 = test.get( y, y + 63 );
|
||||
//
|
||||
// if( test2.get( 63 ) )
|
||||
// {
|
||||
// test2.clear( 63 );
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// test2.set( 63 );
|
||||
// }
|
||||
// CRC result = check( test2 );
|
||||
//
|
||||
// Log.info( y + " crc:" + result.toString() );
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,8 +127,22 @@ public class MPT1327Decoder extends Decoder implements Instrumentable
|
||||
, 2.0 ); //Gain
|
||||
mDecimationFilter.setListener( mLowPassFilter );
|
||||
|
||||
/* 2FSK Decoder with output inverted */
|
||||
mFSKDecoder = new FSK2Decoder( 24000, 1200, Output.INVERTED );
|
||||
/**
|
||||
* Normal: 2FSK Decoder with inverted output
|
||||
* French: 2FSK Decoder with normal output
|
||||
*/
|
||||
if( sync == Sync.NORMAL )
|
||||
{
|
||||
mFSKDecoder = new FSK2Decoder( 24000, 1200, Output.INVERTED );
|
||||
}
|
||||
else if( sync == Sync.FRENCH )
|
||||
{
|
||||
mFSKDecoder = new FSK2Decoder( 24000, 1200, Output.NORMAL );
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException( "MPT1327 Decoder - unrecognized Sync type" );
|
||||
}
|
||||
mLowPassFilter.setListener( mFSKDecoder );
|
||||
|
||||
mSymbolBroadcaster = new Broadcaster<Boolean>();
|
||||
@@ -290,7 +304,7 @@ public class MPT1327Decoder extends Decoder implements Instrumentable
|
||||
SyncPattern.MPT1327_TRAFFIC ),
|
||||
FRENCH( "French",
|
||||
SyncPattern.MPT1327_CONTROL_FRENCH,
|
||||
SyncPattern.MPT1327_TRAFFIC );
|
||||
SyncPattern.MPT1327_TRAFFIC_FRENCH );
|
||||
|
||||
private String mLabel;
|
||||
private SyncPattern mControlSyncPattern;
|
||||
|
||||
@@ -109,7 +109,7 @@ public class MPT1327Message extends Message
|
||||
checkParity( 1, BLOCK_2_START, BLOCK_3_START );
|
||||
checkParity( 2, BLOCK_3_START, BLOCK_4_START );
|
||||
checkParity( 3, BLOCK_4_START, BLOCK_5_START );
|
||||
checkParity( 3, BLOCK_5_START, BLOCK_5_END );
|
||||
checkParity( 4, BLOCK_5_START, BLOCK_5_END );
|
||||
break;
|
||||
case ACK:
|
||||
case ACKB:
|
||||
|
||||
Reference in New Issue
Block a user