:tocdepth: 4

.. _serialization-modes:

Serialization Modes
-------------------

Overview
++++++++
Impinj ItemEncode has three serialization modes: TID Table, Ordered List or 
Static. These modes control how the ItemEncode device selects which data to 
encode for a given tag.

.. _tid-table-mode:

TID Table
+++++++++
The TID Table mode is based on selecting a specific set of encoding operations 
for a given TID. The application will provide a 
:ref:`TIDTableEntry<tid-table-entry>` for each tag that will be seen by the 
device. If the ItemEncode device does not have a matching 
:ref:`TIDTableEntry<tid-table-entry>` for a TID that it encounters, it will 
report a :ref:`TagOperationResult<tag-operation-result>` of
TAG_OPERATION_RESULT_FAIL_TID_TABLE_NO_MATCH. When in the 
:ref:`Configuration State<configuration-state>`, the TID Table can be updated 
using the :ref:`AddSerializationJobCommand<add-serialization-job-command>` or 
:ref:`AddTIDTableEntriesCommand<add-tid-table-entries-command>`. The TID Table 
can be updated while the device is in the 
:ref:`Operating State<operating-state>` with the 
:ref:`AddTIDTableEntriesCommand<add-tid-table-entries-command>`. 

.. note:: The :ref:`AddTIDTableEntriesCommand<add-tid-table-entries-command>` can be sent to the ItemEncode device from both a :ref:`Command<command>` or :ref:`Update<update>` message.

.. image:: ../_static/TIDTableDiagram.png
    :align: center
    :scale: 75%

.. _ordered-list-mode:

Ordered List
++++++++++++
The Ordered List serialization mode selects encoding operations based on a first
in, first out list fashion. The application will provide a set of 
:ref:`OrderedListEntry<ordered-list-entry>` objects. The ItemEncode device will
use the first one in the list when it encounters a tag then discard it from the
list. If the ItemEncode device runs out of 
:ref:`OrderedListEntry<ordered-list-entry>`, it will report a 
:ref:`TagOperationResult<tag-operation-result>` of 
TAG_OPERATION_RESULT_FAIL_ORDERED_LIST_EMPTY. When in the 
:ref:`Configuration State<configuration-state>`, the Ordered List can be updated
using the :ref:`AddSerializationJobCommand<add-serialization-job-command>` or 
:ref:`AddOrderedListEntriesCommand<add-ordered-list-entries-command>`. While in
the :ref:`Operating State<operating-state>`, the Ordered List can only be 
updated with the 
:ref:`AddOrderedListEntriesCommand<add-ordered-list-entries-command>`.

.. image:: ../_static/OrderedListDiagram.png
    :align: center
    :scale: 75%

.. _static-mode:

Static
++++++
The simplest ItemEncode serialization mode is Static. It uses the same encoding 
options for all of the tags that it encounters. This is useful when the
application is encoding a population of tags with the same data or with 
:ref:`Monza Self-Serialization<mss-mode>`. The Static encoding configuration can
only be updated using the 
:ref:`AddSerializationJobCommand<add-serialization-job-command>` in the 
:ref:`Configuration State<configuration-state>`.


Combining Serialization Modes
+++++++++++++++++++++++++++++
TID Table and Ordered List modes can be used in conjunction with a Static 
configuration. The Static configuration in the 
:ref:`SerializationJob<serialization-job>` can be used as a default set of 
operations that can be overridden by operations from a 
:ref:`TIDTableEntry<tid-table-entry>` or
:ref:`OrderedListEntry<ordered-list-entry>`.

.. image:: ../_static/CombinedSerialization.png
    :align: center
    :scale: 75%
