From 68dd0171bc51e871a522d21a40c35c08de0fb573 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Sat, 6 Jul 2013 13:01:21 +0300 Subject: [PATCH] Switch the example project to use the new .options file --- example/fileproto.options | 13 +++++++++++++ example/fileproto.proto | 14 +++----------- 2 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 example/fileproto.options diff --git a/example/fileproto.options b/example/fileproto.options new file mode 100644 index 00000000..29a2ab0e --- /dev/null +++ b/example/fileproto.options @@ -0,0 +1,13 @@ +# This file defines the nanopb-specific options for the messages defined +# in fileproto.proto. +# +# If you come from high-level programming background, the hardcoded +# maximum lengths may disgust you. However, if your microcontroller only +# has a few kB of ram to begin with, setting reasonable limits for +# filenames is ok. +# +# On the other hand, using the callback interface, it is not necessary +# to set a limit on the number of files in the response. + +ListFilesRequest.path max_size:128 +FileInfo.name max_size:128 diff --git a/example/fileproto.proto b/example/fileproto.proto index e2786b15..3e70c492 100644 --- a/example/fileproto.proto +++ b/example/fileproto.proto @@ -1,22 +1,14 @@ -import "nanopb.proto"; - // This defines protocol for a simple server that lists files. // -// If you come from high-level programming background, the hardcoded -// maximum lengths may disgust you. However, if your microcontroller only -// has a few kB of ram to begin with, setting reasonable limits for -// filenames is ok. -// -// On the other hand, using the callback interface, it is not necessary -// to set a limit on the number of files in the response. +// See also the nanopb-specific options in fileproto.options. message ListFilesRequest { - optional string path = 1 [default = "/", (nanopb).max_size = 128]; + optional string path = 1 [default = "/"]; } message FileInfo { required uint64 inode = 1; - required string name = 2 [(nanopb).max_size = 128]; + required string name = 2; } message ListFilesResponse { -- 2.16.6