Skip to content

Instantly share code, notes, and snippets.

@nathantsoi
Last active April 24, 2017 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathantsoi/b56a34cd91daf2d60d794ae3031bbbc4 to your computer and use it in GitHub Desktop.
Save nathantsoi/b56a34cd91daf2d60d794ae3031bbbc4 to your computer and use it in GitHub Desktop.
nano pb example
syntax = "proto2";
import "msg_osd.proto";
message Message {
enum Type {
Api = 1;
Osd = 2;
}
required uint32 utime = 1;
oneof payload {
MsgApi msg_api = 2;
MsgOsd msg_osd = 3;
}
}
syntax = "proto2";
message MsgOsd {
enum VideoSystem {
AUTO = 0;
PAL = 1;
NTSC = 2;
}
optional VideoSystem video_system = 1;
enum UnitType {
METRIC = 0;
IMPERIAL = 1;
}
optional UnitType units = 2;
message Alarm {
optional string name = 1 [default = ""];
optional uint32 limit = 2;
}
repeated Alarm alarms = 3;
message Element {
optional string name = 1 [default = ""];
optional uint32 position = 2;
}
repeated Element elments = 4;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment