summaryrefslogtreecommitdiffstats
path: root/example/fileproto.proto
blob: e2786b15b3323bd8f05e2801d5e01e351a7ecc73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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.

message ListFilesRequest {
    optional string path = 1 [default = "/", (nanopb).max_size = 128];
}

message FileInfo {
    required uint64 inode = 1;
    required string name = 2 [(nanopb).max_size = 128];
}

message ListFilesResponse {
    optional bool path_error = 1 [default = false];
    repeated FileInfo file = 2;
}