Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket data compression support #62

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions client/client-1.0/Javascript/appclient_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Get request:
{"action":"get","path":"Server.Support.Protocol","requestId":"133"}
{"action":"get","path":"Vehicle.Chassis.AxleCount","requestId":"321"}

Get Request with data compression:
{"action":"get","path":"Vehicle.Speed", "dc":"2+1","requestId":"232"}


Get request for historic data:
{"action":"get","path":"Vehicle.Acceleration.Longitudinal","filter":{"variant":"history","parameter":"P2DT12H"},"requestId":"234"}
Expand Down Expand Up @@ -40,6 +43,7 @@ Subscribe request:
{"action":"subscribe","path":"Vehicle/Cabin/Door/Row1/PassengerSide/IsOpen","filter":{"variant":"range","parameter":[{"logic-op":"gt","boundary":"500"},{"logic-op":"lt","boundary":"510"}]},"requestId":"265"}
{"action":"subscribe","path":"Vehicle.Powertrain.Transmission.Speed","filter":{"variant":"curvelog","parameter":{"maxerr":"2","bufsize":"100"}},"requestId":"275"}
{"action":"subscribe","path":"Vehicle","filter":[{"variant":"paths","parameter":["CurrentLocation.Latitude", "CurrentLocation.Longitude"]}, {"variant":"curvelog","parameter":{"maxerr":"0.00001","bufsize":"100"}}],"requestId":"285"}
{"action":"subscribe","path":"Vehicle.CurrentLocation","filter":[{"variant":"paths","parameter":["Latitude", "Longitude"]}, {"variant":"timebased","parameter":{"period":"3000"}}], "dc":"2+1","requestId":"286"}

Unsubscribe request:
{"action":"unsubscribe","subscriptionId":"1","requestId":"240"}
Expand Down
9 changes: 6 additions & 3 deletions client/client-1.0/compress_client/requests.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{"request":[{"action":"get","path":"Vehicle/Cabin/Door/Row1/DriverSide/IsOpen","requestId":"232"},{"action":"get","path":"Vehicle.Acceleration.Longitudinal","requestId":"233"},
{"action":"get","path":"Vehicle/ADAS","filter":{"type":"paths","parameter":["ABS/*","CruiseControl/Error"]},"requestId":"237"},
{"action":"subscribe","path":"Vehicle/Cabin/Door/Row1/PassengerSide/IsOpen","filter":{"type":"timebased","parameter":{"period":"3"}},"requestId":"246"}]}
{"request":[
{"action":"get","path":"Vehicle/Cabin/Door/Row1/DriverSide/IsOpen","requestId":"232"},{"action":"get","path":"Vehicle.Acceleration.Longitudinal","requestId":"233"},
{"action":"get","path":"Vehicle/ADAS","filter":{"variant":"paths","parameter":["ABS/*","CruiseControl/Error"]},"requestId":"237"},
{"action":"subscribe","path":"Vehicle/Cabin/Door/Row1/PassengerSide/IsOpen","filter":{"variant":"timebased","parameter":{"period":"3"}},"requestId":"246"},
{"action":"subscribe","path":"Vehicle.CurrentLocation","filter":[{"variant":"paths","parameter":["Latitude", "Longitude"]}, {"variant":"timebased","parameter":{"period":"3000"}}], "dc":"2+1","requestId":"286"}
]}
5 changes: 3 additions & 2 deletions client/client-1.0/grpc_client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ To run:

./grpc_client

The gRPC client UI provides a choice of four different request that can be issued:
The gRPC client UI provides a choice of four different request that can be issued, e.g.:

```
{"action":"get","path":"Vehicle/Chassis/Accelerator/PedalPosition","requestId":"232"}
{"action":"subscribe","path":"Vehicle/Speed","filter":{"type":"timebased","parameter":{"period":"100"}},"requestId":"246"}
{"action":"subscribe","path":"Vehicle/Speed","filter":{"varian":"timebased","parameter":{"period":"100"}},"requestId":"246"}
{"action":"unsubscribe","subscriptionId":"1","requestId":"240"}
{"action":"set", "path":"Vehicle/Body/Lights/IsLeftIndicatorOn", "value":"999", "requestId":"245"}
```
The commands can be changed in the source code, in the parameter commandList, followed by rebuilding.

