diff --git a/docs/spec.md b/docs/spec.md index bd56bb59..8f7c1934 100644 --- a/docs/spec.md +++ b/docs/spec.md @@ -171,6 +171,7 @@ Informs the client about parameters. Only supported if the server declares the ` - `parameters`: array of: - `name`: string, name of the parameter - `value`: number | boolean | string | number[] | boolean[] | string[] + - `type`: "byte_array" | undefined. If the type is `byte_array`, `value` shall be interpreted as base64 encoded string. - `id`: string | undefined. Only set when the [getParameters](#get-parameters) or [setParameters](#set-parameters) request's `id` field was set #### Example @@ -183,6 +184,7 @@ Informs the client about parameters. Only supported if the server declares the ` { "name": "/float_param", "value": 1.2 }, { "name": "/string_param", "value": "foo" }, { "name": "/node/nested_ints_param", "value": [1, 2, 3] } + { "name": "/byte_array_param", "value": "QUJDRA==", "type": "byte_array" }, ], "id": "request-123" } @@ -396,6 +398,7 @@ Set one or more parameters. Only supported if the server previously declared tha - `parameters`: array of: - `name`: string - `value`: number | boolean | string | number[] | boolean[] | string[] | undefined. If the value is not set (`undefined`), the parameter shall be unset (removed). + - `type`: "byte_array" | undefined. If the type is `byte_array`, `value` shall be a base64 encoded string. - `id`: string | undefined, arbitrary string used for identifying the corresponding server [response](#parameter-values). If this field is not set, the server may not send a response to the client. #### Example @@ -405,7 +408,8 @@ Set one or more parameters. Only supported if the server previously declared tha "op": "setParameters", "parameters": [ { "name": "/int_param", "value": 3 }, - { "name": "/float_param", "value": 4.1 } + { "name": "/float_param", "value": 4.1 }, + { "name": "/byte_array_param", "value": "QUJDRA==", "type": "byte_array" } ], "id": "request-456" } diff --git a/typescript/ws-protocol/src/types.ts b/typescript/ws-protocol/src/types.ts index 419aacf0..59de6cdc 100644 --- a/typescript/ws-protocol/src/types.ts +++ b/typescript/ws-protocol/src/types.ts @@ -195,6 +195,7 @@ export type ClientPublish = { export type Parameter = { name: string; value: number | boolean | string | number[] | boolean[] | string[] | undefined; + type?: "byte_array"; }; export type ServerMessage =