This plugin depends on the (included) NMEA parsing library that can be found at:

	https://github.com/AHR-Project/nmealib

See the document doc/pud.odt for a detailed specification of the module.

LoadPlugin "<olsrd plugin library path>/olsrd_pud.so.3.0.0"
{
    # nodeId contains the node identification. It first describes the semantics
    #        (meaning/code) of the identification and then specifies the node
    #        identification itself.
    #        For some codes the identification itself is not relevant and
    #        therefore ignored (specified if so).
    #
    #        The format is "number,identification"
    #
    #        "Number" is a number in the range 0-255, with the following
    #        meaning:
    #           0 : MAC address of sending interface
    #               (identification is not relevant)
    #           1 : an MSISDN number with 15 digits
    #           2 : a Tetra number with 17 digits
    #           3 : a DNS name
    #               (identification can be empty, in which case the hostname is
    #                used)
    #           4 : IPv4 address (OLSR main address) of the sending node
    #               (identification is not relevant)
    #           5 : an UUID number with 32 hexadecimal digits
    #           6 : IPv6 address (OLSR main address) of the sending node
    #               (identification is not relevant)
    #           7 : an AIS MMSI number with 9 digits
    #           8 : a URN number (a plain 24 bits number) with 8 digits. See
    #               http://www.dtic.mil/cjcs_directives/cdata/unlimit/3156_01.pdf
    #           9 : a MIP OID number with 20 digits. See
    #               http://www.mip-site.org/publicsite (IR Annex D – DMWG,
    #               20081211, Edition 3.7, Annex D Key Management for the MIP
    #               Data Model, (MIR Annex D - Key Management-JC3IEDM-3.0.9.pdf)
    #         192 : a 7 digit number conforming to 'Nationaal Nummerplan
    #               Brandweer Nederland'
    #         193 : a 6 digit number conforming to 'Nationaal Nummerplan
    #               Ambulancezorg Nederland'
    #         194 : a 4 digit number in the range [1, 8191]
    #
    #         other numbers are reserved
    #
    # Note: setting "number" to 4 or 6 is the same for olsrd: both mean 'use
    #       the main IP address, which is either an IPv4 or an IPv6 address,
    #       depending on the IP version under which olsrd is run.
    #
    # Note: Both the number and the identification are transported over OLSR,
    #       so care must be taken to keep the size of the identification down.
    #
    # Default: "4" (when olsrd is run under IPv4)
    #          "6" (when olsrd is run under IPv6)
    #
    # PlParam     "nodeId"                       "4"


    #
    # gpsd Parameters
    #

    # gpsdUse determines whether the gpsd daemon should be used for position
    #         information
    #
    # Default: true
    #
    # PlParam     "gpsdUse"                      "true"

    # gpsd is the gpsd source spec of the gpsd daemon to connect to
    #
    # Default: localhost:2947
    #
    # PlParam     "gpsd"                         "localhost:2947"


    #
    # Position Input File Parameters
    #

    # positionFile is the file that contains the position information that the
    #              plugin should use. When this parameter is set then the
    #              file is read during olsrd startup. An example file is
    #              available in the doc directory of olsrd.
    #
    # Default: none
    #
    # PlParam     "positionFile"                 ""

    # Specifies the period in milliseconds on which to read the positionFile
    # (if it changed) and activate its new setting for the position.
    # This setting is only relevant if positionFile has been configured.
    # A setting of zero disables dynamic updates, the positionFile is then only
    # read during olsrd startup.
    #
    # Default: 0
    #
    # PlParam     "positionFilePeriod" "0"


    #
    # TX Parameters
    #

    # txNonOlsrIf is a network interface on the host on which the plugin will
    #             transmit GPS multicasts that were received through the OLSR
    #             network. Multiple such interfaces can be specified by
    #             specifying the parameter multiple times.
    #
    # Default: none
    #
    # PlParam     "txNonOlsrIf"                  ""

    # txMcAddr is the multicast address on which the plugin will transmit GPS
    #          multicasts that were received through the OLSR network.
    #
    # Default: 224.0.0.224 (IPv4) or FF02:0:0:0:0:0:0:1 (IPv6)
    #
    # PlParam     "txMcAddr"                     "224.0.0.224"

    # txMcPort is the UDP port on which the plugin will transmit GPS multicasts
    #          that were received through the OLSR network.
    #
    # Default: 2240
    #
    # PlParam     "txMcPort"                     "2240"

    # txTtl is the TTL that is used when transmitting GPS multicasts that were
    #       received through the OLSR network
    #
    # Default: 1
    #
    # PlParam     "txTtl"                        "1"

    # txNmeaMessagePrefix is the NMEA message prefix of GPS multicasts that the
    #                     plugin transmits. It must be exactly 4 characters
    #                     long.
    #
    # Default: NBSX
    #
    # PlParam     "txNmeaMessagePrefix"          "NBSX"


    #
    # Position Output File Parameters
    #

    # positionOutputFile is the file into which the position is written when it
    #                    changes. The file will contain all position parameters
    #                    in a bash compatible format. The file will be removed
    #                    when olsrd stops.
    #
    # Default: none
    #
    # PlParam     "positionOutputFile"           ""


    #
    # Uplink Parameters
    #

    # uplinkAddr is the IP address to which the plugin will transmit GPS
    #            position updates. When not set, no uplink messages will be
    #            sent.
    #
    # Default: none
    #
    # PlParam     "uplinkAddr"                   ""

    # uplinkPort is the UDP port to which the plugin will transmit GPS position
    #            updates. Can't be the same as the downlink port.
    #
    # Default: 2241
    #
    # PlParam     "uplinkPort"                   "2241"

    # downlinkPort is the UDP port on which the plugin will receive GPS position
    #              updates. Can't be the same as the uplink port.
    #              The downlink is only active when a proper uplink has been
    #              configured.
    #
    # Default: 2242
    #
    # PlParam     "downlinkPort"                 "2242"


    #
    # OLSR Parameters
    #

    # olsrTtl is the TTL that is used when sending messages over the OLSR
    #         networks. Setting this to 0 (zero) will disable distribution
    #         of position updates over the OLSR networks.
    #
    # Default: 64
    #
    # PlParam     "olsrTtl"                      "64"


    #
    # Update Parameters
    #

    # updateIntervalStationary is the interval (in seconds) between position
    #                          updates sent over the OLSR network when the
    #                          node is stationary
    #
    # Default: 60
    #
    # PlParam     "updateIntervalStationary"     "60"

    # updateIntervalMoving is the interval (in seconds) between position
    #                      updates sent over the OLSR network when the
    #                      node is moving
    #
    # Default: 5
    #
    # PlParam     "updateIntervalMoving"         "5"

    # uplinkUpdateIntervalStationary is the interval (in seconds) between
    #                                position updates sent over the uplink when
    #                                the node is stationary
    #
    # Default: 180
    #
    # PlParam     "uplinkUpdateIntervalStationary" "180"

    # uplinkUpdateIntervalMoving is the interval (in seconds) between position
    #                            updates sent over the OLSR network when the
    #                            node is moving
    #
    # Default: 15
    #
    # PlParam     "uplinkUpdateIntervalMoving"   "15"

    # gatewayDeterminationInterval is the interval (in seconds) on which
    #                              determination of the best gateway is
    #                              performed
    #
    # Default: 1
    #
    # PlParam     "gatewayDeterminationInterval" "1"

    # movingSpeedThreshold is the speed from which we consider the node is
    #                      moving
    #
    # Default: 9
    #
    # PlParam     "movingSpeedThreshold"         "9"

    # movingDistanceThreshold is the distance from the previous position from
    #                         which we consider the node is moving
    #
    # Default: 50
    #
    # PlParam     "movingDistanceThreshold"      "50"

    # dopMultiplier One of the situations that is seen as movement is when the
    #               current position with its uncertainty circle no longer
    #               overlaps the last transmitted position with its uncertainty
    #               circle. This parameter is used to adjust the sizes of these
    #               uncertainty circles: setting it to a value less than 1.0
    #               will make both uncertainty circles smaller by this factor,
    #               resulting in earlier movement detection. Setting it to a
    #               value larger than 1.0 will detect movement later.
    #
    # Default: 2.5
    #
    # PlParam     "dopMultiplier"                "2.5"

    # defaultHdop is the default value that is taken for HDOP (in meters) in
    #             determining whether we are moving when there is a position
    #             available but no HDOP.
    #
    # Default: 50
    #
    # PlParam     "defaultHdop"                  "50"

    # defaultVdop is the default value that is taken for VDOP (in meters) in
    #             determining whether we are moving when there is a position
    #             available but no VDOP.
    #
    # Default: 50
    #
    # PlParam     "defaultVdop"                  "50"

    # averageDepth is the depth of the position average list, or the number
    #              of positions that are averaged to obtain the average
    #              position
    #
    # Default: 5
    #
    # PlParam     "averageDepth"                 "5"

    # hysteresisCountToStationary is the number of position updates that
    #                             effectuate a state transition from moving to
    #                             stationary that must be received before the
    #                             actual transition is taken
    #
    # Default: 17
    #
    # PlParam     "hysteresisCountToStationary"  "17"

    # hysteresisCountToMoving is the number of position updates that effectuate
    #                         a state transition from stationary to moving that
    #                         must be received before the actual transition is
    #                         taken
    #
    # Default: 5
    #
    # PlParam     "hysteresisCountToMoving"      "5"

    # gatewayHysteresisCountToStationary is the number of times the gateway
    #                             must be the same that effectuate a state transition from
    #                             moving to stationary that must be received
    #                             before the actual transition is taken
    #
    # Default: 17
    #
    # PlParam     "gatewayHysteresisCountToStationary" "17"

    # gatewayHysteresisCountToMoving is the number of gateway updates that
    #                         effectuate a state transition from stationary to
    #                         moving that must be received before the actual
    #                         transition is taken
    #
    # Default: 5
    #
    # PlParam     "gatewayHysteresisCountToMoving" "5"


    #
    # Other Plugin Parameters
    #

    # useDeDup determines whether duplicate message detection is to be
    #          performed. When 0 then no such detection is performed, when 1
    #          then the detection is performed 
    #
    # Default: true
    #
    # PlParam     "useDeDup"                     "true"

    # deDupDepth the number of messages that are tracked to detect duplucates
    #            messages received from the OLSR network
    #
    # Default: 256
    #
    # PlParam     "deDupDepth"                   "256"

    # useLoopback determines whether the message that is sent over the OLSR
    #             network should be immediately looped back, thus pretending
    #             that the message (that is sent by this node) is received from
    #             the OLSR network. When 0 then no loopback is performed, when
    #             1 then the loopback is performed
    #
    # Default: false
    #
    # PlParam     "useLoopback"                  "true"
}



