Example usage for android.location GnssNavigationMessage getSubmessageId

List of usage examples for android.location GnssNavigationMessage getSubmessageId

Introduction

In this page you can find the example usage for android.location GnssNavigationMessage getSubmessageId.

Prototype

public int getSubmessageId() 

Source Link

Document

Gets the sub-message identifier, relevant to the #getType() of the message.

Usage

From source file:com.google.android.apps.location.gps.gnsslogger.FileLogger.java

@Override
public void onGnssNavigationMessageReceived(GnssNavigationMessage navigationMessage) {
    synchronized (mFileLock) {
        if (mFileWriter == null) {
            return;
        }/*from w  w w  .j a v a2  s.  c  o m*/
        StringBuilder builder = new StringBuilder("Nav");
        builder.append(RECORD_DELIMITER);
        builder.append(navigationMessage.getSvid());
        builder.append(RECORD_DELIMITER);
        builder.append(navigationMessage.getType());
        builder.append(RECORD_DELIMITER);

        int status = navigationMessage.getStatus();
        builder.append(status);
        builder.append(RECORD_DELIMITER);
        builder.append(navigationMessage.getMessageId());
        builder.append(RECORD_DELIMITER);
        builder.append(navigationMessage.getSubmessageId());
        byte[] data = navigationMessage.getData();
        for (byte word : data) {
            builder.append(RECORD_DELIMITER);
            builder.append(word);
        }
        try {
            mFileWriter.write(builder.toString());
            mFileWriter.newLine();
        } catch (IOException e) {
            logException(ERROR_WRITING_FILE, e);
        }
    }
}