Commit 1bd81acd authored by fischerjo's avatar fischerjo
Browse files

Continued editing

parent 40126845
Loading
Loading
Loading
Loading
+58 −0
Original line number Diff line number Diff line
@@ -5,4 +5,62 @@
 *  @desc       Access Technology Layer (ISO 21218) functions
 */
module LibItsAtsp_Functions {
	
    import from CALMllsap language "ASN.1:1997" {
        type 
//            INsapPrimitivesDown, INsapPrimitivesUp, 
//            IN_UNITDATA_request, IN_UNITDATA_indication, IN_UNITDATA_STATUS_indication,
//			UserPriority,
//			LLserviceAddr, INdata, IN_SAPaddress, EUI64, 
			Link_ID, MedType
//			AccessParameters,
//		    NullType
    };
	
	
        /**
         * @desc Wait for RegReq (ref = 1) from IUT 
         * @param   p_linkID    Link-ID used by IUT
         * @param   p_medType   MedType of IUT
         */
		function f_cnAwaitRegistrationCI( 
            in template Link_ID p_linkID,	// PIXIT Element
            in template MedType p_medType, 	// PIXIT Element
            in boolean p_discard 			// set to TRUE
        ) runs on ItsCalm {
//            var CfEventInd p_result;
            
            log("*** f_cfAwaitNotificationToManagement: INFO: Expected MI-Request.request: ", p_cfEventInd, " ***");
            tc_wait.start;
            alt {
                [] cfPort.receive(p_cfEventInd) {
                    tc_wait.stop;
                    log("*** f_cnAwaitRegistrationCI: INFO: RegReq received ***"); 
                }
                [] cfPort.receive(CfEventInd : { cfFntpEventInd := ? } ) -> value p_result { 
                    if (p_discard == false) { 
                        tc_wait.stop;
                        log("*** f_cnAwaitRegistrationCI: ERROR: An unexpected MI-COMMAND was received ***", p_result);
                        f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked
                    } else { 
                        log("*** f_cnAwaitRegistrationCI: INFO: An unexpected MI-COMMAND was received, repeating check ***");
                        repeat;
                    } 
                }
                [] tc_wait.timeout {
                    if (p_discard == false) { 
                        log("*** f_cnAwaitRegistrationCI: ERROR: Timeout while waiting for event check result ***");
                        f_selfOrClientSyncAndVerdict("error", e_timeout); // to be checked
                    } else { // What is the purpose of this? 
                        log("*** f_cnAwaitRegistrationCI: INFO: Event not indicated at application layer ***");
                    }
                }
            } // End of 'alt' statement
			
			// Reply MI-Command.request "RegCmd"
			
			// Check for reception of Status notification (I-Parameter 12 "CIstatus" set to "registered". 
        
        } // End of function f_cfAwaitNotificationToManagement	
	
} // End of module LibItsAtsp_Functions
+464 −7
Original line number Diff line number Diff line
@@ -2,16 +2,18 @@
 *  @author     ETSI / STF455
 *  @version    $URL$
 *              $Id$
 *  @desc       Templates definitions for Access Technology Support Protocols (ISO 21218)
 *  @desc       Template definitions for Access Technology Support Protocols (ISO 21218)
 */
module LibItsAtsp_Templates {

