diff --git a/proto/kuksa/val/v2/types.proto b/proto/kuksa/val/v2/types.proto index 4eae41d2..e48170f5 100644 --- a/proto/kuksa/val/v2/types.proto +++ b/proto/kuksa/val/v2/types.proto @@ -47,6 +47,25 @@ message Value { } } +message SampleInterval { + uint32 interval_ms = 1; +} + +enum FilterError { + FILTER_ERROR_CODE_UNSPECIFIED = 0; + FILTER_ERROR_CODE_OK = 1; + FILTER_ERROR_CODE_NETWORK_ERROR = 2; + FILTER_ERROR_CODE_OVERLOAD = 3; + FILTER_ERROR_CODE_UNKNOW_SINGAL_ID = 4; +} + +message Filter { + // Duration of the active call. If it is not set, call will last for ever. + uint32 duration_ms = 1; + // Min desired sample update interval. + SampleInterval min_sample_interval = 2; +} + message SignalID { oneof signal { // Numeric identifier to the signal @@ -113,7 +132,9 @@ message Metadata { Value allowed_values = 17; // Must be of array type Value min = 18; Value max = 19; - + + // Minimum sample interval at which its provider will publish the signal value + SampleInterval min_sample_interval = 20; } // VSS Data type of a signal diff --git a/proto/kuksa/val/v2/val.proto b/proto/kuksa/val/v2/val.proto index 2756ac19..6139e333 100644 --- a/proto/kuksa/val/v2/val.proto +++ b/proto/kuksa/val/v2/val.proto @@ -131,6 +131,7 @@ service VAL { // NOT_FOUND if the specified root branch does not exist. // UNAUTHENTICATED if no credentials provided or credentials has expired // INVALID_ARGUMENT if the provided path or wildcard is wrong. + // UNAVAILABLE if there is no provider currently providing the signal -> do we want this error for list metadata? // rpc ListMetadata(ListMetadataRequest) returns (ListMetadataResponse); @@ -213,6 +214,7 @@ message SubscribeRequest { // Default (0) results in that only latest message is kept. // Maximum value supported is implementation dependent. uint32 buffer_size = 2; + Filter filter = 3; } message SubscribeResponse { @@ -227,6 +229,7 @@ message SubscribeByIdRequest { // Default (0) results in that only latest message is kept. // Maximum value supported is implementation dependent. uint32 buffer_size = 2; + Filter filter = 3; } message SubscribeByIdResponse { @@ -268,16 +271,13 @@ message PublishValueRequest { Datapoint data_point = 2; } -message PublishValueResponse { -} - message PublishValuesRequest { - int32 request_id = 1; /// Unique request id for the stream that can be used to identify the response. + uint64 request_id = 1; /// Unique request id for the stream that can be used to match the corresponding response. map data_points = 2; } message PublishValuesResponse { - int32 request_id = 1; + uint64 request_id = 1; /// Unique request id for the stream that can be used to match the corresponding request. map status = 2; } @@ -288,6 +288,13 @@ message ProvideActuationRequest { message ProvideActuationResponse { } +message ProvideSignalRequest { + map signals_sample_intervals = 1; +} + +message ProvideSignalResponse { +} + message BatchActuateStreamRequest { repeated ActuateRequest actuate_requests = 1; } @@ -298,6 +305,28 @@ message BatchActuateStreamResponse { Error error = 2; } +message UpdateFilterRequest { + // Databroker sends filters to provider. + // In case provider restarts, databroker will send local filters stored + // to continue the provider sending same signals with same filter. + map filters_update = 1; +} + +// Only returned if there is a filter error on provider side +message UpdateFilterResponse { + FilterError filter_error = 1; +} + +message GetProviderValueRequest { + uint64 request_id = 1; /// Unique request id for the stream that can be used to match the corresponding response. + GetValueRequest request = 2; +} + +message GetProviderValueResponse { + uint64 request_id = 1; /// Unique request id for the stream that can be used to match the corresponding request. + GetValueResponse response = 2; +} + message OpenProviderStreamRequest { oneof action { // Inform server of an actuator this provider provides. @@ -307,6 +336,12 @@ message OpenProviderStreamRequest { // Sent to acknowledge the acceptance of a batch actuate // request. BatchActuateStreamResponse batch_actuate_stream_response = 3; + // Inform server of a signal this provider provides. + ProvideSignalRequest provide_signal_request = 4; + // Update filter response + UpdateFilterResponse update_filter_response = 5; + // GetValue response + GetProviderValueResponse get_provider_value_response = 6; } } @@ -318,6 +353,12 @@ message OpenProviderStreamResponse { PublishValuesResponse publish_values_response = 2; // Send a batch actuate request to a provider. BatchActuateStreamRequest batch_actuate_stream_request = 3; + // Response to a provide sensor request. + ProvideSignalResponse provide_signal_response = 4; + // Filter request + UpdateFilterRequest update_filter_request = 5; + // GetValue request from client forwarded to provider + GetProviderValueRequest get_provider_value_request = 6; } }