54 lines
997 B
Protocol Buffer
54 lines
997 B
Protocol Buffer
import "nanopb.proto";
|
|
|
|
package tm1638;
|
|
|
|
enum Color {
|
|
GREEN = 1;
|
|
RED = 2;
|
|
BOTH = 3;
|
|
NONE = 4;
|
|
}
|
|
|
|
enum Module {
|
|
TM1638 = 1;
|
|
InvertedTM1638 = 2;
|
|
TM1640 = 3;
|
|
}
|
|
|
|
message Command {
|
|
enum Type {
|
|
PING = 1;
|
|
CONSTRUCT = 2;
|
|
SET_LED = 10;
|
|
}
|
|
|
|
required Type type = 1;
|
|
optional Ping ping = 2;
|
|
optional Construct construct = 3;
|
|
optional SetLed setLed = 10;
|
|
}
|
|
|
|
message Ping {
|
|
required int32 id = 1;
|
|
}
|
|
|
|
message Echo {
|
|
required int32 id = 1;
|
|
optional string message = 2;// [(nanopb).max_size = 40];
|
|
}
|
|
|
|
message Construct {
|
|
required int32 dataPin = 1;
|
|
required int32 clockPin = 2;
|
|
optional int32 strobePin = 3;
|
|
optional bool activateDisplay = 4 [default = true];
|
|
optional int32 intensity = 5 [default = 7];
|
|
optional Module module = 6 [default = TM1638];
|
|
optional int32 id = 7 [default = 0];
|
|
}
|
|
|
|
message SetLed {
|
|
required Color color = 1;
|
|
required int32 pos = 2;
|
|
optional int32 id = 3 [default = 1];
|
|
} |