-- *****************************************************************
-- WESTERMO-SW6-GNSS-MIB :
-- SNMP feature configuration of WESTERMO devices with SW6.
--
-- Copyright (c) 2020 by Westermo Network Technologies AB
-- All rights reserved.
-- *****************************************************************

-- *****************************************************************
-- This script has been tested using the SMI checker smilint
-- the tool can be downloaded at
-- http://www.ibr.cs.tu-bs.de/projects/libsmi/smilint.html
-- or use alternatively the online version at:
-- http://www.simpleweb.org/ietf/mibs/validate/
--
-- smilint -m -s -l 6 -i nameLength-32 ./WESTERMO-SW6-GNSS-MIB
-- Ensure that all needed MIBS are located in the SMIPATH.
-- *****************************************************************

-- **********************************************************************
-- * GNSS MIB
-- **********************************************************************

WESTERMO-SW6-GNSS-MIB DEFINITIONS ::= BEGIN

    IMPORTS
        MODULE-IDENTITY, OBJECT-TYPE           FROM SNMPv2-SMI
        Integer32                              FROM SNMPv2-SMI
        DisplayString                          FROM SNMPv2-TC
        MODULE-COMPLIANCE, OBJECT-GROUP        FROM SNMPv2-CONF
    ;

-- **********************************************************************
-- *  MODULE IDENTITY
-- **********************************************************************
gnss MODULE-IDENTITY
    LAST-UPDATED "202510160000Z"

    ORGANIZATION "Westermo Network Technologies AB"
    CONTACT-INFO "E-mail: info@westermo.com"
    DESCRIPTION  "MIB Module for the Westermo RT-300 Radio Modem Device - GNSS definitions"

    REVISION     "202510160000Z"
    DESCRIPTION  "Release 6.11.6-0"

    ::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1)
          westermo(16177) products(1) rt(400) feature(2) 10 }

-- *********************************************************************
-- *  Begin Major sections
-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

--  Configuration
--  =============

    configuration         OBJECT IDENTIFIER ::= { gnss 1 }
     cfgGnss              OBJECT IDENTIFIER ::= { configuration 1 }
      cfgGnssGpsd         OBJECT IDENTIFIER ::= { cfgGnss 1 }


--  Software
--  ========

    software              OBJECT IDENTIFIER ::= { gnss 2 }
     swGnss               OBJECT IDENTIFIER ::= { software 1 }

--  Conformance Information
--  =======================

    conformance           OBJECT IDENTIFIER ::= { gnss 10000 }
     groups               OBJECT IDENTIFIER ::= { conformance 1 }
      groupConfiguration  OBJECT IDENTIFIER ::= { groups 1 }
      groupSoftware       OBJECT IDENTIFIER ::= { groups 2 }

     compliances          OBJECT IDENTIFIER ::= { conformance 2 }

-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-- *  End Major Sections
-- *********************************************************************


-- *********************************************************************
-- *  Begin Object Types
-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    cfgGnssGpsdEnabled OBJECT-TYPE
        SYNTAX INTEGER { disabled(0), enabled(1) }
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "GPS Service Daemon Disabled or Enabled

            If the GPS service daemon `gpsd` is **enabled(1)**, it makes
            location data available through TCP/IP.

             Applies to cellular products only."
        ::= { cfgGnssGpsd 1 }

    cfgGnssGpsdAddress OBJECT-TYPE
        SYNTAX DisplayString (SIZE(1..255))
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "Bind Address

             The `gpsd` can only bind to the localhost or to all addresses.
             This means, that it will listen to all addresses, when this
             address is set to a value other than `127.0.0.1:<port>`.

             The default bind address is `0.0.0.0:2947`.

             **Examples:**

             * **0.0.0.0:2947**
             * **127.0.0.1:1234**

             Applies to cellular products only."
        ::= { cfgGnssGpsd 2 }

    cfgGnssDevice OBJECT IDENTIFIER ::= { cfgGnss 2 }

    cfgGnssDevSatelliteSystems OBJECT-TYPE
        SYNTAX INTEGER { gps(1), glonass(2), gpsGlo(3), beidou(4), gpsBei(5),
                         gloBei(6), galileo(8), gpsGal(9), gloGal(10),
                         gpsGloGal(11), beiGal(12), gpsBeiGal(13) }
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "Satellite Systems

             This entry allows the selection of different satellite systems,
             whereby the following combinations are possible:

             * **gps(1)**: GPS
             * **glonass(2)**: Glonass
             * **gpsGlo(3)**: GPS and Glonass
             * **beidou(4)**: BeiDou
             * **gpsBei(5)**: GPS and BeiDou
             * **gloBei(6)**: Glonass and BeiDou
             * **galileo(8)**: Galileo
             * **gpsGal(9)**: GPS and Galileo
             * **gloGal(10)**: Glonass and Galileo
             * **gpsGloGal(11)**: GPS, Glonass and Galileo
             * **beiGal(12)**: BeiDou and Galileo
             * **gpsBeiGal(13)**: GPS, BeiDou and Glonass

             This entry can also be interpreted as bitmask, with each bit
             reflecting a satellite system as follows:

             * Bit 1: GPS
             * Bit 2: Glonass
             * Bit 3: BeiDou
             * Bit 4: Galileo

             However, only the combinations of the enumeration defined above
             are valid.

             Applies to cellular products only."
        ::= { cfgGnssDevice 1 }

    cfgGnssDevMeasurementPeriod OBJECT-TYPE
        SYNTAX Integer32
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "Measurement Period

             The measurement period *T* defines the time interval in
             milliseconds between two consecutive localisations. The minimal
             time is limited to 40 ms (25 Hz). Please refer to the User Guide
             for the maximum measuring rate supported by the device.

             The sampling rate *f* is calculated as follows:

             f = 1000 / T

             **Examples:**

             * **10000**: f = 0.1 Hz
             * **1000**: f = 1 Hz
             * **100**: f = 10 Hz

             Applies to cellular products only."
        ::= { cfgGnssDevice 2 }

    cfgGnssDevMessages OBJECT IDENTIFIER ::= { cfgGnssDevice 3 }

    cfgGnssDevMsgsNmeaTable OBJECT-TYPE
        SYNTAX SEQUENCE OF CfgGnssDevMsgsNmeaTableSeq
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "NMEA Sentences

             The National Marine Electronics Association (NMEA) defined in the
             NMEA-0183 standard how data are transmitted in a sentences from one
             talker to multiple listeners.

             Applies to cellular products only."
        ::= { cfgGnssDevMessages 1 }

    cfgGnssDevMsgsNmeaTableEntry OBJECT-TYPE
        SYNTAX CfgGnssDevMsgsNmeaTableSeq
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "NMEA Sentence

             Applies to cellular products only."
        INDEX { cfgGnssDevMsgsNmeaTableIndex }
        ::= { cfgGnssDevMsgsNmeaTable 1 }

    CfgGnssDevMsgsNmeaTableSeq ::=
    SEQUENCE {  cfgGnssDevMsgsNmeaTableIndex Integer32,
                cfgGnssDevMsgsNmeaType Integer32,
                cfgGnssDevMsgsNmeaRate Integer32,
                cfgGnssDevMsgsNmeaEnabled INTEGER
             }

    cfgGnssDevMsgsNmeaTableIndex OBJECT-TYPE
        SYNTAX Integer32 (0..12)
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "Table Entry Index"
        ::= { cfgGnssDevMsgsNmeaTableEntry 1 }

    cfgGnssDevMsgsNmeaType OBJECT-TYPE
        SYNTAX Integer32
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "NMEA Sentence Type

             The following NMEA sentence types are supported:

             * GxGGA (61440)
             * GxGLL (61441)
             * GxGSA (61442)
             * GxGSV (61443)
             * GxRMC (61444)
             * GxVTG (61445)
             * GxGRS (61446)
             * GxGST (61447)
             * GxZDA (61448)
             * GxGBS (61449)
             * GxDTM (61450)
             * GxGNS (61453)
             * GxVLW (61455)

             Applies to cellular products only."
        ::= { cfgGnssDevMsgsNmeaTableEntry 2 }

    cfgGnssDevMsgsNmeaRate OBJECT-TYPE
        SYNTAX Integer32
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "Sentence Rate

             The sentence rate *r* multiples the measurement period *T*
             specified in `cfgGnssDevMeasurementPeriod` for the corresponding
             NMEA sentence type. It allows to define individual sampling rates
             for each sentence type or disabling the them by setting their rate
             to 0.

             The individual sampling rate *f* is calculated as follows:

             f = 1000 / (r * T)

             **Examples:**

             * **1** (T = 1000 ms): f = 1 Hz
             * **2** (T = 1000 ms): f = 0.5 Hz
             * **5** (T = 100 ms): f = 2 Hz

             Applies to cellular products only."
        ::= { cfgGnssDevMsgsNmeaTableEntry 3 }

    cfgGnssDevMsgsNmeaEnabled OBJECT-TYPE
        SYNTAX INTEGER { disabled(0), enabled(1) }
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "Enable or Disable NMEA Sentences

             Applies to cellular products only."
        ::= { cfgGnssDevMsgsNmeaTableEntry 4 }

    cfgGnssDevMsgsUbxTable OBJECT-TYPE
        SYNTAX SEQUENCE OF CfgGnssDevMsgsUbxTableSeq
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "UBX Messages

             UBX is a proprietary protocol from the company u-blox for
             exchanging GNSS data.

             Applies to cellular products only."
        ::= { cfgGnssDevMessages 2 }

    cfgGnssDevMsgsUbxTableEntry OBJECT-TYPE
        SYNTAX CfgGnssDevMsgsUbxTableSeq
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "UBX Message

             Applies to cellular products only."
        INDEX { cfgGnssDevMsgsUbxTableIndex }
        ::= { cfgGnssDevMsgsUbxTable 1 }

    CfgGnssDevMsgsUbxTableSeq ::=
    SEQUENCE {  cfgGnssDevMsgsUbxTableIndex Integer32,
                cfgGnssDevMsgsUbxType Integer32,
                cfgGnssDevMsgsUbxRate Integer32,
                cfgGnssDevMsgsUbxEnabled INTEGER
             }

    cfgGnssDevMsgsUbxTableIndex OBJECT-TYPE
        SYNTAX Integer32 (0..127)
        MAX-ACCESS not-accessible
        STATUS     current
        DESCRIPTION
            "Table Entry Index"
        ::= { cfgGnssDevMsgsUbxTableEntry 1 }

    cfgGnssDevMsgsUbxType OBJECT-TYPE
        SYNTAX Integer32 (0..65535)
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "UBX Message Type

             The following UBX message types are supported:

             * NAV-POSECEF (257)
             * NAV-STATUS (259)
             * NAV-PVT (263)
             * NAV-VELECEF(273)
             * NAV-TIMEUTC (289)
             * NAV-SAT (309)

             Applies to cellular products only."
        ::= { cfgGnssDevMsgsUbxTableEntry 2 }

    cfgGnssDevMsgsUbxRate OBJECT-TYPE
        SYNTAX Integer32
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "Message Rate

             The message rate *r* multiples the measurement period *T*
             specified in `cfgGnssDevMeasurementPeriod` for the corresponding
             UBX message type. It allows to define individual sampling rates
             for each message type or disabling the them by setting their rate
             to 0.

             The individual sampling rate *f* is calculated as follows:

             f = 1000 / (r * T)

             **Examples:**

             * **1** (T = 1000 ms): f = 1 Hz
             * **2** (T = 1000 ms): f = 0.5 Hz
             * **5** (T = 100 ms): f = 2 Hz

             Applies to cellular products only."
        ::= { cfgGnssDevMsgsUbxTableEntry 3 }

    cfgGnssDevMsgsUbxEnabled OBJECT-TYPE
        SYNTAX INTEGER { disabled(0), enabled(1) }
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "Enable or Disable UBX Messages

             Applies to cellular products only."
        ::= { cfgGnssDevMsgsUbxTableEntry 4 }

    cfgGnssDevDebugEnabled OBJECT-TYPE
        SYNTAX INTEGER { disabled(0), enabled(1) }
        MAX-ACCESS read-write
        STATUS     current
        DESCRIPTION
            "Disable or Enable Debug Messages

             Applies to cellular products only."
        ::= { cfgGnssDevice 4 }

