All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ttn.api.protocol.lorawan.lorawan.proto Maven / Gradle / Ivy

The newest version!
// Copyright © 2017 The Things Network
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.

syntax = "proto3";

import "github.com/gogo/protobuf/gogoproto/gogo.proto";

package lorawan;

option java_package = "org.thethingsnetwork.management.proto";

option go_package = "github.com/TheThingsNetwork/ttn/api/protocol/lorawan";

enum Modulation {
  LORA = 0;
  FSK  = 1;
}

message Metadata {
  Modulation  modulation   = 11;
  // LoRa data rate - SF{spreadingfactor}BW{bandwidth}
  string      data_rate    = 12;
  // FSK bit rate in bit/s
  uint32      bit_rate     = 13;
  // LoRa coding rate
  string      coding_rate  = 14;

  // Store the full 32 bit FCnt (deprecated; do not use)
  uint32      f_cnt = 15;

  FrequencyPlan frequency_plan = 16;
}

message TxConfiguration {
  Modulation  modulation   = 11;
  // LoRa data rate - SF{spreadingfactor}BW{bandwidth}
  string      data_rate    = 12;
  // FSK bit rate in bit/s
  uint32      bit_rate     = 13;
  // LoRa coding rate
  string      coding_rate  = 14;

  // Store the full 32 bit FCnt (deprecated; do not use)
  uint32      f_cnt = 15;
}

message ActivationMetadata {
  bytes app_eui    = 1 [(gogoproto.customtype) = "github.com/TheThingsNetwork/ttn/core/types.AppEUI"];
  bytes dev_eui    = 2 [(gogoproto.customtype) = "github.com/TheThingsNetwork/ttn/core/types.DevEUI"];
  bytes dev_addr   = 3 [(gogoproto.customtype) = "github.com/TheThingsNetwork/ttn/core/types.DevAddr"];
  bytes nwk_s_key  = 4 [(gogoproto.customtype) = "github.com/TheThingsNetwork/ttn/core/types.NwkSKey"];

  uint32 rx1_dr_offset    = 11;
  uint32 rx2_dr           = 12;
  uint32 rx_delay         = 13;
  CFList cf_list          = 14;
  FrequencyPlan frequency_plan = 15;
}

enum FrequencyPlan {
  EU_863_870 = 0;

  US_902_928 = 1;

  CN_779_787 = 2;

  EU_433     = 3;

  AU_915_928 = 4;

  CN_470_510 = 5;

  AS_923     = 6;
  AS_920_923 = 61;
  AS_923_925 = 62;

  KR_920_923 = 7;
}

message Message {
  MHDR  m_hdr = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
  bytes mic   = 2;

  oneof Payload {
    MACPayload          mac_payload           = 3;
    JoinRequestPayload  join_request_payload  = 4;
    JoinAcceptPayload   join_accept_payload   = 5;
  }
}

enum Major {
  LORAWAN_R1 = 0;
}

enum MType {
  JOIN_REQUEST      = 0;
  JOIN_ACCEPT       = 1;
  UNCONFIRMED_UP    = 2;
  UNCONFIRMED_DOWN  = 3;
  CONFIRMED_UP      = 4;
  CONFIRMED_DOWN    = 5;
}

message MHDR {
  MType m_type  = 1;
  Major major   = 2;
}

message MACPayload {
  FHDR  f_hdr       = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
  int32 f_port      = 2;
  bytes frm_payload = 3;
}

message FHDR {
  bytes dev_addr  = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/TheThingsNetwork/ttn/core/types.DevAddr"];
  FCtrl f_ctrl    = 2 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
  uint32 f_cnt    = 3;
  repeated MACCommand f_opts = 4 [(gogoproto.nullable) = false];
}

message FCtrl {
  bool    adr         = 1;
  bool    adr_ack_req = 2;
  bool    ack         = 3;
  bool    f_pending   = 4;
}

message MACCommand {
  uint32 cid     = 1;
  bytes  payload = 2;
}

message JoinRequestPayload {
  bytes app_eui   = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/TheThingsNetwork/ttn/core/types.AppEUI"];
  bytes dev_eui   = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/TheThingsNetwork/ttn/core/types.DevEUI"];
  bytes dev_nonce = 3 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/TheThingsNetwork/ttn/core/types.DevNonce"];
}

message JoinAcceptPayload {
  bytes       encrypted   = 1;
  bytes       app_nonce   = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/TheThingsNetwork/ttn/core/types.AppNonce"];
  bytes       net_id      = 3 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/TheThingsNetwork/ttn/core/types.NetID"];
  bytes       dev_addr    = 4 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/TheThingsNetwork/ttn/core/types.DevAddr"];
  DLSettings  dl_settings = 5 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
  uint32      rx_delay    = 6;
  CFList      cf_list     = 7;
}

message DLSettings {
  uint32 rx1_dr_offset = 1;
  uint32 rx2_dr = 2;
}

message CFList {
  repeated uint32 freq = 1;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy