mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-17 02:57:35 -05:00
LJ1200 added message field parsing
This commit is contained in:
@@ -60,8 +60,8 @@ public enum DecoderType
|
|||||||
DecoderType.LTR_STANDARD,
|
DecoderType.LTR_STANDARD,
|
||||||
DecoderType.MPT1327,
|
DecoderType.MPT1327,
|
||||||
DecoderType.NBFM,
|
DecoderType.NBFM,
|
||||||
DecoderType.PASSPORT,
|
// DecoderType.P25_PHASE1,
|
||||||
DecoderType.P25_PHASE1 );
|
DecoderType.PASSPORT );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class LJ1200CallEvent extends CallEvent
|
|||||||
@Override
|
@Override
|
||||||
public long getFrequency()
|
public long getFrequency()
|
||||||
{
|
{
|
||||||
return 0;
|
return 173075000;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder
|
public static class Builder
|
||||||
@@ -94,7 +94,7 @@ public class LJ1200CallEvent extends CallEvent
|
|||||||
{
|
{
|
||||||
mFromID = val;
|
mFromID = val;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder details( String details )
|
public Builder details( String details )
|
||||||
{
|
{
|
||||||
@@ -128,12 +128,11 @@ public class LJ1200CallEvent extends CallEvent
|
|||||||
|
|
||||||
public static LJ1200CallEvent getLJ1200Event( LJ1200Message message )
|
public static LJ1200CallEvent getLJ1200Event( LJ1200Message message )
|
||||||
{
|
{
|
||||||
CallEventType type = CallEventType.UNKNOWN;
|
CallEventType type = CallEventType.REQUEST;
|
||||||
StringBuilder sbDetails = new StringBuilder();
|
|
||||||
sbDetails.append( "LJ-1200 " );
|
|
||||||
|
|
||||||
return new LJ1200CallEvent.Builder( type )
|
return new LJ1200CallEvent.Builder( type )
|
||||||
.details( sbDetails.toString() )
|
.to( message.getAddress() )
|
||||||
|
.details( message.getMessage() )
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package decode.lj1200;
|
|||||||
import message.Message;
|
import message.Message;
|
||||||
import controller.state.AuxChannelState;
|
import controller.state.AuxChannelState;
|
||||||
import controller.state.ChannelState;
|
import controller.state.ChannelState;
|
||||||
import controller.state.ChannelState.State;
|
|
||||||
|
|
||||||
public class LJ1200ChannelState extends AuxChannelState
|
public class LJ1200ChannelState extends AuxChannelState
|
||||||
{
|
{
|
||||||
@@ -51,9 +50,8 @@ public class LJ1200ChannelState extends AuxChannelState
|
|||||||
{
|
{
|
||||||
mActivitySummary.receive( message );
|
mActivitySummary.receive( message );
|
||||||
|
|
||||||
/* Set the state to CALL on the parent channel state, so that the
|
mParentChannelState.receiveCallEvent(
|
||||||
* parent state timer can track turning off any updates we apply */
|
LJ1200CallEvent.getLJ1200Event( (LJ1200Message)message ) );
|
||||||
mParentChannelState.setState( State.CALL );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,15 +33,16 @@ public class LJ1200Message extends Message
|
|||||||
{
|
{
|
||||||
public static int[] SYNC = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 };
|
public static int[] SYNC = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 };
|
||||||
|
|
||||||
public static int[] MESSAGE = { 16,17,18,19,20,21,22,23,
|
public static int[] VRC = { 16,17,18,19,20,21,22,23 };
|
||||||
24,25,26,27,28,29,30,31,
|
|
||||||
32,33,34,35,36,37,38,39,
|
|
||||||
40,41,42,43,44,45,46,47,
|
|
||||||
48,49,50,51,52,53,54,55,
|
|
||||||
56,57,58,59,60,61,62,63 };
|
|
||||||
|
|
||||||
public static int[] CRC = { 64,65,66,67,68,69,70,71,
|
public static int[] LRC = { 24,25,26,27,28,29,30,31 };
|
||||||
72,73,74,75,76,77,78,79 };
|
|
||||||
|
public static int[] FUNCTION = { 32,33,34,35 };
|
||||||
|
|
||||||
|
public static int[] ADDRESS = { 36,37,38,39,40,41,42,43,44,45,46,47,
|
||||||
|
48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63 };
|
||||||
|
|
||||||
|
public static int[] CRC = { 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79 };
|
||||||
|
|
||||||
private static SimpleDateFormat mSDF = new SimpleDateFormat( "yyyyMMdd HHmmss" );
|
private static SimpleDateFormat mSDF = new SimpleDateFormat( "yyyyMMdd HHmmss" );
|
||||||
|
|
||||||
@@ -90,16 +91,34 @@ public class LJ1200Message extends Message
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getVRC()
|
||||||
|
{
|
||||||
|
return mMessage.getInt( VRC );
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLRC()
|
||||||
|
{
|
||||||
|
return mMessage.getInt( LRC );
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFunction()
|
||||||
|
{
|
||||||
|
return mMessage.getInt( FUNCTION );
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress()
|
||||||
|
{
|
||||||
|
return mMessage.getHex( ADDRESS, 7 );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
sb.append( mSDF.format( new Date( System.currentTimeMillis() ) ) );
|
sb.append( "VRC: " + getVRC() );
|
||||||
|
sb.append( " LRC: " + getLRC() );
|
||||||
sb.append( " LJ1200 [" );
|
sb.append( " FUNCTION: " + getFunction() );
|
||||||
sb.append( mMessage.toString() );
|
|
||||||
sb.append( "]" );
|
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
@@ -149,7 +168,7 @@ public class LJ1200Message extends Message
|
|||||||
@Override
|
@Override
|
||||||
public String getProtocol()
|
public String getProtocol()
|
||||||
{
|
{
|
||||||
return "LJ 1200";
|
return "LJ-1200";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -173,7 +192,7 @@ public class LJ1200Message extends Message
|
|||||||
@Override
|
@Override
|
||||||
public String getToID()
|
public String getToID()
|
||||||
{
|
{
|
||||||
return null;
|
return getAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user