mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-06-16 06:18:27 +00:00
api: Refactor meta/meta.proto to streams/meta.proto.
This commit is contained in:
14
api/rust/build.rs
vendored
14
api/rust/build.rs
vendored
@ -13,7 +13,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
std::fs::create_dir_all(out_dir.join("gw")).unwrap();
|
||||
std::fs::create_dir_all(out_dir.join("internal")).unwrap();
|
||||
std::fs::create_dir_all(out_dir.join("integration")).unwrap();
|
||||
std::fs::create_dir_all(out_dir.join("meta")).unwrap();
|
||||
std::fs::create_dir_all(out_dir.join("streams")).unwrap();
|
||||
std::fs::create_dir_all(out_dir.join("api")).unwrap();
|
||||
|
||||
#[cfg(feature = "json")]
|
||||
@ -136,25 +136,25 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
.build(&[".integration"])?;
|
||||
}
|
||||
|
||||
// meta
|
||||
// streams
|
||||
tonic_build::configure()
|
||||
.out_dir(out_dir.join("meta"))
|
||||
.file_descriptor_set_path(out_dir.join("meta").join("proto_descriptor.bin"))
|
||||
.out_dir(out_dir.join("streams"))
|
||||
.file_descriptor_set_path(out_dir.join("streams").join("proto_descriptor.bin"))
|
||||
.compile_well_known_types(true)
|
||||
.extern_path(".common", "crate::common")
|
||||
.extern_path(".gw", "crate::gw")
|
||||
.compile(
|
||||
&[cs_dir.join("meta").join("meta.proto").to_str().unwrap()],
|
||||
&[cs_dir.join("streams").join("meta.proto").to_str().unwrap()],
|
||||
&[proto_dir.join("chirpstack").to_str().unwrap()],
|
||||
)?;
|
||||
|
||||
#[cfg(feature = "json")]
|
||||
{
|
||||
let descriptor_set = std::fs::read(out_dir.join("meta").join("proto_descriptor.bin"))?;
|
||||
let descriptor_set = std::fs::read(out_dir.join("streams").join("proto_descriptor.bin"))?;
|
||||
pbjson_build::Builder::new()
|
||||
.register_descriptors(&descriptor_set)?
|
||||
.ignore_unknown_fields()
|
||||
.out_dir(out_dir.join("meta"))
|
||||
.out_dir(out_dir.join("streams"))
|
||||
.extern_path(".common", "crate::common")
|
||||
.extern_path(".gw", "crate::gw")
|
||||
.build(&[".meta"])?;
|
||||
|
62
api/rust/proto/chirpstack/meta/meta.proto
vendored
62
api/rust/proto/chirpstack/meta/meta.proto
vendored
@ -1,62 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meta;
|
||||
|
||||
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/meta";
|
||||
option java_package = "io.chirpstack.api.meta";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "MetaProto";
|
||||
option csharp_namespace = "Chirpstack.Meta";
|
||||
|
||||
import "common/common.proto";
|
||||
import "gw/gw.proto";
|
||||
|
||||
|
||||
message UplinkMeta {
|
||||
// Device EUI (EUI64).
|
||||
string dev_eui = 1;
|
||||
|
||||
// TX meta-data.
|
||||
gw.UplinkTxInfo tx_info = 2;
|
||||
|
||||
// RX meta-data.
|
||||
repeated gw.UplinkRxInfo rx_info = 3;
|
||||
|
||||
// PHYPayload byte count.
|
||||
uint32 phy_payload_byte_count = 4;
|
||||
|
||||
// MAC-Command byte count.
|
||||
uint32 mac_command_byte_count = 5;
|
||||
|
||||
// Application payload byte count.
|
||||
uint32 application_payload_byte_count = 6;
|
||||
|
||||
// Message type.
|
||||
common.MType message_type = 7;
|
||||
}
|
||||
|
||||
message DownlinkMeta {
|
||||
// Device EUI (EUI64).
|
||||
string dev_eui = 1;
|
||||
|
||||
// Multicast Group ID (UUID).
|
||||
string multicast_group_id = 2;
|
||||
|
||||
// TX meta-data.
|
||||
gw.DownlinkTxInfo tx_info = 3;
|
||||
|
||||
// PHYPayload byte count.
|
||||
uint32 phy_payload_byte_count = 4;
|
||||
|
||||
// MAC-Command byte count.
|
||||
uint32 mac_command_byte_count = 5;
|
||||
|
||||
// Application payload byte count.
|
||||
uint32 application_payload_byte_count = 6;
|
||||
|
||||
// Message type.
|
||||
common.MType message_type = 7;
|
||||
|
||||
// Gateway ID (EUI64).
|
||||
string gateway_id = 8;
|
||||
}
|
61
api/rust/proto/chirpstack/streams/meta.proto
vendored
Normal file
61
api/rust/proto/chirpstack/streams/meta.proto
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meta;
|
||||
|
||||
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/streams";
|
||||
option java_package = "io.chirpstack.api.streams";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "StreamsProto";
|
||||
option csharp_namespace = "Chirpstack.Streams";
|
||||
|
||||
import "common/common.proto";
|
||||
import "gw/gw.proto";
|
||||
|
||||
message UplinkMeta {
|
||||
// Device EUI (EUI64).
|
||||
string dev_eui = 1;
|
||||
|
||||
// TX meta-data.
|
||||
gw.UplinkTxInfo tx_info = 2;
|
||||
|
||||
// RX meta-data.
|
||||
repeated gw.UplinkRxInfo rx_info = 3;
|
||||
|
||||
// PHYPayload byte count.
|
||||
uint32 phy_payload_byte_count = 4;
|
||||
|
||||
// MAC-Command byte count.
|
||||
uint32 mac_command_byte_count = 5;
|
||||
|
||||
// Application payload byte count.
|
||||
uint32 application_payload_byte_count = 6;
|
||||
|
||||
// Message type.
|
||||
common.MType message_type = 7;
|
||||
}
|
||||
|
||||
message DownlinkMeta {
|
||||
// Device EUI (EUI64).
|
||||
string dev_eui = 1;
|
||||
|
||||
// Multicast Group ID (UUID).
|
||||
string multicast_group_id = 2;
|
||||
|
||||
// TX meta-data.
|
||||
gw.DownlinkTxInfo tx_info = 3;
|
||||
|
||||
// PHYPayload byte count.
|
||||
uint32 phy_payload_byte_count = 4;
|
||||
|
||||
// MAC-Command byte count.
|
||||
uint32 mac_command_byte_count = 5;
|
||||
|
||||
// Application payload byte count.
|
||||
uint32 application_payload_byte_count = 6;
|
||||
|
||||
// Message type.
|
||||
common.MType message_type = 7;
|
||||
|
||||
// Gateway ID (EUI64).
|
||||
string gateway_id = 8;
|
||||
}
|
2
api/rust/src/lib.rs
vendored
2
api/rust/src/lib.rs
vendored
@ -6,4 +6,4 @@ pub mod gw;
|
||||
pub mod integration;
|
||||
#[cfg(feature = "internal")]
|
||||
pub mod internal;
|
||||
pub mod meta;
|
||||
pub mod streams;
|
||||
|
3
api/rust/src/meta.rs
vendored
3
api/rust/src/meta.rs
vendored
@ -1,3 +0,0 @@
|
||||
include!(concat!(env!("OUT_DIR"), "/meta/meta.rs"));
|
||||
#[cfg(feature = "json")]
|
||||
include!(concat!(env!("OUT_DIR"), "/meta/meta.serde.rs"));
|
3
api/rust/src/streams.rs
vendored
Normal file
3
api/rust/src/streams.rs
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
include!(concat!(env!("OUT_DIR"), "/streams/meta.rs"));
|
||||
#[cfg(feature = "json")]
|
||||
include!(concat!(env!("OUT_DIR"), "/streams/meta.serde.rs"));
|
Reference in New Issue
Block a user