    import from CALMllsap language "ASN.1:1997" {
        type 
            NullType,
            IN_SAPaddress, EUI64, LLserviceAddr, Link_ID, INdata, AccessParameters, 
            INsapPrimitivesDown, INsapPrimitivesUp, 
            IN_UNITDATA_request, IN_UNITDATA_indication
            IN_UNITDATA_request, IN_UNITDATA_indication, IN_UNITDATA_STATUS_indication,
			UserPriority,
			LLserviceAddr, INdata, IN_SAPaddress, EUI64, Link_ID,
			AccessParameters,
		    NullType
    };
    import from CALMmsap language "ASN.1:1997" { 
        type 
@@ -20,8 +22,463 @@ module LibItsAtsp_Templates {
			MI_Request_request, MI_Request_confirm,
			MI_Get_request, MI_Get_confirm,
			MI_Set_request, MI_Set_confirm,
            MI_Request_request, 
            IParamNoList, IParamList, IErrorsList,
            SimIUTcmd 
    };

        group inSapPrimitives {

            group sendOperation {
			
                /**
                 * @desc    Send template
				 * IN-UNITDATA.request to trigger transmission of frame
                 * @param   p_inUnitdataRq:  The IN-DUNITATA.request primitive
                 * @see     ISO 21218 - Clause 8.3.1
                 */
                template INsapPrimitivesDown m_fntpInSapPrimitiveReq(
                    in template (value) IN_UNITDATA_request p_inUnitdataRq
                ) := {
                    spRef := 0, 
                    servPrimitive := { IN_UNITDATA_request := p_inUnitdataRq } 
                } // End of template m_fntpInSapPrimitiveReq

			} // End of group sendOperation
            
            group recvOperation {

                /**
                 * @desc    Receive template
				 * Generic template for notifications from a CI via the IN-SAP
                 * @see     ISO 21218 - Clause 8.3.1
                 */
                template INsapPrimitivesUp mw_InSapPrimitiveUp_any := {
                    spRef := ?, 
                    servPrimitive := ? 
                } // End of template mw_InSapPrimitiveUp_any

				/**
                 * @desc    Receive template
				 * IN-UNITDATA.indication to notify reception of any frame from any CI
                 * @see     ISO 21218 - Clause 8.3.1
                 */
                template INsapPrimitivesUp mwd_inUnitDataInd_any modifies mw_InSapPrimitiveUp_any:= {
                    spRef := 0, 
                    servPrimitive := { IN_UNITDATA_indication := ? } 
                } // End of template mwd_inUnitDataInd_any

				/**
                 * @desc    Receive template
				 * IN-UNITDATA.indication to notify reception of an expected frame given by p_inUnitdataInd
                 * @param   p_inUnitdataInd:  The IN-UNITDATA.indication primitive
                 * @see     ISO 21218 - Clause 8.3.1
                 */
                template INsapPrimitivesUp mwd_inUnitDataInd(
                    in template (value) IN_UNITDATA_indication p_inUnitdataInd
                ) modifies mwd_inUnitDataInd_any:= {
                    spRef := 0, 
                    servPrimitive := { IN_UNITDATA_indication := p_inUnitdataInd } 
                }  // End of template mwd_inUnitDataInd
				
				/**
                 * @desc    Receive template
				 * IN-UNITDATA-Status.indication to notify any status of any previous transmission request
                 * @see     ISO 21218 - Clause 8.3.1
                 */
                template INsapPrimitivesUp mw_inUnitDataStatusInd_any := {
                    spRef := 1, 
                    servPrimitive := { IN_UNITDATA_STATUS_indication := ? } 
                } // End of template mw_inUnitDataStatusInd_any

				/**
                 * @desc    Receive template
				 * IN-UNITDATA-Status.indication to notify an expected status of a previous transmission request
				 * given by p_inUnitdataStatusInd
                 * @param   p_inUnitdataStatusInd:  The IN-UNITDATA-Status.indication primitive
                 * @see     ISO 21218 - Clause 8.3.1
                 */
                template INsapPrimitivesUp mwd_inUnitDataStatusInd(
                    in template (value) IN_UNITDATA_STATUS_indication p_inUnitdataStatusInd
                ) modifies mw_inUnitDataStatusInd_any := {
                    spRef := 1, 
                    servPrimitive := { IN_UNITDATA_STATUS_indication := p_inUnitdataStatusInd } 
                } // End of template mw_inUnitDataStatusInd

			} // End of group recvOperation

            group auxiliary {

                /**
                 * @desc IN-UNITDATA.indication primitive
                 * @param p_insap_source_address    Source linkId
                 * @param p_insap_dest_address      Destination linkId
                 * @param p_inData                  Data in octetstring format
				 * @param p_priority				User Priority
				 * @param p_accessParameters		Access Parameters
                 * @see   ISO 21218 - Clause 8.3.3
                 */
                template (value) IN_UNITDATA_indication mw_inUnitDataInd( 
                    in template LLserviceAddr p_insapSourceAddress, 
                    in template LLserviceAddr p_insapDestAddress, 
                    in template INdata p_inData,
					in template UserPriority p_priority,
					in template AccessParameters p_accessParameters
                ) := { 
                    source_addr    := p_insapSourceAddress,
                    dest_addr := p_insapDestAddress,
                    data := p_inData,
                    priority := p_priority,
                    accessParams := p_accessParameters 
                } // End of template m_inUnitDataInd
				
                /**
                 * @desc Send template
				 * IN-UNITDATA.request primitive
                 * @param p_insap_source_address    Source linkId
                 * @param p_insap_dest_address      Destination linkId
                 * @param p_inData                  Data in octetstring format
				 * @param p_priority				User Priority
				 * @param p_accessParameters		Access Parameters
                 * @see   ISO 21218 - Clause 8.3.3
                 */
                template (value) IN_UNITDATA_indication m_inUnitDataInd( 
                    in template LLserviceAddr p_insapSourceAddress, 
                    in template LLserviceAddr p_insapDestAddress, 
                    in template INdata p_inData,
					in template UserPriority p_priority,
					in template AccessParameters p_accessParameters
                ) := { 
                    source_addr    := p_insapSourceAddress,
                    dest_addr := p_insapDestAddress,
                    data := p_inData,
                    priority := p_priority,
                    accessParams := p_accessParameters 
                } // End of template m_inUnitDataInd

                /**
                 * @desc    Send template
				 * LLserviceAddr (IN-SAP source and destination address)
                 * @param   p_inSAPaddress    DSAP/SSAP address of the N&T layer protocol
                 * @param   p_linkId          Link identifier of the CI
                 * @see     ISO 21218 - Clause 8.2.2
                 */
                template (value) LLserviceAddr m_llServiceAddr(
                    in template IN_SAPaddress p_inSAPaddress,
					in template Link_ID p_linkId
                ) := {
                    csap := p_inSAPaddress,
                    linkID := p_linkId
                } //  // End of template m_llServiceAddr

                /**
                 * @desc    Send template 
				 * Link-ID
                 * @param   p_remoteLinkId  Remote link ID
                 * @param   p_localLinkId   Local link ID
                 * @see     ISO 21218 - Clause 8.2.2
                 */
                template (value) Link_ID m_linkId(
                    in template EUI64 p_remoteLinkId,
                    in template EUI64 p_localLinkId
                ) := {
                    remoteCIID := p_remoteLinkId,
                    localCIID := p_localLinkId
                } // End of template m_linkID
 				
			} // End of group auxiliary

        } // End of group inSapPrimitives

        group miSapPrimitives {

            group miCommand {
				
				group miCommandRequest {
				
					/**
                	* @desc Generic send template for MI-COMMAND.request service primitive
                	* @param   p_linkID		   Link-ID of VCI / CI. 
                	* @param   p_commandRef    Unique cyclic reference number of command. 
                	* @param   p_ref           Unique reference number of command.
					* @param   p_commandParam  Content of command
                	*/
                	template (value) MI_Command_request m_miCommandRequest( 
						in template (value) Link_ID p_linkID, 
						in template (value) CommandRef p_commandRef, 
                    	in template (value) integer p_ref, 
                    	in template (value) anytype p_commandParam 
                	) := { 
                    	linkID := p_linkID,
						commandRef := p_commandRef, 
						ref := p_ref,
						command_param := p_commandParam
                	} // End of template m_miCommandRequest

					/**
                	* @desc Generic receive template for MI-COMMAND.request service primitive
                	*/
                	template (present) MI_Command_request mw_miCommandRequest_any := { 
                    	linkID := ?,
						commandRef := ?, 
						ref := ?,
						command_param := ?
                	} // End of template m_miCommandRequest
				
				} // end of group miCommandRequest

				group miCommandConfirm {
					
					/**
                	* @desc Generic send template for MI-COMMAND.confirm service primitive
                	* @param   p_linkID		   Link-ID of VCI / CI. 
                	* @param   p_commandRef    Unique cyclic reference number of command. 
                	* @param   p_errorStatus   Unique identifier of error status.
                	*/
                	template (value) MI_Command_confirm m_miCommandConfirm( 
						in template (value) Link_ID p_linkID, 
						in template (value) CommandRef p_commandRef, 
                    	in template (value) ErrStatus p_errorStatus 
                	) := { 
                    	linkID := p_linkID,
						commandRef := p_commandRef, 
						errStatus := p_errorStatus
                	} // End of template m_miCommandConfirm

					/**
                	* @desc Generic receive template for MI-COMMAND.confirm service primitive
                	*/
                	template (present) MI_Command_confirm mw_miCommandConfirm_any := { 
                    	linkID := ?,
						commandRef := ?, 
						errStatus := ?
                	} // End of template m_miCommandRequest
					

				} // end of group miCommandConfirm
					
			} // End of group miCommand
	
            group miRequest {
				
				group miRequestRequest {
				
					/**
                	* @desc Generic send template for MI-REQUEST.request service primitive
                	* @param   p_linkID		   Link-ID of VCI / CI. 
                	* @param   p_commandRef    Unique cyclic reference number of command. 
                	* @param   p_ref           Unique reference number of command.
					* @param   p_commandParam  Content of command
                	*/
                	template (value) MI_Request_request m_miRequestRequest( 
						in template (value) Link_ID p_linkID, 
						in template (value) CommandRef p_commandRef, 
                    	in template (value) integer p_ref, 
                    	in template (value) anytype p_requestParam 
                	) := { 
                    	linkID := p_linkID,
						commandRef := p_commandRef, 
						ref := p_ref,
						request_param := p_requestParam
                	} // End of template m_miRequestRequest

					/**
                	* @desc Generic receive template for MI-REQUEST.request service primitive
                	*/
                	template (present) MI_Request_request mw_miRequestRequest_any := { 
                    	linkID := ?,
						commandRef := ?, 
						ref := ?,
						request_param := ?
                	} // End of template m_miRequestRequest
				
				} // end of group miRequestRequest

				group miRequestConfirm {
					
					/**
                	* @desc Generic send template for MI-REQUEST.confirm service primitive
                	* @param   p_linkID		   Link-ID of VCI / CI. 
                	* @param   p_commandRef    Unique cyclic reference number of command. 
                	* @param   p_errorStatus   Unique identifier of error status.
                	*/
                	template (value) MI_Request_confirm m_miRequestConfirm( 
						in template (value) Link_ID p_linkID, 
						in template (value) CommandRef p_commandRef, 
                    	in template (value) ErrStatus p_errorStatus 
                	) := { 
                    	linkID := p_linkID,
						commandRef := p_commandRef, 
						errStatus := p_errorStatus
                	} // End of template m_miRequestConfirm

					/**
                	* @desc Generic receive template for MI-REQUEST.confirm service primitive
                	*/
                	template (present) MI_Request_confirm mw_miRequestConfirm_any := { 
                    	linkID := ?,
						commandRef := ?, 
						errStatus := ?
                	} // End of template m_miRequestRequest
					

				} // end of group miRequestConfirm
				
			} // End of group miRequest
	
            group miGet {
				
				group miGetRequest {

	               /**
    	             * @desc Generic send template for MI-GET.request service primitive
        	         * @param   p_linkID        Link ID of the peer station
            	     * @param   p_commandRef    Unique cyclic reference number of command. Same value as in related MN-REQUEST.request
                	 * @param   p_getParamNo	List of reference numbers of parameters to be retrieved
                	 * @see ISO 24102-3 6.3.1 MI-GET.request
                	 * @see ISO 21218 Annex A (normative) I parameters
                	 */
                	template (value) MI_Get_request m_miGetRequest( 
                    	in template (value) Link_ID p_linkId,
                    	in template (value) CommandRef p_commandRef,
                    	in template (value) IParamNoList p_getParamNo
                	) := {
                    	linkID := p_linkId, 
                    	commandRef := p_commandRef, 
                    	get_param_no := p_getParamNo
                	} // End of template m_miGetRequest
					
	               /**
    	             * @desc Generic receive template for MI-GET.request service primitive
        	         * @param   p_linkID        Link ID of the peer station
            	     * @param   p_commandRef    Unique cyclic reference number of command. Same value as in related MN-REQUEST.request
                	 * @param   p_getParamNo	List of reference numbers of parameters to be retrieved
                	 * @see ISO 24102-3 6.3.1 MI-GET.request
                	 * @see ISO 21218 Annex A (normative) I parameters
                	 */
                	template (present) MI_Get_request mw_miGetRequest_any := {
                    	linkID := ?, 
                    	commandRef := ?, 
                    	get_param_no := ?
                	} // End of template mw_miGetRequest
					
				} // end of group miGetRequest
			
				group miGetConfirm {

	               /**
    	             * @desc Generic send template for MI-GET.confirm service primitive
        	         * @param   p_linkID        Link ID of the peer station
            	     * @param   p_commandRef    Unique cyclic reference number of command. Same value as in related MN-REQUEST.request
                	 * @param   p_getParam	    List of reference parameters returned
                	 * @see ISO 24102-3 6.3.1 MI-GET.confirm
                	 * @see ISO 21218 Annex A (normative) I parameters
                	 */
                	template (value) MI_Get_confirm m_miGetConfirm( 
                    	in template (value) Link_ID p_linkId,
                    	in template (value) CommandRef p_commandRef,
                    	in template (value) IParamList p_getParam
                	) := {
                    	linkID := p_linkId, 
                    	commandRef := p_commandRef, 
                    	get_param := p_getParam
                	} // End of template m_miGetConfirm
					
	               /**
    	             * @desc Generic receive template for MI-GET.confirm service primitive
        	         * @param   p_linkID        Link ID of the peer station
            	     * @param   p_commandRef    Unique cyclic reference number of command. Same value as in related MN-REQUEST.request
                	 * @param   p_getParam		List of reference parameters returned
                	 * @see ISO 24102-3 6.3.1 MI-GET.confirm
                	 * @see ISO 21218 Annex A (normative) I parameters
                	 */
                	template (present) MI_Get_confirm mw_miGetConfirm_any := {
                    	linkID := ?, 
                    	commandRef := ?, 
                    	get_param := ?
                	} // End of template mw_miGetConfirm
					
				} // end of group miGetConfirm

			} // End of group miGet

            group miSet {
				
				group miSetRequest {

	               /**
    	             * @desc Generic send template for MI-SET.request service primitive
        	         * @param   p_linkID        Link ID of the peer station
            	     * @param   p_commandRef    Unique cyclic reference number of command. Same value as in related MN-REQUEST.request
                	 * @param   p_setParam		List of parameters to be set
                	 * @see ISO 24102-3 6.3.1 MI-SET.request
                	 * @see ISO 21218 Annex A (normative) I parameters
                	 */
                	template (value) MI_Set_request m_miSetRequest( 
                    	in template (value) Link_ID p_linkId,
                    	in template (value) CommandRef p_commandRef,
                    	in template (value) IParamList p_setParam
                	) := {
                    	linkID := p_linkId, 
                    	commandRef := p_commandRef, 
                    	set_param := p_setParam
                	
				   } // End of template m_miGetRequest
					
	               /**
    	             * @desc Generic receive template for MI-SET.request service primitive
        	         * @param   p_linkID        Link ID of the peer station
            	     * @param   p_commandRef    Unique cyclic reference number of command. Same value as in related MN-REQUEST.request
                	 * @param   p_setParam		List of parameters to be set
                	 * @see ISO 24102-3 6.3.1 MI-SET.request
                	 * @see ISO 21218 Annex A (normative) I parameters
                	 */
                	template (present) MI_Set_request mw_miSetRequest_any := {
                    	linkID := ?, 
                    	commandRef := ?, 
                    	set_param := ?
                	} // End of template mw_miGetRequest
					
				} // end of group miGetRequest

				group miSetConfirm {

	               /**
    	             * @desc Generic send template for MI-SET.confirm service primitive
        	         * @param   p_linkID        Link ID of the peer station
            	     * @param   p_commandRef    Unique cyclic reference number of command. Same value as in related MN-REQUEST.request
                	 * @param   p_errors		List of errors
                	 * @see ISO 24102-3 6.3.1 MI-SET.confirm
                	 * @see ISO 21218 Annex A (normative) I parameters
                	 */
                	template (value) MI_Set_confirm m_miSetConfirm( 
                    	in template (value) Link_ID p_linkId,
                    	in template (value) CommandRef p_commandRef,
                    	in template (value) IErrorsList p_errors
                	) := {
                    	linkID := p_linkId, 
                    	commandRef := p_commandRef, 
                    	errors := p_errors
                	
				    } // End of template m_miSetConfirm

	               /**
    	             * @desc Generic receive template for MI-SET.confirm service primitive
        	         * @param   p_linkID        Link ID of the peer station
            	     * @param   p_commandRef    Unique cyclic reference number of command. Same value as in related MN-REQUEST.request
                	 * @param   p_errors		List of errors
                	 * @see ISO 24102-3 6.3.1 MI-SET.confirm
                	 * @see ISO 21218 Annex A (normative) I parameters
                	 */
                	template (present) MI_Set_confirm mw_miSetConfirm_any := {
                    	linkID := ?, 
                    	commandRef := ?, 
                    	errors := ?
                	} // End of template mw_miGetConfirm
					
				} // end of group miGetConfirm

			} // End of group miSet

		} // end of group miSapPrimitives
	
	} // End of module LibItsAtsp_Templates
 No newline at end of file