From e0125b84c61b2b045b9b5e4ce8d3afa1070dd5fe Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 23 Oct 2015 15:54:17 +0200 Subject: Simplify ASN.1 --- rose/Remote-Operations-Generic-ROS-PDUs.asn1 | 86 +++++++--------------------- 1 file changed, 21 insertions(+), 65 deletions(-) (limited to 'rose') diff --git a/rose/Remote-Operations-Generic-ROS-PDUs.asn1 b/rose/Remote-Operations-Generic-ROS-PDUs.asn1 index e62bd48..f854b0a 100644 --- a/rose/Remote-Operations-Generic-ROS-PDUs.asn1 +++ b/rose/Remote-Operations-Generic-ROS-PDUs.asn1 @@ -3,39 +3,23 @@ DEFINITIONS IMPLICIT TAGS ::= BEGIN -- exports everything IMPORTS OPERATION, ERROR FROM Remote-Operations-Information-Objects{joint-iso-itu-t remote-operations(4) informationObjects(5) version1(0)}; -ROS {InvokeId:InvokeIdSet, OPERATION:Invokable, OPERATION:Returnable} ::= CHOICE +ROS ::= CHOICE { - invoke [1] Invoke {{InvokeIdSet}, {Invokable}}, - returnResult [2] ReturnResult {{Returnable}}, - returnError [3] ReturnError {{Errors{{Returnable}}}}, + invoke [1] Invoke, + returnResult [2] ReturnResult, + returnError [3] ReturnError, reject [4] Reject } -(CONSTRAINED BY { -- must conform to the above definition -- } -! RejectProblem : general-unrecognisedPDU) -Invoke {InvokeId:InvokeIdSet, OPERATION:Operations} ::= SEQUENCE +Invoke ::= SEQUENCE { - invokeId InvokeId (InvokeIdSet) - (CONSTRAINED BY {-- must be unambiguous --} - ! RejectProblem : invoke-duplicateInvocation), - linkedId CHOICE { - present [0] IMPLICIT present < InvokeId, - absent [1] IMPLICIT NULL - } - (CONSTRAINED BY {-- must identify an outstanding operation --} - ! RejectProblem : invoke-unrecognisedLinkedId) - (CONSTRAINED BY {-- which has one or more linked operations--} - ! RejectProblem : invoke-linkedResponseUnexpected) - OPTIONAL, - opcode OPERATION.&operationCode - ({Operations} - ! RejectProblem : invoke-unrecognisedOperation), - argument OPERATION.&ArgumentType - ({Operations} {@opcode} - ! RejectProblem : invoke-mistypedArgument) - OPTIONAL + invokeId InvokeId, + linkedId CHOICE { + present [0] IMPLICIT present < InvokeId, + absent [1] IMPLICIT NULL + } OPTIONAL, + opcode OPERATION.&operationCode, + argument OPERATION.&ArgumentType OPTIONAL } -(CONSTRAINED BY { -- must conform to the above definition -- } -! RejectProblem : general-mistypedPDU) ( WITH COMPONENTS {..., @@ -45,50 +29,24 @@ Invoke {InvokeId:InvokeIdSet, OPERATION:Operations} ::= SEQUENCE {..., linkedId PRESENT, opcode - (CONSTRAINED BY {-- must be in the &Linked field of the associated operation --} - ! RejectProblem : invoke-unexpectedLinkedOperation) } ) -ReturnResult {OPERATION:Operations}::= SEQUENCE +ReturnResult ::= SEQUENCE { - invokeId InvokeId - (CONSTRAINED BY {-- must be that for an outstanding operation --} - ! RejectProblem : returnResult-unrecognisedInvocation) - (CONSTRAINED BY {-- which returns a result --} - ! RejectProblem : returnResult-resultResponseUnexpected), + invokeId InvokeId, result SEQUENCE { - opcode OPERATION.&operationCode - ({Operations})(CONSTRAINED BY {-- identified by invokeId --} - ! RejectProblem : returnResult-unrecognisedInvocation), - result OPERATION.&ResultType - ({Operations} {@.opcode} - ! RejectProblem : returnResult-mistypedResult) - } - OPTIONAL + opcode OPERATION.&operationCode, + result OPERATION.&ResultType + } OPTIONAL } -(CONSTRAINED BY { -- must conform to the above definition -- } -! RejectProblem : general-mistypedPDU) -ReturnError {ERROR:Errors} ::= SEQUENCE +ReturnError ::= SEQUENCE { - invokeId InvokeId - (CONSTRAINED BY {-- must be that for an outstanding operation --} - ! RejectProblem : returnError-unrecognisedInvocation) - (CONSTRAINED BY {-- which returns an error --} - ! RejectProblem : returnError-errorResponseUnexpected), - errcode ERROR.&errorCode - ({Errors} - ! RejectProblem : returnError-unrecognisedError) - (CONSTRAINED BY {-- must be in the &Errors field of the associated -- - -- operation --} - ! RejectProblem : returnError-unexpectedError), - parameter ERROR.&ParameterType - ({Errors}{@errcode} - ! RejectProblem : returnError-mistypedParameter) OPTIONAL + invokeId InvokeId, + errcode ERROR.&errorCode, + parameter ERROR.&ParameterType OPTIONAL } -(CONSTRAINED BY { -- must conform to the above definition -- } -! RejectProblem : general-mistypedPDU) Reject ::= SEQUENCE { invokeId InvokeId, @@ -100,8 +58,6 @@ Reject ::= SEQUENCE returnError [3] ReturnErrorProblem } } -(CONSTRAINED BY { -- must conform to the above definition -- } -! RejectProblem : general-mistypedPDU) GeneralProblem ::= INTEGER { unrecognisedPDU (0), -- cgit v1.2.3