v3EndDevice

JSON Schema for v3EndDevice, extracted from The Things Stack v3.36 api.swagger.json

LoRaWANIoTInternet Of ThingsOpen SourceNetwork ServerLPWANTelemetrySensorsGatewaysConnectivityApache 2.0
View JSON Schema on GitHub

JSON Schema

the-things-stack-end-device-schema.json Raw ↑
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://api-evangelist.github.io/the-things-network/json-schema/the-things-stack-end-device-schema.json",
  "title": "v3EndDevice",
  "description": "JSON Schema for v3EndDevice, extracted from The Things Stack v3.36 api.swagger.json",
  "definitions": {
    "v3EndDevice": {
      "type": "object",
      "properties": {
        "ids": {
          "$ref": "#/definitions/v3EndDeviceIdentifiers"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "name": {
          "type": "string",
          "description": "Friendly name of the device. Stored in Entity Registry."
        },
        "description": {
          "type": "string",
          "description": "Description of the device. Stored in Entity Registry."
        },
        "attributes": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Key-value attributes for this end device. Typically used for organizing end devices or for storing integration-specific data. Stored in Entity Registry."
        },
        "version_ids": {
          "$ref": "#/definitions/v3EndDeviceVersionIdentifiers",
          "description": "Version Identifiers. Stored in Entity Registry, Network Server and Application Server."
        },
        "service_profile_id": {
          "type": "string",
          "description": "Default service profile. Stored in Entity Registry."
        },
        "network_server_address": {
          "type": "string",
          "description": "The address of the Network Server where this device is supposed to be registered.\nStored in Entity Registry and Join Server.\nThe typical format of the address is \"host:port\". If the port is omitted,\nthe normal port inference (with DNS lookup, otherwise defaults) is used.\nThe connection shall be established with transport layer security (TLS).\nCustom certificate authorities may be configured out-of-band."
        },
        "network_server_kek_label": {
          "type": "string",
          "description": "The KEK label of the Network Server to use for wrapping network session keys.\nStored in Join Server."
        },
        "application_server_address": {
          "type": "string",
          "description": "The address of the Application Server where this device is supposed to be registered.\nStored in Entity Registry and Join Server.\nThe typical format of the address is \"host:port\". If the port is omitted,\nthe normal port inference (with DNS lookup, otherwise defaults) is used.\nThe connection shall be established with transport layer security (TLS).\nCustom certificate authorities may be configured out-of-band."
        },
        "application_server_kek_label": {
          "type": "string",
          "description": "The KEK label of the Application Server to use for wrapping the application session key.\nStored in Join Server."
        },
        "application_server_id": {
          "type": "string",
          "description": "The AS-ID of the Application Server to use.\nStored in Join Server."
        },
        "join_server_address": {
          "type": "string",
          "description": "The address of the Join Server where this device is supposed to be registered.\nStored in Entity Registry.\nThe typical format of the address is \"host:port\". If the port is omitted,\nthe normal port inference (with DNS lookup, otherwise defaults) is used.\nThe connection shall be established with transport layer security (TLS).\nCustom certificate authorities may be configured out-of-band."
        },
        "locations": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/lorawanv3Location"
          },
          "description": "Location of the device. Stored in Entity Registry."
        },
        "picture": {
          "$ref": "#/definitions/v3Picture",
          "description": "Stored in Entity Registry."
        },
        "supports_class_b": {
          "type": "boolean",
          "description": "Whether the device supports class B.\nCopied on creation from template identified by version_ids, if any or from the home Network Server device profile, if any."
        },
        "supports_class_c": {
          "type": "boolean",
          "description": "Whether the device supports class C.\nCopied on creation from template identified by version_ids, if any or from the home Network Server device profile, if any."
        },
        "lorawan_version": {
          "$ref": "#/definitions/v3MACVersion",
          "description": "LoRaWAN MAC version. Stored in Network Server.\nCopied on creation from template identified by version_ids, if any or from the home Network Server device profile, if any."
        },
        "lorawan_phy_version": {
          "$ref": "#/definitions/v3PHYVersion",
          "description": "LoRaWAN PHY version. Stored in Network Server.\nCopied on creation from template identified by version_ids, if any or from the home Network Server device profile, if any."
        },
        "frequency_plan_id": {
          "type": "string",
          "description": "ID of the frequency plan used by this device.\nCopied on creation from template identified by version_ids, if any or from the home Network Server device profile, if any."
        },
        "min_frequency": {
          "type": "string",
          "format": "uint64",
          "description": "Minimum frequency the device is capable of using (Hz). Stored in Network Server.\nCopied on creation from template identified by version_ids, if any or from the home Network Server device profile, if any."
        },
        "max_frequency": {
          "type": "string",
          "format": "uint64",
          "description": "Maximum frequency the device is capable of using (Hz). Stored in Network Server.\nCopied on creation from template identified by version_ids, if any or from the home Network Server device profile, if any."
        },
        "supports_join": {
          "type": "boolean",
          "description": "The device supports join (it's OTAA).\nCopied on creation from template identified by version_ids, if any or from the home Network Server device profile, if any."
        },
        "resets_join_nonces": {
          "type": "boolean",
          "description": "Whether the device resets the join and dev nonces (not LoRaWAN compliant). Stored in Join Server.\nCopied on creation from template identified by version_ids, if any or from the home Network Server device profile, if any."
        },
        "root_keys": {
          "$ref": "#/definitions/v3RootKeys",
          "description": "Device root keys. Stored in Join Server."
        },
        "net_id": {
          "type": "string",
          "format": "string",
          "example": "000013",
          "description": "Home NetID. Stored in Join Server."
        },
        "mac_settings": {
          "$ref": "#/definitions/v3MACSettings",
          "description": "Settings for how the Network Server handles MAC layer for this device. Stored in Network Server.\nMutually exclusive with MAC settings profile."
        },
        "mac_state": {
          "$ref": "#/definitions/v3MACState",
          "description": "MAC state of the device. Stored in Network Server."
        },
        "pending_mac_state": {
          "$ref": "#/definitions/v3MACState",
          "description": "Pending MAC state of the device. Stored in Network Server."
        },
        "session": {
          "$ref": "#/definitions/v3Session",
          "description": "Current session of the device. Stored in Network Server and Application Server."
        },
        "pending_session": {
          "$ref": "#/definitions/v3Session",
          "description": "Pending session. Stored in Network Server and Application Server until RekeyInd is received."
        },
        "last_dev_nonce": {
          "type": "integer",
          "format": "int64",
          "description": "Last DevNonce used.\nThis field is only used for devices using LoRaWAN version 1.1 and later.\nStored in Join Server."
        },
        "used_dev_nonces": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          },
          "description": "Used DevNonces sorted in ascending order.\nThis field is only used for devices using LoRaWAN versions preceding 1.1.\nStored in Join Server."
        },
        "last_join_nonce": {
          "type": "integer",
          "format": "int64",
          "description": "Last JoinNonce/AppNonce(for devices using LoRaWAN versions preceding 1.1) used.\nStored in Join Server."
        },
        "last_rj_count_0": {
          "type": "integer",
          "format": "int64",
          "description": "Last Rejoin counter value used (type 0/2).\nStored in Join Server."
        },
        "last_rj_count_1": {
          "type": "integer",
          "format": "int64",
          "description": "Last Rejoin counter value used (type 1).\nStored in Join Server."
        },
        "last_dev_status_received_at": {
          "type": "string",
          "format": "date-time",
          "description": "Time when last DevStatus MAC command was received.\nStored in Network Server."
        },
        "power_state": {
          "$ref": "#/definitions/v3PowerState",
          "description": "The power state of the device; whether it is battery-powered or connected to an external power source.\nReceived via the DevStatus MAC command at status_received_at.\nStored in Network Server."
        },
        "battery_percentage": {
          "type": "number",
          "format": "float",
          "description": "Latest-known battery percentage of the device.\nReceived via the DevStatus MAC command at last_dev_status_received_at or earlier.\nStored in Network Server."
        },
        "downlink_margin": {
          "type": "integer",
          "format": "int32",
          "description": "Demodulation signal-to-noise ratio (dB).\nReceived via the DevStatus MAC command at last_dev_status_received_at.\nStored in Network Server."
        },
        "queued_application_downlinks": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v3ApplicationDownlink"
          },
          "description": "Queued Application downlink messages. Stored in Application Server,\nwhich sets them on the Network Server.\nThis field is deprecated and is always set equal to session.queued_application_downlinks."
        },
        "formatters": {
          "$ref": "#/definitions/v3MessagePayloadFormatters",
          "description": "The payload formatters for this end device. Stored in Application Server.\nCopied on creation from template identified by version_ids."
        },
        "provisioner_id": {
          "type": "string",
          "description": "ID of the provisioner. Stored in Join Server."
        },
        "provisioning_data": {
          "type": "object",
          "description": "Vendor-specific provisioning data. Stored in Join Server."
        },
        "multicast": {
          "type": "boolean",
          "description": "Indicates whether this device represents a multicast group."
        },
        "claim_authentication_code": {
          "$ref": "#/definitions/v3EndDeviceAuthenticationCode",
          "description": "Authentication code to claim ownership of the end device.\nFrom TTS v3.21.0 this field is stored in the Identity Server.\nFor TTS versions < 3.21.0, this field is stored in the Join Server.\nThe value stored on the Identity Server takes precedence."
        },
        "skip_payload_crypto": {
          "type": "boolean",
          "description": "Skip decryption of uplink payloads and encryption of downlink payloads.\nThis field is deprecated, use skip_payload_crypto_override instead."
        },
        "skip_payload_crypto_override": {
          "type": "boolean",
          "description": "Skip decryption of uplink payloads and encryption of downlink payloads.\nThis field overrides the application-level setting."
        },
        "activated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the device has been activated. Stored in the Entity Registry.\nThis field is set by the Application Server when an end device sends\nits first uplink.\nThe Application Server will use the field in order to avoid repeated\ncalls to the Entity Registry.\nThe field cannot be unset once set."
        },
        "last_seen_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when a device uplink has been last observed.\nThis field is set by the Application Server and stored in the Identity Server."
        },
        "serial_number": {
          "type": "string"
        },
        "lora_alliance_profile_ids": {
          "$ref": "#/definitions/v3LoRaAllianceProfileIdentifiers"
        },
        "mac_settings_profile_ids": {
          "$ref": "#/definitions/v3MACSettingsProfileIdentifiers",
          "description": "MAC settings profile identifiers.\nMutually exclusive with MAC settings."
        }
      },
      "description": "Defines an End Device registration and its state on the network.\nThe persistence of the EndDevice is divided between the Network Server, Application Server and Join Server.\nSDKs are responsible for combining (if desired) the three."
    },
    "v3EndDeviceIdentifiers": {
      "type": "object",
      "properties": {
        "device_id": {
          "type": "string"
        },
        "application_ids": {
          "$ref": "#/definitions/v3ApplicationIdentifiers"
        },
        "dev_eui": {
          "type": "string",
          "format": "string",
          "example": "70B3D57ED000ABCD",
          "description": "The LoRaWAN DevEUI."
        },
        "join_eui": {
          "type": "string",
          "format": "string",
          "example": "70B3D57ED000ABCD",
          "description": "The LoRaWAN JoinEUI (AppEUI until LoRaWAN 1.0.3 end devices)."
        },
        "dev_addr": {
          "type": "string",
          "format": "string",
          "example": "2600ABCD",
          "description": "The LoRaWAN DevAddr."
        }
      }
    },
    "v3ApplicationIdentifiers": {
      "type": "object",
      "properties": {
        "application_id": {
          "type": "string"
        }
      }
    },
    "v3PHYVersion": {
      "type": "string",
      "enum": [
        "PHY_UNKNOWN",
        "PHY_V1_0",
        "TS001_V1_0",
        "PHY_V1_0_1",
        "TS001_V1_0_1",
        "PHY_V1_0_2_REV_A",
        "RP001_V1_0_2",
        "PHY_V1_0_2_REV_B",
        "RP001_V1_0_2_REV_B",
        "PHY_V1_1_REV_A",
        "RP001_V1_1_REV_A",
        "PHY_V1_1_REV_B",
        "RP001_V1_1_REV_B",
        "PHY_V1_0_3_REV_A",
        "RP001_V1_0_3_REV_A",
        "RP002_V1_0_0",
        "RP002_V1_0_1",
        "RP002_V1_0_2",
        "RP002_V1_0_3",
        "RP002_V1_0_4"
      ],
      "default": "PHY_UNKNOWN"
    },
    "v3MACState": {
      "type": "object",
      "properties": {
        "current_parameters": {
          "$ref": "#/definitions/v3MACParameters",
          "description": "Current LoRaWAN MAC parameters."
        },
        "desired_parameters": {
          "$ref": "#/definitions/v3MACParameters",
          "description": "Desired LoRaWAN MAC parameters."
        },
        "device_class": {
          "$ref": "#/definitions/v3Class",
          "title": "Currently active LoRaWAN device class\n- Device class is A by default\n- If device sets ClassB bit in uplink, this will be set to B\n- If device sent DeviceModeInd MAC message, this will be set to that value"
        },
        "lorawan_version": {
          "$ref": "#/definitions/v3MACVersion",
          "description": "LoRaWAN MAC version."
        },
        "last_confirmed_downlink_at": {
          "type": "string",
          "format": "date-time",
          "description": "Time when the last confirmed downlink message or MAC command was scheduled."
        },
        "last_dev_status_f_cnt_up": {
          "type": "integer",
          "format": "int64",
          "description": "Frame counter value of last uplink containing DevStatusAns."
        },
        "ping_slot_periodicity": {
          "$ref": "#/definitions/v3PingSlotPeriodValue",
          "description": "Periodicity of the class B ping slot."
        },
        "pending_application_downlink": {
          "$ref": "#/definitions/v3ApplicationDownlink",
          "description": "A confirmed application downlink, for which an acknowledgment is expected to arrive."
        },
        "queued_responses": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v3MACCommand"
          },
          "description": "Queued MAC responses.\nRegenerated on each uplink."
        },
        "pending_requests": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v3MACCommand"
          },
          "description": "Pending MAC requests(i.e. sent requests, for which no response has been received yet).\nRegenerated on each downlink."
        },
        "queued_join_accept": {
          "$ref": "#/definitions/MACStateJoinAccept",
          "description": "Queued join-accept.\nSet each time a (re-)join request accept is received from Join Server and removed each time a downlink is scheduled."
        },
        "pending_join_request": {
          "$ref": "#/definitions/v3MACStateJoinRequest",
          "description": "Pending join request.\nSet each time a join-accept is scheduled and removed each time an uplink is received from the device."
        },
        "rx_windows_available": {
          "type": "boolean",
          "description": "Whether or not Rx windows are expected to be open.\nSet to true every time an uplink is received.\nSet to false every time a successful downlink scheduling attempt is made."
        },
        "recent_uplinks": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v3MACStateUplinkMessage"
          },
          "description": "Recent data uplink messages sorted by time.\nThe number of messages stored may depend on configuration."
        },
        "recent_downlinks": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v3MACStateDownlinkMessage"
          },
          "description": "Recent data downlink messages sorted by time.\nThe number of messages stored may depend on configuration."
        },
        "last_network_initiated_downlink_at": {
          "type": "string",
          "format": "date-time",
          "description": "Time when the last network-initiated downlink message was scheduled."
        },
        "rejected_adr_data_rate_indexes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v3DataRateIndex"
          },
          "description": "ADR Data rate index values rejected by the device.\nReset each time `current_parameters.channels` change.\nElements are sorted in ascending order."
        },
        "rejected_adr_tx_power_indexes": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          },
          "description": "ADR TX output power index values rejected by the device.\nElements are sorted in ascending order."
        },
        "rejected_frequencies": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uint64"
          },
          "description": "Frequencies rejected by the device."
        },
        "last_downlink_at": {
          "type": "string",
          "format": "date-time",
          "description": "Time when the last downlink message was scheduled."
        },
        "rejected_data_rate_ranges": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/MACStateDataRateRanges"
          },
          "description": "Data rate ranges rejected by the device per frequency."
        },
        "last_adr_change_f_cnt_up": {
          "type": "integer",
          "format": "int64",
          "description": "Frame counter of uplink, which confirmed the last ADR parameter change."
        },
        "recent_mac_command_identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v3MACCommandIdentifier"
          },
          "description": "MAC command identifiers sent by the end device in the last received uplink.\nThe Network Server may choose to store only certain types of MAC\ncommand identifiers in the underlying implementation."
        },
        "pending_relay_downlink": {
          "$ref": "#/definitions/v3RelayForwardDownlinkReq",
          "description": "Pending relay downlink contents.\nThe pending downlink will be scheduled to the relay in either Rx1 or Rx2.\nThe pending downlink will be cleared after the scheduling attempt."
        }
      },
      "description": "MACState represents the state of MAC layer of the device.\nMACState is reset on each join for OTAA or ResetInd for ABP devices.\nThis is used internally by the Network Server."
    },
    "MACStateJoinAccept": {
      "type": "object",
      "properties": {
        "payload": {
          "type": "string",
          "format": "byte",
          "description": "Payload of the join-accept received from Join Server."
        },
        "request": {
          "$ref": "#/definitions/v3MACStateJoinRequest"
        },
        "keys": {
          "$ref": "#/definitions/v3SessionKeys",
          "description": "Network session keys associated with the join."
        },
        "correlation_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "dev_addr": {
          "type": "string",
          "format": "string",
          "example": "2600ABCD"
        },
        "net_id": {
          "type": "string",
          "format": "string",
          "example": "000013"
        }
      }
    },
    "v3SessionKeys": {
      "type": "object",
      "properties": {
        "session_key_id": {
          "type": "string",
          "format": "byte",
          "description": "Join Server issued identifier for the session keys.\nThis ID can be used to request the keys from the Join Server in case the are lost."
        },
        "f_nwk_s_int_key": {
          "$ref": "#/definitions/v3KeyEnvelope",
          "description": "The (encrypted) Forwarding Network Session Integrity Key (or Network Session Key in 1.0 compatibility mode).\nThis key is stored by the (forwarding) Network Server."
        },
        "s_nwk_s_int_key": {
          "$ref": "#/definitions/v3KeyEnvelope",
          "description": "The (encrypted) Serving Network Session Integrity Key.\nThis key is stored by the (serving) Network Server."
        },
        "nwk_s_enc_key": {
          "$ref": "#/definitions/v3KeyEnvelope",
          "description": "The (encrypted) Network Session Encryption Key.\nThis key is stored by the (serving) Network Server."
        },
        "app_s_key": {
          "$ref": "#/definitions/v3KeyEnvelope",
          "description": "The (encrypted) Application Session Key.\nThis key is stored by the Application Server."
        }
      },
      "description": "Session keys for a LoRaWAN session.\nOnly the components for which the keys were meant, will have the key-encryption-key (KEK) to decrypt the individual keys."
    },
    "v3KeyEnvelope": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "format": "string",
          "example": "0123456789ABCDEF0123456789ABCDEF",
          "description": "The unencrypted AES key."
        },
        "kek_label": {
          "type": "string",
          "description": "The label of the RFC 3394 key-encryption-key (KEK) that was used to encrypt the key."
        },
        "encrypted_key": {
          "type": "string",
          "format": "byte"
        }
      }
    },
    "v3MACStateJoinRequest": {
      "type": "object",
      "properties": {
        "downlink_settings": {
          "$ref": "#/definitions/v3DLSettings"
        },
        "rx_delay": {
          "$ref": "#/definitions/v3RxDelay"
        },
        "cf_list": {
          "$ref": "#/definitions/v3CFList"
        }
      }
    },
    "v3CFList": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/v3CFListType"
        },
        "freq": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          },
          "description": "Frequencies to be broadcasted, in hecto-Hz.\nThese values are broadcasted as 24 bits unsigned integers.\nThis field should not contain default values."
        },
        "ch_masks": {
          "type": "array",
          "items": {
            "type": "boolean"
          },
          "description": "ChMasks controlling the channels to be used.\nLength of this field must be equal to the amount of uplink channels\ndefined by the selected frequency plan."
        }
      }
    },
    "v3CFListType": {
      "type": "string",
      "enum": [
        "FREQUENCIES",
        "CHANNEL_MASKS"
      ],
      "default": "FREQUENCIES"
    },
    "v3RxDelay": {
      "type": "string",
      "enum": [
        "RX_DELAY_0",
        "RX_DELAY_1",
        "RX_DELAY_2",
        "RX_DELAY_3",
        "RX_DELAY_4",
        "RX_DELAY_5",
        "RX_DELAY_6",
        "RX_DELAY_7",
        "RX_DELAY_8",
        "RX_DELAY_9",
        "RX_DELAY_10",
        "RX_DELAY_11",
        "RX_DELAY_12",
        "RX_DELAY_13",
        "RX_DELAY_14",
        "RX_DELAY_15"
      ],
      "default": "RX_DELAY_0",
      "description": " - RX_DELAY_0: 1 second.\n - RX_DELAY_1: 1 second.\n - RX_DELAY_2: 2 seconds.\n - RX_DELAY_3: 3 seconds.\n - RX_DELAY_4: 4 seconds.\n - RX_DELAY_5: 5 seconds.\n - RX_DELAY_6: 6 seconds.\n - RX_DELAY_7: 7 seconds.\n - RX_DELAY_8: 8 seconds.\n - RX_DELAY_9: 9 seconds.\n - RX_DELAY_10: 10 seconds.\n - RX_DELAY_11: 11 seconds.\n - RX_DELAY_12: 12 seconds.\n - RX_DELAY_13: 13 seconds.\n - RX_DELAY_14: 14 seconds.\n - RX_DELAY_15: 15 seconds."
    },
    "v3DLSettings": {
      "type": "object",
      "properties": {
        "rx1_dr_offset": {
          "$ref": "#/definitions/v3DataRateOffset"
        },
        "rx2_dr": {
          "$ref": "#/definitions/v3DataRateIndex"
        },
        "opt_neg": {
          "type": "boolean",
          "description": "OptNeg is set if Network Server implements LoRaWAN 1.1 or greater."
        }
      }
    },
    "v3DataRateOffset": {
      "type": "string",
      "enum": [
        "DATA_RATE_OFFSET_0",
        "DATA_RATE_OFFSET_1",
        "DATA_RATE_OFFSET_2",
        "DATA_RATE_OFFSET_3",
        "DATA_RATE_OFFSET_4",
        "DATA_RATE_OFFSET_5",
        "DATA_RATE_OFFSET_6",
        "DATA_RATE_OFFSET_7"
      ],
      "default": "DATA_RATE_OFFSET_0"
    },
    "v3DataRateIndex": {
      "type": "string",
      "enum": [
        "DATA_RATE_0",
        "DATA_RATE_1",
        "DATA_RATE_2",
        "DATA_RATE_3",
        "DATA_RATE_4",
        "DATA_RATE_5",
        "DATA_RATE_6",
        "DATA_RATE_7",
        "DATA_RATE_8",
        "DATA_RATE_9",
        "DATA_RATE_10",
        "DATA_RATE_11",
        "DATA_RATE_12",
        "DATA_RATE_13",
        "DATA_RATE_14",
        "DATA_RATE_15"
      ],
      "default": "DATA_RATE_0"
    },
    "v3MACVersion": {
      "type": "string",
      "enum": [
        "MAC_UNKNOWN",
        "MAC_V1_0",
        "MAC_V1_0_1",
        "MAC_V1_0_2",
        "MAC_V1_1",
        "MAC_V1_0_3",
        "MAC_V1_0_4"
      ],
      "default": "MAC_UNKNOWN"
    },
    "v3Class": {
      "type": "string",
      "enum": [
        "CLASS_A",
        "CLASS_B",
        "CLASS_C"
      ],
      "default": "CLASS_A"
    },
    "v3MACStateUplinkMessage": {
      "type": "object",
      "properties": {
        "payload": {
          "$ref": "#/definitions/lorawanv3Message"
        },
        "settings": {
          "$ref": "#/definitions/MACStateUplinkMessageTxSettings"
        },
        "rx_metadata": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/MACStateUplinkMessageRxMetadata"
          }
        },
        "received_at": {
          "type": "string",
          "format": "date-time"
        },
        "correlation_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "device_channel_index": {
          "type": "integer",
          "format": "int64"
        }
      },
      "description": "A minimal UplinkMessage definition which is binary compatible with the top level UplinkMessage message.\nUsed for type safe recent uplink storage."
    },
    "MACStateUplinkMessageRxMetadata": {
      "type": "object",
      "properties": {
        "gateway_ids": {
          "$ref": "#/definitions/lorawanv3GatewayIdentifiers"
        },
        "channel_rssi": {
          "type": "number",
          "format": "float"
        },
        "snr": {
          "type": "number",
          "format": "float"
        },
        "downlink_path_constraint": {
          "$ref": "#/definitions/v3DownlinkPathConstraint"
        },
        "uplink_token": {
          "type": "string",
          "format": "byte"
        },
        "packet_broker": {
          "$ref": "#/definitions/UplinkMessageRxMetadataPacketBrokerMetadata"
        },
        "relay": {
          "$ref": "#/definitions/UplinkMessageRxMetadataRelayMetadata"
        }
      }
    },
    "UplinkMessageRxMetadataRelayMetadata": {
      "type": "object"
    },
    "lorawanv3GatewayIdentifiers": {
      "type": "object",
      "properties": {
        "gateway_id": {
          "type": "string"
        },
        "eui": {
          "type": "string",
          "format": "string",
          "example": "70B3D57ED000ABCD",
          "description": "Secondary identifier, which can only be used in specific requests."
        }
      }
    },
    "v3DownlinkPathConstraint": {
      "type": "string",
      "enum": [
        "DOWNLINK_PATH_CONSTRAINT_NONE",
        "DOWNLINK_PATH_CONSTRAINT_PREFER_OTHER",
        "DOWNLINK_PATH_CONSTRAINT_NEVER"
      ],
      "default": "DOWNLINK_PATH_CONSTRAINT_NONE",
      "description": " - DOWNLINK_PATH_CONSTRAINT_NONE: Indicates that the gateway can be selected for downlink without constraints by the Network Server.\n - DOWNLINK_PATH_CONSTRAINT_PREFER_OTHER: Indicates that the gateway can be selected for downlink only if no other or better gateway can be selected.\n - DOWNLINK_PATH_CONSTRAINT_NEVER: Indicates that this gateway will never be selected for downlink, even if that results in no available downlink path."
    },
    "UplinkMessageRxMetadataPacketBrokerMetadata": {
      "type": "object"
    },
    "lorawanv3Message": {
      "type": "object",
      "properties": {
        "m_hdr": {
          "$ref": "#/definitions/lorawanv3MHDR"
        },
        "mic": {
          "type": "string",
          "format": "byte"
        },
        "mac_payload": {
          "$ref": "#/definitions/lorawanv3MACPayload"
        },
        "join_request_payload": {
          "$ref": "#/definitions/v3JoinRequestPayload"
        },
        "join_accept_payload": {
          "$ref": "#/definitions/v3JoinAcceptPayload"
        },
        "rejoin_request_payload": {
          "$ref": "#/definitions/v3RejoinRequestPayload"
        }
      },
      "title": "Message represents a LoRaWAN message"
    },
    "v3JoinAcceptPayload": {
      "type": "object",
      "properties": {
        "encrypted": {
          "type": "string",
          "format": "byte"
        },
        "join_nonce": {
          "type": "string",
          "format": "string",
          "example": "ABCDEF"
        },
        "net_id": {
          "type": "string",
          "format": "string",
          "example": "000013"
        },
        "dev_addr": {
          "type": "string",
          "format": "string",
          "example": "2600ABCD"
        },
        "dl_settings": {
          "$ref": "#/definitions/v3DLSettings"
        },
        "rx_delay": {
          "$ref": "#/definitions/v3RxDelay"
        },
        "cf_list": {
          "$ref": "#/definitions/v3CFList"
        }
 

# --- truncated at 32 KB (117 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/the-things-network/refs/heads/main/json-schema/the-things-stack-end-device-schema.json