-- *********************************************************************
-- *  Software
-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

     swGnssTime OBJECT-TYPE
        SYNTAX DisplayString (SIZE(1..255))
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "GNSS Time

             The time is given in the Coordinated Universal Time (UTC)
             according to the ISO 8601 standard.

             **Example:**

             * 2020-06-19T10:55:50.000Z

             Applies to cellular products only."
        ::= { swGnss 1 }

     swGnssMode OBJECT-TYPE
        SYNTAX INTEGER { na(0), none(1), twoD(2), threeD(3) }
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "GNSS Navigation Mode

             Possible navigation modes are:

             * **na(0)**: Not available
             * **none(1)**: None
             * **twoD(2)**: 2D
             * **threeD(3)**: 3D

             Applies to cellular products only."
        ::= { swGnss 2 }

     swGnssLon OBJECT-TYPE
        SYNTAX DisplayString (SIZE(1..255))
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "GNSS Longitude

             Longitude of the current location in decimal degrees (DD).

             **Example:**

             * 8.825446333

             Applies to cellular products only."
        ::= { swGnss 3 }

     swGnssLat OBJECT-TYPE
        SYNTAX DisplayString (SIZE(1..255))
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "GNSS Latitude

             Latitude  of the current location in decimal degrees (DD).

             * 47.268953167

             Applies to cellular products only."
        ::= { swGnss 4 }

     swGnssAlt OBJECT-TYPE
        SYNTAX DisplayString (SIZE(1..255))
        MAX-ACCESS read-only
        STATUS     current
        DESCRIPTION
            "GNSS Altitude

             Altitude of the current location in meters.

             Applies to cellular products only."
        ::= { swGnss 5 }