===================
Postion Output File
===================

+---------------------------------+--------------------------+------------------------------+-------------------------+
| Parameter                       | Type                     | Unit                         | Range / Values          |
+---------------------------------+--------------------------+------------------------------+-------------------------+
| OLSRD_PUD_NODE_ID               | string                   | -                            | -                       |
+---------------------------------+--------------------------+------------------------------+-------------------------+
| OLSRD_PUD_SIGNAL                | string                   | -                            | INVALID                 |
|                                 |                          |                              | FIX                     |
|                                 |                          |                              | DIFFERENTIAL            |
|                                 |                          |                              | SENSITIVE               |
|                                 |                          |                              | REALTIME                |
|                                 |                          |                              | FLOAT                   |
|                                 |                          |                              | ESTIMATED               |
|                                 |                          |                              | MANUAL                  |
|                                 |                          |                              | SIMULATED               |
|                                 |                          |                              | <integer number>        |
+---------------------------------+--------------------------+------------------------------+-------------------------+
| OLSRD_PUD_FIX                   | string                   | -                            | NONE                    |
|                                 |                          |                              | 2D                      |
|                                 |                          |                              | 3D                      |
|                                 |                          |                              | <integer number>        |
+---------------------------------+--------------------------+------------------------------+-------------------------+
| OLSRD_PUD_YEAR                  | integer number           | year                         | [    1900,         inf) |
| OLSRD_PUD_MONTH                 | integer number           | month                        | [       1,          12] |
| OLSRD_PUD_DAY                   | integer number           | day                          | [       1,          31] |
| OLSRD_PUD_HOUR                  | integer number           | hour                         | [       0,          23] |
| OLSRD_PUD_MINUTE                | integer number           | minute                       | [       0,          59] |
| OLSRD_PUD_SECONDS               | integer number           | second                       | [       0,          60] |
| OLSRD_PUD_MILLISECONDS          | integer number           | millisecond                  | [       0,         999] |
| OLSRD_PUD_PDOP                  | floating point number    | -                            | [     0.0,         inf) |
| OLSRD_PUD_HDOP                  | floating point number    | -                            | [     0.0,         inf) |
| OLSRD_PUD_VDOP                  | floating point number    | -                            | [     0.0,         inf) |
| OLSRD_PUD_LATTITUDE             | floating point number    | NDEG: [degree][min].[sec/60] | [ -9000.0,      9000.0] |
| OLSRD_PUD_LONGITUDE             | floating point number    | NDEG: [degree][min].[sec/60] | [-18000.0,     18000.0] |
| OLSRD_PUD_ELEVATION             | floating point number    | meter (geoid)                | [ -6371.0,         inf) |
| OLSRD_PUD_SPEED                 | floating point number    | km/h                         | [     0.0,         inf) |
| OLSRD_PUD_TRACK                 | floating point number    | decimal degrees              | [     0.0,       360.0) |
| OLSRD_PUD_MAGNETIC_TRACK        | floating point number    | decimal degrees              | [     0.0,       360.0) |
| OLSRD_PUD_MAGNETIC_VARIATION    | floating point number    | decimal degrees              | [     0.0,       360.0) |
+---------------------------------+--------------------------+------------------------------+-------------------------+


+---------+
| Example |
+---------+
OLSRD_PUD_NODE_ID="example.node.id"
OLSRD_PUD_SIGNAL=DIFFERENTIAL
OLSRD_PUD_FIX=3D
OLSRD_PUD_YEAR=2016
OLSRD_PUD_MONTH=06
OLSRD_PUD_DAY=02
OLSRD_PUD_HOUR=13
OLSRD_PUD_MINUTE=56
OLSRD_PUD_SECONDS=25
OLSRD_PUD_MILLISECONDS=000
OLSRD_PUD_PDOP=132.000000
OLSRD_PUD_HDOP=6.000000
OLSRD_PUD_VDOP=88.500000
OLSRD_PUD_LATTITUDE=-12.147138
OLSRD_PUD_LONGITUDE=-5.346317
OLSRD_PUD_ELEVATION=47.840000
OLSRD_PUD_SPEED=0.825251
OLSRD_PUD_TRACK=133.816000
OLSRD_PUD_MAGNETIC_TRACK=0.000000
OLSRD_PUD_MAGNETIC_VARIATION=0.000000
