-
Notifications
You must be signed in to change notification settings - Fork 1
/
HubToGatewayMessage.fbs
58 lines (44 loc) · 1.1 KB
/
HubToGatewayMessage.fbs
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
50
51
52
53
54
55
56
57
58
include "./Types/SemVer.fbs";
include "./Types/FirmwareBootType.fbs";
include "./Types/OtaUpdateProgressTask.fbs";
attribute "fs_serializer";
namespace OpenShock.Serialization.Gateway;
table Pong {
uptime:uint64;
rssi:int32;
}
table BootStatus {
boot_type:Types.FirmwareBootType;
firmware_version:Types.SemVer (required);
ota_update_id:int32;
}
table OtaUpdateStarted {
update_id:int32;
version:Types.SemVer (required);
}
table OtaUpdateProgress {
update_id:int32;
task:Types.OtaUpdateProgressTask;
progress:float32;
}
table OtaUpdateFailed {
update_id:int32;
message:string;
fatal:bool;
}
union HubToGatewayMessagePayload {
/// Respond to a ping message
Pong,
/// Report the current boot status, used to report firmware version and OTA update results
BootStatus,
/// Report that an OTA update has started
OtaUpdateStarted,
/// Report the progress of an OTA update
OtaUpdateProgress,
/// Report that an OTA update has failed
OtaUpdateFailed
}
table HubToGatewayMessage (fs_serializer) {
payload:HubToGatewayMessagePayload (required);
}
root_type HubToGatewayMessage;