summaryrefslogtreecommitdiff
path: root/handshake.proto
blob: 4009a2e818203a60d169b24921510d8ecd9cb707 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Protocol for handshake
// m2s: master to slave
// s2m: slave to master

syntax = "proto2";

message m2s_MDR_request {
    // Record type that is requested. Will indicate verbosity in the future
    required uint32 record_type = 1;
}

message s2m_MDR_req_ACK {
    // ACK the MDR request with the length of MDR response
    required uint32 MDR_res_length = 1;
}

message m2s_MDR_res_CTS {
    required uint32 timeout = 1;
}

message _subscriptions {
    optional uint32 module_id = 1    [default=0];
    optional uint32 entity_id = 2    [default=0];
    optional uint32 module_class = 3 [default=0];
    optional uint32 i2c_address = 4  [default=0];
}

message s2m_MDR_response {
    required float MDR_version = 1;

    // Module unique ID
    required uint32 module_id = 2;
    // Class of this module
    required uint32 module_class = 3;
    // One of more bytes; each bit indicates whether the entity is measured by this module
    required uint32 entity_id = 4;
   
    // Entities to which this module wants to subscribe
    repeated _subscriptions subscriptions = 5;
}

// message m2s_broadcast {
//     message _slave_info {
// 	uint32 i2c_address = 1;
// 	uint32 module_id = 2;
// 	uint32 entity_id = 3;
//     }
//     repeated _slave_info slave_info = 1;
// }