<mxfile host="app.diagrams.net" modified="2024-05-04T17:46:26.021Z" agent="Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0" etag="J9uDqkqhYhETQglfdePv" version="24.2.5" type="device">
  <diagram name="Page-1" id="c8DCrxsxo9briBmbyEJX">
    <mxGraphModel dx="1381" dy="732" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <mxCell id="ICFvIOTHSByscP8Iiz9F-19" value="Commands come from signetdev/host/signetdev.c" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
          <mxGeometry x="230" y="200" width="110" height="71" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="ICFvIOTHSByscP8Iiz9F-1" target="ICFvIOTHSByscP8Iiz9F-5" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-1" value="&lt;div&gt;START&lt;/div&gt;device_state = DS_DISCONNECTED" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
          <mxGeometry x="20" y="20" width="140" height="60" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-2" value="Possible states:&lt;br&gt;DS_DISCONNECTED&lt;br&gt;DS_RESET (defunct)&lt;br&gt;DS_UNINITIALIZED&lt;br&gt;DS_INITIALIZING&lt;br&gt;DS_WIPING&lt;br&gt;DS_ERADING_PAGES&lt;br&gt;DS_FIRMWARE_UPDATE&lt;br&gt;DS_LOGGED_OUT&lt;br&gt;DS_LOGGED_IN&lt;br&gt;DS_BACKING_UP_DEVICE&lt;br&gt;DS_RESTORING_DEVICE&lt;br&gt;DS_BOOTLOADER" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
          <mxGeometry x="20" y="120" width="160" height="190" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-3" value="Command responses:&lt;br&gt;OKAY&lt;br&gt;INVALID_STATE&lt;br&gt;INVALID_INPUT&lt;br&gt;ID_INVALID&lt;br&gt;ID_NOT_OPEN&lt;br&gt;TAG_INVALID&lt;br&gt;WRITE_FAILED&lt;br&gt;NOT_LOGGED_IN&lt;br&gt;NOT_INITIALIZED&lt;br&gt;BAD_PASSWORD&lt;br&gt;IN_PROGRESS&lt;br&gt;NOT_ENOUGH_SPACE&lt;br&gt;DONE&lt;br&gt;BUTTON_PRESS_CANCELED&lt;br&gt;BUTTON_PRESS_TIMEOUT&lt;br&gt;UNKNOWN_DB_FORMAT&lt;br&gt;DEVICE_NOT_WIPED" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
          <mxGeometry x="20" y="320" width="190" height="260" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-4" value="flash_write_complete" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
          <mxGeometry x="601" y="360" width="120" height="60" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ICFvIOTHSByscP8Iiz9F-5" target="ICFvIOTHSByscP8Iiz9F-8" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ICFvIOTHSByscP8Iiz9F-5" target="ICFvIOTHSByscP8Iiz9F-7" edge="1">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-5" value="startup_cmd" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
          <mxGeometry x="230" y="20" width="120" height="60" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-7" value="DS_UNINITIALIZED" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
          <mxGeometry x="230" y="120" width="120" height="60" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-8" value="DS_LOGGED_OUT" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
          <mxGeometry x="400" y="20" width="120" height="60" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-11" value="cmd_packet_recv" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
          <mxGeometry x="420" y="360" width="120" height="60" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-12" value="&lt;div&gt;Sequence (usb rx):&lt;/div&gt;&lt;div&gt;uint16 in size&lt;br&gt;&lt;br&gt;bit 15 = end-of-sequence bit&lt;/div&gt;&lt;div&gt;bits 14-0 = data&lt;br&gt; &lt;/div&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
          <mxGeometry x="290" y="640" width="160" height="80" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-13" value="cmd_packet_buf&lt;br&gt;&lt;div&gt;size = 2122 = (2054 + 6 + 63 - 1)&lt;br&gt;&lt;/div&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
          <mxGeometry x="450" y="630" width="270" height="120" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-14" value="CMD_PACKET_PAYLOAD_SIZE = 2054 (2048+6)&lt;br&gt;CMD_PACKET_HEADER_SIZE = 6&lt;br&gt; RAW_HID_PAYLOAD_SIZE = 63 (64-1)&lt;br&gt;SIGNET_BLK_SIZE = BLK_SIZE = 2048&lt;br&gt;RAW_HID_PACKET_SIZE = 64&lt;br&gt;RAW_HID_HEADER_SIZE = 1&lt;br&gt;RAW_HID_PAYLOAD_SIZE = 63&lt;br&gt;&lt;br&gt;MAX_CMD_PACKET_PAYLOAD_SIZE = ?" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
          <mxGeometry x="441" y="470" width="280" height="140" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-15" value="usb rx endpoints:&lt;br&gt;CONTROL_ENDPOINT&lt;br&gt;CDC_RX_ENDPOINT&lt;br&gt;RAW_HID_RX_ENDPOINT" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
          <mxGeometry x="270" y="870" width="220" height="80" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-16" value="usb tx endpoints:&lt;br&gt;KEYBOARD_ENDPOINT&lt;br&gt;CONTROL_ENDPOINT&lt;br&gt;CDC_TX_ENDPOINT&lt;br&gt;RAW_HID_TX_ENDPOINT" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
          <mxGeometry x="530" y="870" width="220" height="80" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-18" value="Commands:&lt;br&gt;GET_PROGRESS&lt;br&gt;CHANGE_MASTER_PASSWORD&lt;br&gt;BACKUP_DEVICE&lt;br&gt;GET_RAND_BITS&lt;br&gt;READ_UID&lt;br&gt;UPDATE_UIDS&lt;br&gt;UPDATE_UID&lt;br&gt;READ_ALL_UIDS&lt;br&gt;TYPE&lt;br&gt;BUTTON_WAIT&lt;br&gt;LOGOUT&lt;br&gt;UPDATE_FIRMWARE&lt;br&gt;READ_CLEARTEXT_PASSWORD_NAMES&lt;br&gt;READ_CLEARTEXT_PASSWORD&lt;br&gt;WRITE_CLEARTEXT_PASSWORD" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
          <mxGeometry x="20" y="580" width="240" height="250" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-20" value="&lt;div align=&quot;left&quot;&gt;Device commands:&lt;br&gt;SIGNETDEV_CMD_EMULATE_BEGIN&lt;br&gt;SIGNETDEV_CMD_EMULATE_END&lt;br&gt;SIGNETDEV_CMD_OPEN&lt;br&gt;SIGNETDEV_CMD_CLOSE&lt;br&gt;SIGNETDEV_CMD_MESSAGE&lt;br&gt;SIGNETDEV_CMD_QUIT&lt;br&gt;&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;SIGNETDEV_CMD_CANCEL_MESSAGE&lt;br&gt;&lt;/div&gt;&lt;br&gt;see handle_command in signetdev/host/signetdev_linux.c" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
          <mxGeometry x="20" y="830" width="240" height="170" as="geometry" />
        </mxCell>
        <mxCell id="ICFvIOTHSByscP8Iiz9F-21" value="&lt;div align=&quot;left&quot;&gt;Device commands:&lt;br&gt;READ_BLOCK&lt;br&gt;READ_BLOCK_HC&lt;br&gt;READ_CLEARTEXT_PASSWORD&lt;br&gt;READ_CLEARTEXT_PASSWORD_NAMES&lt;br&gt;GET_PROGRESS&lt;br&gt;STARTUP&lt;br&gt;GET_RAND_BITS&lt;br&gt;READ_ALL_UIDS&lt;br&gt;READ_UID&lt;br&gt;&lt;/div&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
          <mxGeometry x="560" y="35" width="250" height="165" as="geometry" />
        </mxCell>
        <mxCell id="wlXdGDks_vq3kZhzqFH9-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="wlXdGDks_vq3kZhzqFH9-1" target="wlXdGDks_vq3kZhzqFH9-2">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="wlXdGDks_vq3kZhzqFH9-1" value="&lt;div&gt;RESTORE_DEVICE /&lt;/div&gt;&lt;div&gt;SIGNETDEV_CMD_BEGIN_DEVICE_RESTORE&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
          <mxGeometry x="40" y="1160" width="290" height="60" as="geometry" />
        </mxCell>
        <mxCell id="wlXdGDks_vq3kZhzqFH9-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="wlXdGDks_vq3kZhzqFH9-2" target="wlXdGDks_vq3kZhzqFH9-11">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="wlXdGDks_vq3kZhzqFH9-2" value="DS_RESTORING_DEVICE" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
          <mxGeometry x="370" y="1160" width="180" height="60" as="geometry" />
        </mxCell>
        <mxCell id="wlXdGDks_vq3kZhzqFH9-3" value="Dev cmd / API cmd" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
          <mxGeometry x="40" y="1130" width="120" height="30" as="geometry" />
        </mxCell>
        <mxCell id="wlXdGDks_vq3kZhzqFH9-4" value="Device state" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
          <mxGeometry x="370" y="1130" width="80" height="30" as="geometry" />
        </mxCell>
        <mxCell id="wlXdGDks_vq3kZhzqFH9-8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="wlXdGDks_vq3kZhzqFH9-6" target="wlXdGDks_vq3kZhzqFH9-7">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="wlXdGDks_vq3kZhzqFH9-6" value="INITIALIZE /&lt;br&gt;SIGNETDEV_CMD_BEGIN_INITIALIZE_DEVICE" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
          <mxGeometry x="40" y="1240" width="290" height="60" as="geometry" />
        </mxCell>
        <mxCell id="wlXdGDks_vq3kZhzqFH9-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="wlXdGDks_vq3kZhzqFH9-7" target="wlXdGDks_vq3kZhzqFH9-9">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="wlXdGDks_vq3kZhzqFH9-7" value="DS_INITIALIZING" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
          <mxGeometry x="370" y="1240" width="180" height="60" as="geometry" />
        </mxCell>
        <mxCell id="wlXdGDks_vq3kZhzqFH9-9" value="DS_LOGGED_OUT" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
          <mxGeometry x="590" y="1240" width="140" height="60" as="geometry" />
        </mxCell>
        <mxCell id="wlXdGDks_vq3kZhzqFH9-11" value="DS_DISCONNECTED" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
          <mxGeometry x="590" y="1160" width="140" height="60" as="geometry" />
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
