diff options
Diffstat (limited to 'embassy-net-esp-hosted/build.rs')
| -rw-r--r-- | embassy-net-esp-hosted/build.rs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/embassy-net-esp-hosted/build.rs b/embassy-net-esp-hosted/build.rs new file mode 100644 index 000000000..1e9b8cffd --- /dev/null +++ b/embassy-net-esp-hosted/build.rs | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | fn main() { | ||
| 2 | let out_dir = std::env::var("OUT_DIR").unwrap(); | ||
| 3 | |||
| 4 | let mut g = micropb_gen::Generator::new(); | ||
| 5 | g.use_container_heapless(); | ||
| 6 | |||
| 7 | g.configure( | ||
| 8 | ".", | ||
| 9 | micropb_gen::Config::new() | ||
| 10 | .max_bytes(32) // For ssid, mac, etc - strings | ||
| 11 | .max_len(16) // For repeated fields | ||
| 12 | .type_attributes("#[cfg_attr(feature = \"defmt\", derive(defmt::Format))]"), | ||
| 13 | ); | ||
| 14 | |||
| 15 | // Special config for things that need to be larger | ||
| 16 | g.configure( | ||
| 17 | ".CtrlMsg_Req_OTAWrite.ota_data", | ||
| 18 | micropb_gen::Config::new().max_bytes(1024), | ||
| 19 | ); | ||
| 20 | g.configure( | ||
| 21 | ".CtrlMsg_Event_ESPInit.init_data", | ||
| 22 | micropb_gen::Config::new().max_bytes(64), | ||
| 23 | ); | ||
| 24 | g.configure( | ||
| 25 | ".CtrlMsg_Req_VendorIEData.payload", | ||
| 26 | micropb_gen::Config::new().max_bytes(64), | ||
| 27 | ); | ||
| 28 | |||
| 29 | g.compile_protos(&["src/esp_hosted_config.proto"], format!("{}/proto.rs", out_dir)) | ||
| 30 | .unwrap(); | ||
| 31 | |||
| 32 | println!("cargo:rerun-if-changed=src/esp_hosted_config.proto"); | ||
| 33 | } | ||
