<?xml version="1.0" encoding="UTF-8"?>
<!--
  Device:2 Root Data Model: Common Object definitions [SmartCardReaders]

  Copyright (c) 2010-2021, Broadband Forum

  Redistribution and use in source and binary forms, with or
  without modification, are permitted provided that the following
  conditions are met:

  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above
     copyright notice, this list of conditions and the following
     disclaimer in the documentation and/or other materials
     provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its
     contributors may be used to endorse or promote products
     derived from this software without specific prior written
     permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

  The above license is used as a license under copyright only.
  Please reference the Forum IPR Policy for patent licensing terms
  <https://www.broadband-forum.org/ipr-policy>.

  Any moral rights which are necessary to exercise under the above
  license grant are also deemed granted under this license.

  Comments or questions about this Broadband Forum data model should be
  directed to <info@broadband-forum.org>.
-->

<dm:document
    xmlns:dm="urn:broadband-forum-org:cwmp:datamodel-1-10"
    xmlns:dmr="urn:broadband-forum-org:cwmp:datamodel-report-1-0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
      urn:broadband-forum-org:cwmp:datamodel-1-10
        https://www.broadband-forum.org/cwmp/cwmp-datamodel-1-10.xsd
      urn:broadband-forum-org:cwmp:datamodel-report-1-0
        https://www.broadband-forum.org/cwmp/cwmp-datamodel-report-1-0.xsd"
    spec="urn:broadband-forum-org:tr-181-2-16-0-smartcardreaders"
    file="tr-181-2-16-0-smartcardreaders.xml">

  <import file="tr-069-biblio.xml" spec="urn:broadband-forum-org:tr-069"/>

  <import file="tr-106-types.xml" spec="urn:broadband-forum-org:tr-106">
    <dataType name="Alias" ref="_AliasCommon"/>
  </import>

  <import file="tr-181-2-root.xml"
      spec="urn:broadband-forum-org:tr-181-2-16-root">
    <component name="Root"/>
  </import>

  <component name="SmartCardReaders">

    <object name="Device.SmartCardReaders." access="readOnly" minEntries="1"
        maxEntries="1" version="2.0">
      <description>
        SmartCardReaders object that contains the {{object|SmartCardReader}}
        table.
      </description>

      <parameter name="SmartCardReaderNumberOfEntries" access="readOnly">
        <description>
          {{numentries}}
        </description>
        <syntax>
          <unsignedInt/>
        </syntax>
      </parameter>
    </object>

    <object name="Device.SmartCardReaders.SmartCardReader.{i}."
        access="readOnly" numEntriesParameter="SmartCardReaderNumberOfEntries"
        minEntries="0" maxEntries="unbounded" version="2.0">
      <description>
        This object describes the characteristics of the smart card reader.
      </description>
      <uniqueKey functional="true">
        <parameter ref="Name"/>
      </uniqueKey>
      <uniqueKey functional="false">
        <parameter ref="Alias"/>
      </uniqueKey>

      <parameter name="Alias" access="readWrite" version="2.3">
        <description>
          {{datatype|expand}}
        </description>
        <syntax>
          <dataType ref="Alias"/>
        </syntax>
      </parameter>

      <parameter name="Enable" access="readWrite">
        <description>
          Enables or disables this smart card reader.
        </description>
        <syntax>
          <boolean/>
        </syntax>
      </parameter>

      <parameter name="Status" access="readOnly">
        <description>
          Indicates the status of this smart card reader.
        </description>
        <syntax>
          <string>
            <enumeration value="Disabled"/>
            <enumeration value="Enabled">
              <description>
                Indicates the smart card reader is enabled and functioning
                properly.
              </description>
            </enumeration>
            <enumeration value="Error">
              <description>
                Indicates the smart card reader is enabled and not functioning
                properly.
              </description>
            </enumeration>
          </string>
        </syntax>
      </parameter>

      <parameter name="Name" access="readOnly">
        <description>
          Human-readable name associated with this smart card reader.
        </description>
        <syntax>
          <string>
            <size maxLength="256"/>
          </string>
        </syntax>
      </parameter>

      <parameter name="ResetTime" access="readOnly">
        <description>
          The time at which this SmartCard Reader was reset.

          Reset can be caused by:

          * {{param|Status}} transition from Disabled to Enabled

          * {{template|Reset}}.

          * An internal reset of the SmartCard Reader (including a reboot of
            the device).

          Unknown Time value indicates that this SmartCard Reader has never
          been reset, which can only happen if it has never been enabled.
        </description>
        <syntax>
          <dateTime/>
        </syntax>
      </parameter>

      <parameter name="DecryptionFailedCounter" access="readOnly"
          activeNotify="canDeny">
        <description>
          Counter incremented once each time decryption cannot be carried out.

          This counter relates to the smart card reader, not to the smart card
          itself, i.e. it is reset when the {{template|Reset}} and not when a
          Smart Card is inserted or removed.
        </description>
        <syntax>
          <unsignedInt/>
        </syntax>
      </parameter>

      <parameter name="DecryptionFailedNoKeyCounter" access="readOnly"
          activeNotify="canDeny">
        <description>
          Counter incremented once each time the key is not available to
          decrypt it. This is a subset of the more general
          {{param|DecryptionFailedCounter}} within the same object and thus
          will always be less than that parameter.

          This counter relates to the smart card reader, not to the smart card
          itself, i.e. it is reset when the {{template|Reset}} and not when a
          Smart Card is inserted or removed.
        </description>
        <syntax>
          <unsignedInt/>
        </syntax>
      </parameter>
    </object>

    <object name="Device.SmartCardReaders.SmartCardReader.{i}.SmartCard."
        access="readOnly" minEntries="1" maxEntries="1" version="2.0">
      <description>
        Status of currently associated smart card.
      </description>

      <parameter name="Status" access="readOnly">
        <description>
          Status of the Smart Card.
        </description>
        <syntax>
          <string>
            <enumeration value="None">
              <description>
                Indicates that no Smart Card is inserted.
              </description>
            </enumeration>
            <enumeration value="Running">
              <description>
                Indicates a Smart Card is present and working normally.
              </description>
            </enumeration>
            <enumeration value="Error">
              <description>
                Indicates the Smart Card is present and in an error condition.
              </description>
            </enumeration>
          </string>
        </syntax>
      </parameter>

      <parameter name="Type" access="readOnly">
        <description>
          Smart Card Type. {{enum}}

          Vendors can extend the enumerated values with vendor specific
          extensions, in which case the rules outlined in
          {{bibref|TR-106|Section 3.3}} MUST be adhered to.
        </description>
        <syntax>
          <string>
            <enumeration value="CA"/>
            <enumeration value="DRM"/>
            <enumeration value="UICC"/>
          </string>
        </syntax>
      </parameter>

      <parameter name="Application" access="readOnly">
        <description>
          {{list}} Indicates Smart Card Application(s). {{param}} is only
          relevant when {{param|Type}} has a value of UICC, otherwise it is
          {{empty}}. {{enum}}

          Vendors can extend the enumerated values with vendor specific
          extensions, in which case the rules outlined in
          {{bibref|TR-106|Section 3.3}} MUST be adhered to.
        </description>
        <syntax>
          <list/>
          <string>
            <enumeration value="SIM"/>
            <enumeration value="USIM"/>
            <enumeration value="ISIM"/>
          </string>
        </syntax>
      </parameter>

      <parameter name="SerialNumber" access="readOnly">
        <description>
          The Smart Card Serial Number or {{empty}} if the Smart Card serial
          Number is not available, e.g. in the case of IPTV due to restrictions
          of the Service Delivery Platform.
        </description>
        <syntax>
          <string>
            <size maxLength="256"/>
          </string>
        </syntax>
      </parameter>

      <parameter name="ATR" access="readOnly">
        <description>
          The Smart Card answer to a reset action. Issued by the Smart Card
          upon reset.
        </description>
        <syntax>
          <string>
            <size maxLength="1024"/>
          </string>
        </syntax>
      </parameter>
    </object>
  </component>

  <model name="SmartCardReaders:2.16">
    <component ref="Root"/>
    <component ref="SmartCardReaders"/>
  </model>
</dm:document>
