# Copyright (C) 2015-2021 Swift Navigation Inc.
# Contact: https://support.swiftnav.com
#
# This source is subject to the license found in the file 'LICENSE' which must
# be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

package: swiftnav.sbp.logging
description: >
  Logging and debugging messages from the device.
stable: True
public: True
include:
  - types.yaml
definitions:

 - MSG_LOG:
    id: 0x0401
    short_desc: Plaintext logging messages with levels
    desc: >
      This message contains a human-readable payload string from the
      device containing errors, warnings and informational messages at
      ERROR, WARNING, DEBUG, INFO logging levels.
    fields:
      - level:
          type: u8
          desc: Logging level
          fields:
              - 3-7:
                    desc: Reserved
              - 0-2:
                    desc: Logging level
                    values:
                        - 0: EMERG
                        - 1: ALERT
                        - 2: CRIT
                        - 3: ERROR
                        - 4: WARN
                        - 5: NOTICE
                        - 6: INFO
                        - 7: DEBUG
      - text:
          type: string
          encoding: unterminated
          desc: Human-readable string

 - MSG_FWD:
    id: 0x0402
    short_desc: Wrapper for FWD a separate stream of information over SBP
    desc: >
          This message provides the ability to forward messages over SBP.  This may take the form
          of wrapping up SBP messages received by Piksi for logging purposes or wrapping
          another protocol with SBP.


          The source identifier indicates from what interface a forwarded stream derived.
          The protocol identifier identifies what the expected protocol the forwarded msg contains.
          Protocol 0 represents SBP and the remaining values are implementation defined.
    fields:
      - source:
          type: u8
          desc: source identifier
      - protocol:
          type: u8
          desc: protocol identifier
      - fwd_payload:
          type: array
          fill: u8
          desc: variable length wrapped binary message

 - MSG_PRINT_DEP:
    id: 0x0010
    short_desc: Deprecated
    desc: Deprecated.
    public: false
    replaced_by:
      - MSG_LOG
    fields:
      - text:
          type: string
          encoding: unterminated
          desc: Human-readable string