These can be issued multiple times, but there is a limitation in that the unsubscribe has a static subscriptionID that only applies to the first started subscription.
20 changes: 10 additions & 10 deletions client/client-1.0/grpc_client/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ func initCommandList() {

commandList[0] = `{"action":"get","path":"Vehicle/Speed","requestId":"232"}`
commandList[1] = `{"action":"set", "path":"Vehicle/Body/Lights/IsLeftIndicatorOn", "value":"true", "requestId":"245"}`
commandList[2] = `{"action":"subscribe","path":"Vehicle.Speed","filter":{"type":"curvelog","parameter":{"maxerr":"2","bufsize":"15"}},"requestId":"285"}`
/* commandList[2] = `{"action":"subscribe","path":"Vehicle","filter":[{"type":"paths","parameter":["Speed", "Chassis.Accelerator.PedalPosition"]},{"type":"timebased","parameter": {"period":"5000"}}],"requestId":"246"}`*/
commandList[3] = `{"action":"unsubscribe","subscriptionId":"X","requestId":"240"}` // X is replaced according to input
commandList[2] = `{"action":"subscribe","path":"Vehicle.CurrentLocation","filter":[{"variant":"paths","parameter":["Latitude", "Longitude"]}, {"variant":"timebased","parameter":{"period":"3000"}}], "dc":"2+1","requestId":"286"}`
commandList[3] = `{"action":"unsubscribe","subscriptionId":"X","requestId":"240"}` // X is replaced according to input, e.g. 23 sets X=2

/* different variants
commandList[2] = `{"action":"subscribe","path":"Vehicle","filter":[{"type":"paths","parameter":["Speed","CurrentLocation.Latitude", "CurrentLocation.Longitude"]}, {"type":"timebased","parameter":{"period":"100"}}],"requestId":"285"}`
commandList[1] = `{"action":"subscribe","path":"Vehicle/Speed","filter":{"type":"timebased","parameter":{"period":"100"}},"requestId":"246"}`
commandList[2] = `{"action":"subscribe","path":"Vehicle.Speed","filter":{"variant":"curvelog","parameter":{"maxerr":"2","bufsize":"15"}},"requestId":"285"}`
commandList[2] = `{"action":"subscribe","path":"Vehicle","filter":[{"variant":"paths","parameter":["Speed","CurrentLocation.Latitude", "CurrentLocation.Longitude"]}, {"variant":"timebased","parameter":{"period":"100"}}],"requestId":"285"}`
commandList[1] = `{"action":"subscribe","path":"Vehicle/Speed","filter":{"variant":"timebased","parameter":{"period":"100"}},"requestId":"246"}`
commandList[0] = `{"action":"get","path":"Vehicle/Cabin/Door/Row1/Right/IsOpen","requestId":"232"}`
commandList[0] = `{"action":"get","path":"Vehicle/Cabin/Door","filter":{"type":"paths","parameter":"*.*.IsOpen"},"requestId":"235"}`
commandList[1] = `{"action":"subscribe","path":"Vehicle/Cabin/Door/Row1/Right/IsOpen","filter":{"type":"timebased","parameter":{"period":"3000"}},"requestId":"246"}`
commandList[1] = `{"action":"subscribe","path":"Vehicle","filter":{"type":"paths","parameter":["Speed", "Chassis.Accelerator.PedalPosition"]},"requestId":"246"}`
commandList[0] = `{"action":"get","path":"Vehicle/Cabin/Door","filter":{"variant":"paths","parameter":"*.*.IsOpen"},"requestId":"235"}`
commandList[1] = `{"action":"subscribe","path":"Vehicle/Cabin/Door/Row1/Right/IsOpen","filter":{"variant":"timebased","parameter":{"period":"3000"}},"requestId":"246"}`
commandList[1] = `{"action":"subscribe","path":"Vehicle","filter":{"variant":"paths","parameter":["Speed", "Chassis.Accelerator.PedalPosition"]},"requestId":"246"}`
commandList[1] = `{"action":"subscribe","path":"Vehicle/Speed","requestId":"258"}`
commandList[1] = `{"action":"subscribe","path":"Vehicle","filter":[{"type":"paths","parameter":["Body.Lights.IsLeftIndicatorOn", "Chassis.Accelerator.PedalPosition"]}, {"type":"change","parameter":{"logic-op":"ne", "diff": "0"}}],"requestId":"285"}`
commandList[1] = {"action":"subscribe","path":"Vehicle","filter":{"type":"paths","parameter":["Speed", "Chassis.Accelerator.PedalPosition"]},"requestId":"246"}`
commandList[1] = `{"action":"subscribe","path":"Vehicle","filter":[{"variant":"paths","parameter":["Body.Lights.IsLeftIndicatorOn", "Chassis.Accelerator.PedalPosition"]}, {"variant":"change","parameter":{"logic-op":"ne", "diff": "0"}}],"requestId":"285"}`
commandList[1] = {"action":"subscribe","path":"Vehicle","filter":{"variant":"paths","parameter":["Speed", "Chassis.Accelerator.PedalPosition"]},"requestId":"246"}`
*/
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,27 @@ Server.Support.Security:
Server.Support.Filter:
type: attribute
datatype: string[]
default: ["timebased", "change", "range", "curvelog", "paths"]
default: ["timebased", "change", "range", "curvelog", "paths", "metadata"]
description: List of supported filter features.

Server.Support.Encoding:
type: attribute
datatype: string[]
default: ["protobuf"]
description: List of supported payload encoding features.

Server.Support.Filetransfer:
type: attribute
datatype: string[]
default: ["upload", "download"]
description: List of supported file transfer features.

Server.Support.DataCompression:
type: attribute
datatype: string[]
default: ["2+1"]
description: List of supported data compression features.

Server.Config:
type: branch
description: Top branch declaring the configuration of server supported features.
Expand All @@ -64,6 +82,22 @@ Server.Config.Protocol.Websocket:
type: branch
description: Top branch for the server supported Websocket protocol.

Server.Config.Protocol.Websocket.FileTransfer:
type: branch
description: Websocket filetransfer.

Server.Config.Protocol.Websocket.FileTransfer.Mode:
type: attribute
datatype: string[]
default: ["upload", "download"]
description: Websocket protocol port number for the primary payload format.

Server.Config.Protocol.Websocket.FileTransfer.PortNum:
type: attribute
datatype: uint32
default: 8002
description: Websocket protocol port number for the primary payload format.

Server.Config.Protocol.Websocket.Primary:
type: branch
description: Websocket configuration for the primary payload format.
Expand All @@ -78,10 +112,11 @@ Server.Config.Protocol.Websocket.Protobuf:
type: branch
description: Websocket configuration for the protobuf encoded payload format.

Server.Config.Protocol.Websocket.Protobuf.PortNum:
Server.Config.Protocol.Websocket.Protobuf.SubProtocol:
type: attribute
datatype: uint32
description: Websocket protocol port number for the protobuf encoded payload format.
datatype: string
default: "VISS-protoenc"
description: Websocket sub-protocol for the protobuf encoded payload format.

Server.Config.Protocol.Mqtt:
type: branch
Expand Down Expand Up @@ -122,6 +157,7 @@ Server.Config.Protocol.Grpc.Protobuf:
Server.Config.Protocol.Grpc.Protobuf.PortNum:
type: attribute
datatype: uint32
default: 5443
description: gRPC port number for the protobuf encoded payload format.

Server.Config.AccessControl:
Expand Down
Binary file modified server/vissv2server/forest/server.binary
Binary file not shown.
Loading
Loading