Few first files.

This commit is contained in:
Kotlin Developer
2016-06-05 23:18:46 +00:00
parent c3e1185fda
commit 3491477dca
2 changed files with 38 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
message Upload {
message Method {
enum TYPE {
DFU = 1;
}
// Type of upload method.
optional TYPE type = 1;
// Upload port.
optional string port = 2;
// Device address, smth like 8087:0ABA.
optional string device = 3;
// Additional programmator-specific arguments.
repeated string arguments = 4;
}
// Firmware data.
optional bytes data = 1;
// Method of firmware upload.
optional Method method = 2;
}
message UploadResult {
optional string error = 1;
}
message LogMessage {
optional string source = 1;
optional bytes message = 2;
}
+10
View File
@@ -0,0 +1,10 @@
var protobuf = require('protocol-buffers')
var fs = require('fs')
var messages = protobuf(fs.readFileSync(__dirname + '/../proto/carkot.proto'))
var ex = {
data: '12345'
}
var buf = messages.Upload.encode(ex)