Example
[apps/agl-service-can-low-level.git] / example / fileproto.proto
1 import "nanopb.proto";
2
3 // This defines protocol for a simple server that lists files.
4 //
5 // If you come from high-level programming background, the hardcoded
6 // maximum lengths may disgust you. However, if your microcontroller only
7 // has a few kB of ram to begin with, setting reasonable limits for
8 // filenames is ok.
9 //
10 // On the other hand, using the callback interface, it is not necessary
11 // to set a limit on the number of files in the response.
12
13 message ListFilesRequest {
14     optional string path = 1 [default = "/", (nanopb).max_size = 128];
15 }
16
17 message FileInfo {
18     required uint64 inode = 1;
19     required string name = 2 [(nanopb).max_size = 128];
20 }
21
22 message ListFilesResponse {
23     optional bool path_error = 1 [default = false];
24     repeated FileInfo file = 2;
25 }
26