(C) 2022 Geotab Inc
The VISSv2messages.proto file contains a definition that encompasses all payload messages that the VISSv2 standard defines for the Websocket, and MQTT protocols. For HTTP the requests carry most parts of this not as a payload but explicitly in the protocol, so this design may need some tweaks for supporting HTTP. At a minimum the code that transforms between JSON and protobuf would need modifications.
The VISSv2messages.proto file is used as input to the protoc tool. To generate a Golang output file, the following command can be used:
$ protoc --go_out=protoc-out VISSv2messages.proto
which creates the VISSv2messages.pb.go file in the protoc-out directory.
The different type of messages that serialised protobuf blob supports are the following:
Request and response messages for the actions get/set/subscribe/unsubscribe.
Notification messages for the action subscribe.
Response and notification messages can be either be success, or error messages.
This computes to thirteen different message types that need to be supported, and this is signalled within the protobuf blob by the enums MessageMethod, MessageType, and ResponseStatus.
The protobuf design also supports two levels of compression, one where all data is of string type, and one where paths and timestamps are encoded into int32 format, see README in the utils directory for more information.