From ed3355f956b3bef5bcb217c8a6f48ae805082096 Mon Sep 17 00:00:00 2001 From: czfdcn Date: Fri, 1 Mar 2024 16:37:17 -0500 Subject: [PATCH 1/3] Fix UAttributes integer type There are a number of integer values that do not need to be signed but was set at int32 in lieu of uint32 by mistake, this change addresses the discrepancy. We also elaborate on what is means when the attribute is not present. #106 --- uprotocol/uattributes.proto | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/uprotocol/uattributes.proto b/uprotocol/uattributes.proto index 67ce836..c6ff355 100644 --- a/uprotocol/uattributes.proto +++ b/uprotocol/uattributes.proto @@ -60,19 +60,20 @@ message UAttributes { // https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/basics/qos.adoc[uProtocol Prioritization] UPriority priority = 5; - // TTL is How long this message should live for after it was generated (in milliseconds). + // TTL is How long this message should live for after it was generated (in milliseconds). If not present, + // the message is assumed to not timeout (should live forever) // Event expires when: // \$t_current > t_{id} + ttl\$ - optional int32 ttl = 6; + optional uint32 ttl = 6; // Permission level per https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/basics/permissions.adoc[Permissions] - optional int32 permission_level = 7; + optional uint32 permission_level = 7; // Communication error attribute populated by uP-L2 dispatchers only when an error // has occurred in the delivery of RPC request or response events. // The contents of this attribute, if present, is the unsigned integer representation of - // UCode - optional int32 commstatus = 8; + // UCode. If the attribute is not present, there is no communication error + optional uint32 commstatus = 8; // The correlation ID (UUDI) passed for response type messages to corelate the // response to a request. From 94a748ba2122dcf96bb8c205dd85a4e125516cfd Mon Sep 17 00:00:00 2001 From: czfdcn Date: Mon, 4 Mar 2024 09:59:50 -0500 Subject: [PATCH 2/3] Incorporate reviewers feedback --- uprotocol/uattributes.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/uprotocol/uattributes.proto b/uprotocol/uattributes.proto index c6ff355..7d14754 100644 --- a/uprotocol/uattributes.proto +++ b/uprotocol/uattributes.proto @@ -28,6 +28,7 @@ import "uri.proto"; import "uuid.proto"; + import "ustatus.proto"; import "uprotocol_options.proto"; option java_package = "org.eclipse.uprotocol.v1"; @@ -61,7 +62,7 @@ message UAttributes { UPriority priority = 5; // TTL is How long this message should live for after it was generated (in milliseconds). If not present, - // the message is assumed to not timeout (should live forever) + // or 0 (zero), the message is assumed to not timeout (i.e. live forever).
// Event expires when: // \$t_current > t_{id} + ttl\$ optional uint32 ttl = 6; @@ -71,9 +72,8 @@ message UAttributes { // Communication error attribute populated by uP-L2 dispatchers only when an error // has occurred in the delivery of RPC request or response events. - // The contents of this attribute, if present, is the unsigned integer representation of - // UCode. If the attribute is not present, there is no communication error - optional uint32 commstatus = 8; + // If the attribute is not present, there is no communication error + optional UCode commstatus = 8; // The correlation ID (UUDI) passed for response type messages to corelate the // response to a request. From 4bae72323c5628dc8f4ae3e8e45fe430b78dd577 Mon Sep 17 00:00:00 2001 From: czfdcn Date: Mon, 4 Mar 2024 18:18:26 -0500 Subject: [PATCH 3/3] Move CallOptions to proto --- uprotocol/uattributes.proto | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/uprotocol/uattributes.proto b/uprotocol/uattributes.proto index 7d14754..c61e2e7 100644 --- a/uprotocol/uattributes.proto +++ b/uprotocol/uattributes.proto @@ -87,6 +87,23 @@ message UAttributes { } +// Message that defines a subset of UAttributes used for RPC Method invocation +message CallOptions { + // Message priority per + // https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/basics/qos.adoc[uProtocol Prioritization] + UPriority priority = 1; + + // TTL is How long this message should live for after it was generated (in milliseconds). If not present, + // or 0 (zero), the message is assumed to not timeout (i.e. live forever).
+ // Event expires when: + // \$t_current > t_{id} + ttl\$ + optional uint32 ttl = 2; + + // Authorization token used for TAP per https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/basics/permissions.adoc[Permissions] + optional string token = 3; +} + + // uProtocol defines message types. Using the message type, validation can be performed to ensure transport // validity of the data in the {@link UAttributes}. enum UMessageType {