Skip to content

Instantly share code, notes, and snippets.

@ahappyforest
Last active January 1, 2016 23:09
Show Gist options
  • Save ahappyforest/8214376 to your computer and use it in GitHub Desktop.
Save ahappyforest/8214376 to your computer and use it in GitHub Desktop.
package command;
// meta message
message meta_config {
required string k = 1;
required int32 v = 2;
}
message meta_time {
required string timestamp = 1;
}
message meta_ack {
required ack ret = 1;
enum ack {
SUCCESS = 0;
FAIL = 1;
}
}
// service
// 1. get_config
// Request
// 1. "MUSHROOM" | "get_config\n\r" | 0 | 0x13
// Response
// 2. "MUSHROOM" | "get_config\n\r" | sz | meta_config | 0x13
// 2. set_config
// Request
// 1. "MUSHROOM" | "set_config\n\r" | sz | meta_config | 0x13
// Response
// 2. "MUSHROOM" | "set_config\n\r" | sz | meta_ack | 0x13
// 3. get_time
// Request
// 1. "MUSHROOM" | "get_time\n\r" | 0 | 0x13
// Response
// 2. "MUSHROOM" | "get_time\n\r" | sz | meta_time | 0x13
// 4. set_time
// Request
// 1. "MUSHROOM" | "set_time\n\r" | sz | meta_time | 0x13
// Response
// 2. "MUSHROOM" | "set_time\n\r" | sz | meta_ack | 0x13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment