SubFrame45.java

  1. /* Copyright 2022-2025 Thales Alenia Space
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.gnss.rflink.gps;

  18. /**
  19.  * Base container for sub-frames 4 and 5.
  20.  * @author Luc Maisonobe
  21.  * @since 12.0
  22.  */
  23. public class SubFrame45 extends SubFrame {

  24.     /** Index of data ID field. */
  25.     private static final int DATA_ID = 7;

  26.     /** Index of SV ID field. */
  27.     private static final int SV_ID = 8;

  28.     /** Simple constructor.
  29.      * @param words raw words
  30.      * @param nbFields number of fields in the sub-frame
  31.      * (including TLM and HOW data fields, excluding non-information and parity)
  32.      */
  33.     SubFrame45(final int[] words, final int nbFields) {

  34.         // create raw container
  35.         super(words, nbFields);

  36.         // populate container
  37.         setField(DATA_ID, 3, 28, 2, words);
  38.         setField(SV_ID,   3, 22, 6, words);

  39.     }

  40.     /** Get data ID.
  41.      * @return data ID
  42.      */
  43.     public int getDataId() {
  44.         return getField(DATA_ID);
  45.     }

  46.     /** Get SV (page) ID.
  47.      * @return SV (page) ID
  48.      */
  49.     public int getSvId() {
  50.         return getField(SV_ID);
  51.     }

  52. }