All Downloads are FREE. Search and download functionalities are using the official Maven repository.

t.21.120.2.source-code.NmeaSentenceMesg Maven / Gradle / Ivy

There is a newer version: 21.141.0
Show newest version
/////////////////////////////////////////////////////////////////////////////////////////////
// Copyright 2023 Garmin International, Inc.
// Licensed under the Flexible and Interoperable Data Transfer (FIT) Protocol License; you
// may not use this file except in compliance with the Flexible and Interoperable Data
// Transfer (FIT) Protocol License.
/////////////////////////////////////////////////////////////////////////////////////////////
// ****WARNING****  This file is auto-generated!  Do NOT edit this file.
// Profile Version = 21.120Release
// Tag = production/release/21.120.00-0-g2d77811
/////////////////////////////////////////////////////////////////////////////////////////////


package com.garmin.fit;



public class NmeaSentenceMesg extends Mesg   {

    
    public static final int TimestampFieldNum = 253;
    
    public static final int TimestampMsFieldNum = 0;
    
    public static final int SentenceFieldNum = 1;
    

    protected static final  Mesg nmeaSentenceMesg;
    static {
        // nmea_sentence
        nmeaSentenceMesg = new Mesg("nmea_sentence", MesgNum.NMEA_SENTENCE);
        nmeaSentenceMesg.addField(new Field("timestamp", TimestampFieldNum, 134, 1, 0, "s", false, Profile.Type.DATE_TIME));
        
        nmeaSentenceMesg.addField(new Field("timestamp_ms", TimestampMsFieldNum, 132, 1, 0, "ms", false, Profile.Type.UINT16));
        
        nmeaSentenceMesg.addField(new Field("sentence", SentenceFieldNum, 7, 1, 0, "", false, Profile.Type.STRING));
        
    }

    public NmeaSentenceMesg() {
        super(Factory.createMesg(MesgNum.NMEA_SENTENCE));
    }

    public NmeaSentenceMesg(final Mesg mesg) {
        super(mesg);
    }


    /**
     * Get timestamp field
     * Units: s
     * Comment: Timestamp message was output
     *
     * @return timestamp
     */
    public DateTime getTimestamp() {
        return timestampToDateTime(getFieldLongValue(253, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD));
    }

    /**
     * Set timestamp field
     * Units: s
     * Comment: Timestamp message was output
     *
     * @param timestamp The new timestamp value to be set
     */
    public void setTimestamp(DateTime timestamp) {
        setFieldValue(253, 0, timestamp.getTimestamp(), Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get timestamp_ms field
     * Units: ms
     * Comment: Fractional part of timestamp, added to timestamp
     *
     * @return timestamp_ms
     */
    public Integer getTimestampMs() {
        return getFieldIntegerValue(0, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set timestamp_ms field
     * Units: ms
     * Comment: Fractional part of timestamp, added to timestamp
     *
     * @param timestampMs The new timestampMs value to be set
     */
    public void setTimestampMs(Integer timestampMs) {
        setFieldValue(0, 0, timestampMs, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get sentence field
     * Comment: NMEA sentence
     *
     * @return sentence
     */
    public String getSentence() {
        return getFieldStringValue(1, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set sentence field
     * Comment: NMEA sentence
     *
     * @param sentence The new sentence value to be set
     */
    public void setSentence(String sentence) {
        setFieldValue(1, 0, sentence, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy