ykushcmd-reference-ykushxs.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <h1>YKUSHXS Board Commands</h1>
  2. <div class="reference_page_toc">
  3. <ul>
  4. <li><a href="#command_overview">Command overview</a></li>
  5. <li><a href="#list_attached_example">List attached boards</a></li>
  6. <li><a href="#switch_command_example">Downstream port On/Off switching</a></li>
  7. <li><a href="#switch_state_command_example">Port switching state</a></li>
  8. </ul>
  9. </div>
  10. <h2 id="command_overview">Command overview</h2>
  11. <p>YKUSHXS board commands have the following structure.</p>
  12. <p class="command_line">ykushcmd ykushxs [-s serial_number] [OPTION]</p>
  13. <p>Where:</p>
  14. <table cellpadding="10">
  15. <tr>
  16. <td width="30%" valign="top">-s serial_number</td>
  17. <td>
  18. Board serial number to which the command is addressed.
  19. When multiple YKUSH boards are connected to a host, this option should be used
  20. to specify the board. If more than one board is connected and this option is not
  21. provided the command will be sent to the first board in the USB enumeration list.
  22. </td>
  23. </tr>
  24. <tr>
  25. <td valign="top">-l</td>
  26. <td>
  27. List attached YKUSHXS boards.
  28. The serial number of each board attached to the host will be displayed.
  29. </td>
  30. </tr>
  31. <tr>
  32. <td>-d</td>
  33. <td>
  34. Power Down/Off the downstream port.
  35. </td>
  36. </tr>
  37. <tr>
  38. <td>-u</td>
  39. <td>
  40. Power Up/On the downstream port.
  41. </td>
  42. </tr>
  43. <tr>
  44. <td>-g</td>
  45. <td>
  46. Get downstream port state.
  47. </td>
  48. </tr>
  49. </table>
  50. <h2 id="list_attached_example">List attached boards</h2>
  51. <p>
  52. The <b>[-l]</b> option is used to list all attached YKUSHXS boards.
  53. All YKUSH board have unique serial numbers which are displayed when this option is used.
  54. </p>
  55. <pre>
  56. <code class="language-bash">
  57. #list the serial number for each of the attached YKUSHXS boards
  58. $ ykushcmd ykushxs -l
  59. Attached YKUSHXS Boards:
  60. 1. Board found with serial number: YK17125
  61. 2. Board found with serial number: YK21493
  62. </code>
  63. </pre>
  64. <h2 id="switch_command_example">Downstream port On/Off switching</h2>
  65. <p>
  66. When only one YKUSHXS board is attached to the host the <b>[-s serial_number]</b> option is not required.
  67. Bellow are some examples.
  68. </p>
  69. <pre>
  70. <code class="language-bash">
  71. #power-down the downstream port
  72. $ ykushcmd ykushxs -d
  73. #power-up the downstream port
  74. $ ykushcmd ykushxs -u
  75. </code>
  76. </pre>
  77. <p>
  78. If more than one YKUSHXS board is attached to the host the <b>[-s serial_number]</b> option should be used.
  79. Bellow are some examples.
  80. </p>
  81. <pre>
  82. <code class="language-bash">
  83. #list the serial number for each of the attached YKUSHXS boards
  84. $ ykushcmd ykushxs -l
  85. Attached YKUSHXS Boards:
  86. 1. Board found with serial number: YK17125
  87. 2. Board found with serial number: YK21493
  88. #power-down the downstream port of the board with serial number YK17125
  89. $ ykushcmd ykushxs -s YK17125 -d
  90. </code>
  91. </pre>
  92. <h2 id="switch_state_command_example">Port switching state</h2>
  93. <p>
  94. The current switching state of each downstream port can be fetched from the YKUSH board using the <b>[-g 1|2|3]</b> option.
  95. </p>
  96. <pre>
  97. <code class="language-bash">
  98. #State of the downstream port
  99. $ ykushcmd ykushxs -g
  100. Downstream port is ON
  101. #power-down the downstream port
  102. $ ykushcmd ykushxs -d
  103. #State of downstream port
  104. $ ykushcmd ykushxs -g
  105. Downstream port is OFF
  106. #list the serial number for each of the attached YKUSHXS boards
  107. $ ykushcmd ykushxs -l
  108. Attached YKUSHXS Boards:
  109. 1. Board found with serial number: YK17125
  110. 2. Board found with serial number: YK21493
  111. #State of the downstream port for the board with serial number YK17125
  112. $ ykushcmd ykushxs -s YK17125 -g
  113. Downstream port is OFF
  114. #power-up the downstream port of the board with serial number YK17125
  115. $ ykushcmd ykushxs -s YK17125 -u
  116. </code>
  117. </pre>