-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-- *  End of   Object Types
-- *********************************************************************

-- *********************************************************************
-- *  Begin GROUPS
-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    groupCfgGnss OBJECT IDENTIFIER ::= { groupConfiguration 1 }

    groupCfgGnssGpsd OBJECT-GROUP
        OBJECTS {
        cfgGnssGpsdEnabled,
        cfgGnssGpsdAddress
        }
        STATUS  current
        DESCRIPTION
           "GNSS gpsd properties"
        ::= { groupCfgGnss 1 }

    groupCfgGnssDevice OBJECT-GROUP
        OBJECTS {
        cfgGnssDevSatelliteSystems,
        cfgGnssDevMeasurementPeriod,
        cfgGnssDevMsgsNmeaType,
        cfgGnssDevMsgsNmeaRate,
        cfgGnssDevMsgsNmeaEnabled,
        cfgGnssDevMsgsUbxType,
        cfgGnssDevMsgsUbxRate,
        cfgGnssDevMsgsUbxEnabled,
        cfgGnssDevDebugEnabled
        }
        STATUS  current
        DESCRIPTION
           "GNSS device properties"
        ::= { groupCfgGnss 2 }

    groupSwGnss OBJECT-GROUP
        OBJECTS {
            swGnssTime,
            swGnssMode,
            swGnssLon,
            swGnssLat,
            swGnssAlt
            }
        STATUS  current
        DESCRIPTION
            "GNSS Status Information"
        ::= { groupSoftware 1 }

-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-- *  End GROUPS
-- *********************************************************************

-- *********************************************************************
-- *  Begin COMPLIANCE STATEMENTS
-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    compliance MODULE-COMPLIANCE
    STATUS current
    DESCRIPTION
        "Implementation Requirements for DT50 bindings"
    MODULE  -- this module
        MANDATORY-GROUPS {
            groupCfgGnss,
            groupCfgGnssGpsd,
            groupCfgGnssDevice,
            groupSwGnss
        }
    ::= { compliances 1 }

-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-- *  End COMPLIANCE STATEMENTS
-- *********************************************************************

-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-- *  End of MIB DEFINITION
-- *********************************************************************
END


-- *********************************************************************
-- *********************************************************************
