Methods Summary |
---|
public int | describeContents()
return 0;
|
public byte[] | getData()Gets the data associated with the Navigation Message.
The bytes (or words) specified using big endian format (MSB first).
return mData;
|
public short | getMessageId()Gets the Message Identifier.
It provides an index so the complete Navigation Message can be assembled. i.e. for L1 C/A
subframe 4 and 5, this value corresponds to the 'frame id' of the navigation message.
Subframe 1, 2, 3 does not contain a 'frame id' and this might be reported as -1.
return mMessageId;
|
public byte | getPrn()Gets the Pseudo-random number.
Range: [1, 32].
return mPrn;
|
public short | getSubmessageId()Gets the Sub-message Identifier.
If required by {@link #getType()}, this value contains a sub-index within the current message
(or frame) that is being transmitted. i.e. for L1 C/A the sub-message identifier corresponds
to the sub-frame Id of the navigation message.
return mSubmessageId;
|
public byte | getType()Gets the type of the navigation message contained in the object.
return mType;
|
private java.lang.String | getTypeString()Gets a string representation of the 'type'.
For internal and logging use only.
switch (mType) {
case TYPE_UNKNOWN:
return "Unknown";
case TYPE_L1CA:
return "L1 C/A";
case TYPE_L2CNAV:
return "L2-CNAV";
case TYPE_L5CNAV:
return "L5-CNAV";
case TYPE_CNAV2:
return "CNAV-2";
default:
return "<Invalid>";
}
|
private void | initialize()
mType = TYPE_UNKNOWN;
mPrn = 0;
mMessageId = -1;
mSubmessageId = -1;
mData = EMPTY_ARRAY;
|
public void | reset()Resets all the contents to its original state.
initialize();
|
public void | set(android.location.GpsNavigationMessage navigationMessage)Sets all contents to the values stored in the provided object.
mType = navigationMessage.mType;
mPrn = navigationMessage.mPrn;
mMessageId = navigationMessage.mMessageId;
mSubmessageId = navigationMessage.mSubmessageId;
mData = navigationMessage.mData;
|
public void | setData(byte[] value)Sets the data associated with the Navigation Message.
if (value == null) {
throw new InvalidParameterException("Data must be a non-null array");
}
mData = value;
|
public void | setMessageId(short value)Sets the Message Identifier.
mMessageId = value;
|
public void | setPrn(byte value)Sets the Pseud-random number.
mPrn = value;
|
public void | setSubmessageId(short value)Sets the Sub-message identifier.
mSubmessageId = value;
|
public void | setType(byte value)Sets the type of the navigation message.
switch (value) {
case TYPE_UNKNOWN:
case TYPE_L1CA:
case TYPE_L2CNAV:
case TYPE_L5CNAV:
case TYPE_CNAV2:
mType = value;
break;
default:
Log.d(TAG, "Sanitizing invalid 'type': " + value);
mType = TYPE_UNKNOWN;
break;
}
|
public java.lang.String | toString()
final String format = " %-15s = %s\n";
StringBuilder builder = new StringBuilder("GpsNavigationMessage:\n");
builder.append(String.format(format, "Type", getTypeString()));
builder.append(String.format(format, "Prn", mPrn));
builder.append(String.format(format, "MessageId", mMessageId));
builder.append(String.format(format, "SubmessageId", mSubmessageId));
builder.append(String.format(format, "Data", "{"));
String prefix = " ";
for(byte value : mData) {
builder.append(prefix);
builder.append(value);
prefix = ", ";
}
builder.append(" }");
return builder.toString();
|
public void | writeToParcel(android.os.Parcel parcel, int flags)
parcel.writeByte(mType);
parcel.writeByte(mPrn);
parcel.writeInt(mMessageId);
parcel.writeInt(mSubmessageId);
parcel.writeInt(mData.length);
parcel.writeByteArray(mData);
|