【CAPL】检查能唤醒DUT的报文范围

//**********************************************************************************************************
//  Function name : NM_WakeupIDRangeCheck
//  --------------------------------------------------------------------------------------------------------
//  Description   : Check NM message'id that can wakeup the DUT. 
//  --------------------------------------------------------------------------------------------------------
//  Parameter       wakeupID_min         
//                  wakeupID_max      
//                 
//**********************************************************************************************************

export testfunction NM_WakeupIDRange( long wakeupID_min ,  long wakeupID_max , long NMID_DUT )
{
  long Attempt_ID;
  long Counter_WakeupID=0;
  long res;
  
  CheckDUTtoSleep();
    
  for(Attempt_ID=wakeupID_min;Attempt_ID < wakeupID_max;Attempt_ID++)
  {
      OutputAttempID(Attempt_ID);
      
      res=testWaitForMessage(NMID_DUT);
      if(res==1)
        {
          Counter_WakeupID++;
          testStep(0,"","DUT is awakened , Current Attempt_ID = 0x%X  Counter_WakeupID = %d ",Attempt_ID,Counter_WakeupID);
          testWaitForTimeout(8000);
        }
      else
        {
          testStep(0,"","DUT keep sleep , Current Attempt_ID = 0x%X",Attempt_ID);
          testWaitForTimeout(3000);
        }
      
      //运行结果判断
      if(Attempt_ID==wakeupID_max)
      {
           if(Counter_WakeupID==128)
          {
            testStepPass(0,"","PASS");
          }
          else
          {
            testStepFail(0,"","Fail");
          }
      }  
  }
}
//************************************************************************************************* 
//  Function name :  WakeupBusAttemp
//  -----------------------------------------------------------------------------------------------
//  Description   :  Send Messages and try to wake up Network
//  ----------------------------------------------------------------------------------------------- 
//  Parameter     :  
//*************************************************************************************************
export long OutputAttempID(long msgId) //Modify the code according to the project.
{
  long          ret;
  message   *   wakeupAttempMsg;
  wakeupAttempMsg.Id=msgId;
  wakeupAttempMsg.dlc=8;
//  wakeupAttempMsg.CAN=1;
  
  //output Msg try to wakeup DUT.
  output(wakeupAttempMsg);
  ret=testWaitForMessage(wakeupAttempMsg.id,500);
  testWaitForTimeout(50);
  output(wakeupAttempMsg);
  ret=testWaitForMessage(wakeupAttempMsg.id,500);
  return  ret;
}

  • 2
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值