Loading ttcn/TraceParser/MainModule.ttcn3 +33 −10 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ module MainModule { var integer v_startTS := 0; var template (present) LinkId v_linkId := ?; var boolean v_receivedLinkId := false; var boolean v_actionAtOBU := false; var NrOfEmptyMsg v_nrOfEmptyMsg := 0; var PayloadStructure v_receivedMsg; Loading @@ -20,6 +21,7 @@ module MainModule { //--- v_startTS := v_ts; transactionRSUTimer.start; compPort.send(true); repeat; } [] compPort.receive(v_linkId) -> value v_linkId{ Loading @@ -28,6 +30,11 @@ module MainModule { transactionRSUTimer.start; repeat; } [] compPort.receive(true){ v_actionAtOBU := true; repeat; } [v_startTS!=0 and v_receivedLinkId == true] rsuPort.receive(mw_releaseMsg(v_linkId)) -> sender v_ts value v_receivedMsg{ // when the release message was received take it's time stamp and calculate the transaction time // inform the rsu component Loading Loading @@ -85,7 +92,14 @@ module MainModule { stop; } [] transactionRSUTimer.timeout { setverdict (inconc, "No RSU message was received"); if(v_actionAtOBU) {setverdict (fail, "Transaction incomplete!");} else {if(v_startTS==0) {setverdict (fail, "Transaction empty!");} else {setverdict (fail);} } compPort.send(m_stop); stop; } Loading @@ -94,15 +108,15 @@ module MainModule { function f_obuBehaviour() runs on ObuType { var boolean v_sentLinkId := false; var boolean v_actionAtRSU := false; var PayloadStructure v_msg; var NrOfEmptyMsg v_cntEmpty := 0; var template (present) LinkId v_linkId := ?; timer t_obuTimer := 2.0; t_obuTimer.start; transactionOBUTimer.start; alt{ []obuPort.receive(mw_msg_withLinkId(v_linkId)) -> value v_msg{ t_obuTimer.stop; transactionOBUTimer.stop; //--- commmunOBURSUPort.send(v_msg); //--- Loading @@ -111,23 +125,29 @@ module MainModule { compPort.send(valueof(v_linkId)); } v_sentLinkId := true; t_obuTimer.start; transactionOBUTimer.start; compPort.send(true); repeat; } []obuPort.receive(mw_msg_empty) ->value v_msg{ t_obuTimer.stop; transactionOBUTimer.stop; //--- commmunOBURSUPort.send(v_msg); //--- v_cntEmpty := v_cntEmpty +1; t_obuTimer.start; transactionOBUTimer.start; repeat; } []obuPort.receive{ t_obuTimer.stop; transactionOBUTimer.stop; setverdict (inconc, "Unexpected message received."); stop; } [] compPort.receive(true){ v_actionAtRSU := true; repeat; } []compPort.receive(m_stop) { compPort.send(v_cntEmpty); if (v_cntEmpty <= PX_MAX_NUM_EMPTY_UPLINK_FRAMES){ Loading @@ -141,8 +161,11 @@ module MainModule { } stop; } []t_obuTimer.timeout{ setverdict(inconc, "No OBU messaged received"); []transactionOBUTimer.timeout{ if(v_actionAtRSU) {setverdict(fail, "No OBU message received");} else {setverdict(fail);} stop; } } Loading ttcn/TraceParser/TraceParserSystem.ttcn3 +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ module TraceParserSystem { port TraceMsgPortType rsuPort; port CompPortType compPort; port CommunPortOBURSUType commmunOBURSUPort; timer transactionRSUTimer := 1.0 ; timer transactionRSUTimer := 1.5 ; } type component ObuType { //upLinkType Loading Loading
ttcn/TraceParser/MainModule.ttcn3 +33 −10 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ module MainModule { var integer v_startTS := 0; var template (present) LinkId v_linkId := ?; var boolean v_receivedLinkId := false; var boolean v_actionAtOBU := false; var NrOfEmptyMsg v_nrOfEmptyMsg := 0; var PayloadStructure v_receivedMsg; Loading @@ -20,6 +21,7 @@ module MainModule { //--- v_startTS := v_ts; transactionRSUTimer.start; compPort.send(true); repeat; } [] compPort.receive(v_linkId) -> value v_linkId{ Loading @@ -28,6 +30,11 @@ module MainModule { transactionRSUTimer.start; repeat; } [] compPort.receive(true){ v_actionAtOBU := true; repeat; } [v_startTS!=0 and v_receivedLinkId == true] rsuPort.receive(mw_releaseMsg(v_linkId)) -> sender v_ts value v_receivedMsg{ // when the release message was received take it's time stamp and calculate the transaction time // inform the rsu component Loading Loading @@ -85,7 +92,14 @@ module MainModule { stop; } [] transactionRSUTimer.timeout { setverdict (inconc, "No RSU message was received"); if(v_actionAtOBU) {setverdict (fail, "Transaction incomplete!");} else {if(v_startTS==0) {setverdict (fail, "Transaction empty!");} else {setverdict (fail);} } compPort.send(m_stop); stop; } Loading @@ -94,15 +108,15 @@ module MainModule { function f_obuBehaviour() runs on ObuType { var boolean v_sentLinkId := false; var boolean v_actionAtRSU := false; var PayloadStructure v_msg; var NrOfEmptyMsg v_cntEmpty := 0; var template (present) LinkId v_linkId := ?; timer t_obuTimer := 2.0; t_obuTimer.start; transactionOBUTimer.start; alt{ []obuPort.receive(mw_msg_withLinkId(v_linkId)) -> value v_msg{ t_obuTimer.stop; transactionOBUTimer.stop; //--- commmunOBURSUPort.send(v_msg); //--- Loading @@ -111,23 +125,29 @@ module MainModule { compPort.send(valueof(v_linkId)); } v_sentLinkId := true; t_obuTimer.start; transactionOBUTimer.start; compPort.send(true); repeat; } []obuPort.receive(mw_msg_empty) ->value v_msg{ t_obuTimer.stop; transactionOBUTimer.stop; //--- commmunOBURSUPort.send(v_msg); //--- v_cntEmpty := v_cntEmpty +1; t_obuTimer.start; transactionOBUTimer.start; repeat; } []obuPort.receive{ t_obuTimer.stop; transactionOBUTimer.stop; setverdict (inconc, "Unexpected message received."); stop; } [] compPort.receive(true){ v_actionAtRSU := true; repeat; } []compPort.receive(m_stop) { compPort.send(v_cntEmpty); if (v_cntEmpty <= PX_MAX_NUM_EMPTY_UPLINK_FRAMES){ Loading @@ -141,8 +161,11 @@ module MainModule { } stop; } []t_obuTimer.timeout{ setverdict(inconc, "No OBU messaged received"); []transactionOBUTimer.timeout{ if(v_actionAtRSU) {setverdict(fail, "No OBU message received");} else {setverdict(fail);} stop; } } Loading
ttcn/TraceParser/TraceParserSystem.ttcn3 +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ module TraceParserSystem { port TraceMsgPortType rsuPort; port CompPortType compPort; port CommunPortOBURSUType commmunOBURSUPort; timer transactionRSUTimer := 1.0 ; timer transactionRSUTimer := 1.5 ; } type component ObuType { //upLinkType Loading