<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE testmodule SYSTEM "testmodule.dtd" [
<!ENTITY gWait "10000" > 
<!ENTITY gTesterNode "0xFA" > ]>
<testmodule title="J1939 Test Module" version="1.0">

  <testgroup title="J1939-82 07/04 A.3.1 Data Link Transmit Tests - General">
    <testcase ident="J1939-82 07/04 A.3.1.1" title="Position and order of PGN in the 29-bit Frame Header">
      <description>Verify proper placement of PGN within 29-bit header of all frames</description>
      <externalref type="url">J1939-82 07/04 A.3.1.1</externalref>
      <constraints>
        <j1939_messages_known context="pgn">
          <sender>
            <j1939_node name="EAS"/>
          </sender>
        </j1939_messages_known>
      </constraints>
      <initialize title="Request TX Parameter Groups from node">
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>254</eq>
          </byte>
          <byte pos="0">
            <eq>202</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>254</eq>
          </byte>
          <byte pos="0">
            <eq>203</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>255</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>255</eq>
          </byte>
          <byte pos="0">
            <eq>1</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>238</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>236</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>235</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>232</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
      </initialize>
      <untilend title="Allow the test to run a specified time" wait="&gWait;"/>
    </testcase>
    <testcase ident="J1939-82 07/04 A.3.1.2" title="Use of EDP Bit to identify PGN ">
      <description>Verify DUT properly sets the EDP Bit for all 29-bit frames.</description>
      <externalref type="url">J1939-82 07/04 A.3.1.2</externalref>
      <constraints>
        <j1939_messages_known context="edp">
          <sender>
            <j1939_node name="EAS"/>
          </sender>
        </j1939_messages_known>
      </constraints>
      <initialize title="Request TX Parameter Groups from node">
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>254</eq>
          </byte>
          <byte pos="0">
            <eq>202</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>254</eq>
          </byte>
          <byte pos="0">
            <eq>203</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>255</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>255</eq>
          </byte>
          <byte pos="0">
            <eq>1</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>238</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>236</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>235</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>232</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
      </initialize>
      <untilend title="Allow the test to run a specified time" wait="&gWait;"/>
    </testcase>
    <testcase ident="J1939-82 07/04 A.3.1.3" title="Use of DP Bit to identify PGN">
      <description>Verify DUT properly sets the DP Bit for all 29-bit frames.      </description>
      <externalref type="url">J1939-82 07/04 A.3.1.3</externalref>
      <constraints>
        <j1939_messages_known context="dp">
          <sender>
            <j1939_node name="EAS"/>
          </sender>
        </j1939_messages_known>
      </constraints>
      <initialize title="Request TX Parameter Groups from node">
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>254</eq>
          </byte>
          <byte pos="0">
            <eq>202</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>254</eq>
          </byte>
          <byte pos="0">
            <eq>203</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>255</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>255</eq>
          </byte>
          <byte pos="0">
            <eq>1</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>238</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>236</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>235</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>232</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
      </initialize>
      <untilend title="Allow the test to run a specified time" wait="&gWait;"/>
    </testcase>
    <testcase ident="J1939-82 07/04 A.3.1.4" title="Data Field Byte Length">
      <description>Verify the length of the data field for all 29-bit Frames (Page 1 and 2) is 8 bytes, except for PGN 59904 frames.</description>
      <externalref type="url">J1939-82 07/04 A.3.1.4</externalref>
      <constraints>
        <j1939_rules_specific context="dlc">
          <sender>
            <j1939_node name="EAS"/>
          </sender>
        </j1939_rules_specific>
      </constraints>
      <initialize title="Request TX Parameter Groups from node">
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>254</eq>
          </byte>
          <byte pos="0">
            <eq>202</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>254</eq>
          </byte>
          <byte pos="0">
            <eq>203</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>255</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>255</eq>
          </byte>
          <byte pos="0">
            <eq>1</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>238</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>236</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>235</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>232</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
      </initialize>
      <untilend title="Allow the test to run a specified time" wait="&gWait;"/>
    </testcase>
    <testcase ident="J1939-82 07/04 A.3.1.5" title="Byte Ordering within Data Field">
      <description>Verify proper byte ordering of the parameter data for multiple byte parameters.  (e.g. Verify Address Claim data, PGN 60928).  This verification also applies to -7X.</description>
      <externalref type="url">J1939-82 07/04 A.3.1.5</externalref>
      <constraints>
        <j1939_rules_specific context="byteOrder">
          <sender>
            <j1939_node name="EAS"/>
          </sender>
        </j1939_rules_specific>
      </constraints>
      <initialize title="Request Address Claim (ACL) Parameter Group from node">
        <j1939_pg id="59904" receiveNode="EAS">
          <byte pos="2">
            <eq>0</eq>
          </byte>
          <byte pos="1">
            <eq>238</eq>
          </byte>
          <byte pos="0">
            <eq>0</eq>
          </byte>
        </j1939_pg>
      </initialize>
      <untilend title="Allow the test to run a specified time" wait="&gWait;"/>
    </testcase>
    <testcase ident="J1939-82 07/04 A.3.1.6" title="Multipacket capable PGN with less than 9 bytes of data sent as single CAN Data Frame with 8 byte data field.">
      <description>Verify DUT indeed uses single CAN Frame to send PGN under this situation.
Verify any unused bytes are filled with $FF.</description>
      <externalref type="url">J1939-82 07/04 A.3.1.6</externalref>
      <constraints>
        <j1939_rules_specific context="TPDataMinDLC">
          <sender>
            <j1939_node name="EAS"/>
          </sender>
        </j1939_rules_specific>
      </constraints>
      <testerconfirmation timeoutresult="passed" title="Query node to send multipacket capable PGN with less than 9 bytes of data" wait="60s">Setup DUT to meet the following conditions: 
Query node to send multipacket capable PGN with less than 9 bytes of data</testerconfirmation>
      <untilend title="Allow the test to run a specified time" wait="&gWait;"/>
    </testcase>
    <testcase ident="J1939-82 07/04 A.3.1.7" title="Request Scheduling">
      <description>Verify the DUT does not send a Request message for a PGN if that PGN was received with the last 50 mS</description>
      <externalref type="url">J1939-82 07/04 A.3.1.7</externalref>
      <constraints>
        <j1939_request_violation context="inhibitTime">
          <j1939_node name="EAS"/>
        </j1939_request_violation>
      </constraints>
      <testerconfirmation timeoutresult="passed" title="Query node to continually send requests for Parameter Groups" wait="60s">Setup DUT to meet the following conditions: 
Query node to continually send requests for Parameter Groups</testerconfirmation>
      <untilend title="Allow the test to run a specified time" wait="&gWait;"/>
    </testcase>
    <testcase ident="J1939-82 07/04 A.3.1.8" title="Request Retries">
      <description>Verify the DUT stops sending the same Request message after the third attempt (second retry).  A Request retry is issued following a Response Timeout (Tr) failure.</description>
      <externalref type="url">J1939-82 07/04 A.3.1.8</externalref>
      <constraints>
        <j1939_request_violation context="retries">
          <j1939_node name="EAS"/>
        </j1939_request_violation>
      </constraints>
      <testerconfirmation timeoutresult="passed" title="Query node to send requests for Parameter Groups which are not sent in response" wait="60s">Setup DUT to meet the following conditions: 
Query node to send requests for Parameter Groups which are not sent in response</testerconfirmation>
      <untilend title="Allow the test to run a specified time" wait="&gWait;"/>
    </testcase>
  </testgroup>

</testmodule>
