diff --git a/Cargo.toml b/Cargo.toml index 7aed534..484939e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,9 @@ irq = "0.2.3" femtopb = "0.4.5" serial-line-ip = "0.5.0" +[build-dependencies] +femtopb-build = "0.4.5" + # cargo build/run [profile.dev] codegen-units = 1 diff --git a/build.rs b/build.rs index c410c58..2b667f4 100644 --- a/build.rs +++ b/build.rs @@ -31,17 +31,5 @@ fn main() { // `memory.x` is changed. println!("cargo:rerun-if-changed=memory.x"); - // protobuf_codegen::Codegen::new() - // // Use `protoc` parser, optional. - // .protoc() - // // Use `protoc-bin-vendored` bundled protoc command, optional. - // .protoc_path(&protoc_bin_vendored::protoc_bin_path().unwrap()) - // // All inputs and imports from the inputs must reside in `includes` directories. - // .includes(&["src/protos"]) - // // Inputs must reside in some of include paths. - // .input("src/protos/apple.proto") - // .input("src/protos/banana.proto") - // // Specify output directory relative to Cargo output directory. - // .cargo_out_dir("protos") - // .run_from_script(); + femtopb_build::compile_protos(&["src/api.proto"], &["src"]).unwrap(); } diff --git a/src/api.proto b/src/api.proto new file mode 100644 index 0000000..09adfa8 --- /dev/null +++ b/src/api.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; + +message SearchRequest { + uint32 query = 1; + uint32 page_number = 2; + uint32 results_per_page = 3; +}