Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nanopb
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
le
nanopb
Commits
68dd0171
Commit
68dd0171
authored
11 years ago
by
Petteri Aimonen
Browse files
Options
Downloads
Patches
Plain Diff
Switch the example project to use the new .options file
parent
a1cec46b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
example/fileproto.options
+13
-0
13 additions, 0 deletions
example/fileproto.options
example/fileproto.proto
+3
-11
3 additions, 11 deletions
example/fileproto.proto
with
16 additions
and
11 deletions
example/fileproto.options
0 → 100644
+
13
−
0
View file @
68dd0171
# 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
This diff is collapsed.
Click to expand it.
example/fileproto.proto
+
3
−
11
View file @
68dd0171
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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment