<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Smart Cards and Secure ElementのトピックRe: JCShell documentation and examples for DEFUN</title>
    <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1622883#M28</link>
    <description>&lt;P&gt;No this is not the correct syntax. The code sample you just sent me is LISP and JCShell DEFUN does not resemble it. The example on the link you just sent me is this:&lt;/P&gt;&lt;PRE&gt;(defun function-name (arguments…)
  "optional-documentation…"
  (interactive argument-passing-info)     ; &lt;SPAN class=""&gt;optional&lt;/SPAN&gt;
  body…)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and here is an example out of the JCShell documentation:&lt;/P&gt;&lt;PRE&gt;DEFUN GET_SCR_PATH&lt;BR /&gt;/echo ${script.name}&lt;BR /&gt;END&lt;/PRE&gt;&lt;P&gt;As I said in my first message, there is no actual section in the JCShell document that defines the syntax for DEFUN and the examples are not very comprehensive.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2023 01:05:10 GMT</pubDate>
    <dc:creator>makinako</dc:creator>
    <dc:date>2023-03-28T01:05:10Z</dc:date>
    <item>
      <title>JCShell documentation and examples for DEFUN</title>
      <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1622098#M21</link>
      <description>&lt;P&gt;I'm migrating a Java Card applet test structure to make use of JCShell and am having trouble finding documentation or examples on the use of DEFUN. I have a couple of questions out of this:&lt;/P&gt;&lt;P&gt;1) Aside from the JCShell user manual 6.9.0.X which doesn't really cover DEFUN syntax much, are there any further documents or examples that can be made available for more advanced JCShell scripting scenarios?&lt;/P&gt;&lt;P&gt;2) In particular, is it possible to provide arguments to functions defined using DEFUN? If not, is there a convention NXP uses to achieve a similar result?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 00:53:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1622098#M21</guid>
      <dc:creator>makinako</dc:creator>
      <dc:date>2023-03-27T00:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: JCShell documentation and examples for DEFUN</title>
      <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1622167#M23</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/180285"&gt;@makinako&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Such kind of docs are under DNA, have you already signed it with NXP? If not, you may request it on line.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kan_Li_0-1679886734884.png" style="width: 696px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/216289iA5FC93A600D68E30/image-dimensions/696x440?v=v2" width="696" height="440" role="button" title="Kan_Li_0-1679886734884.png" alt="Kan_Li_0-1679886734884.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;BR /&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 03:12:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1622167#M23</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2023-03-27T03:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: JCShell documentation and examples for DEFUN</title>
      <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1622181#M24</link>
      <description>Hi yes I have an active NDA and have the JCOP 4.5 tools which contain JCShell, etc. As I described in my post there is a JCShell user manual, but this has no definition of the usage of DEFUN and no separate example scripts.&lt;BR /&gt;I am unable to find anything beyond this in the Secure Files and in my experience, it is not easy to know what documentation may exist that I do not have access to as there is no listing of available documents until you specifically have them pushed to your account.&lt;BR /&gt;Are you able to provide doc #'s or other references and can you push documents to an existing account with product access, or does this need to go through our account manager?</description>
      <pubDate>Mon, 27 Mar 2023 03:36:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1622181#M24</guid>
      <dc:creator>makinako</dc:creator>
      <dc:date>2023-03-27T03:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: JCShell documentation and examples for DEFUN</title>
      <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1622402#M25</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/180285"&gt;@makinako&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you referring to the following DEFUN info?&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.gnu.org/software/emacs/manual/html_node/eintr/defun.html" target="_blank"&gt;https://www.gnu.org/software/emacs/manual/html_node/eintr/defun.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;BR /&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 08:22:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1622402#M25</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2023-03-27T08:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: JCShell documentation and examples for DEFUN</title>
      <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1622883#M28</link>
      <description>&lt;P&gt;No this is not the correct syntax. The code sample you just sent me is LISP and JCShell DEFUN does not resemble it. The example on the link you just sent me is this:&lt;/P&gt;&lt;PRE&gt;(defun function-name (arguments…)
  "optional-documentation…"
  (interactive argument-passing-info)     ; &lt;SPAN class=""&gt;optional&lt;/SPAN&gt;
  body…)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and here is an example out of the JCShell documentation:&lt;/P&gt;&lt;PRE&gt;DEFUN GET_SCR_PATH&lt;BR /&gt;/echo ${script.name}&lt;BR /&gt;END&lt;/PRE&gt;&lt;P&gt;As I said in my first message, there is no actual section in the JCShell document that defines the syntax for DEFUN and the examples are not very comprehensive.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 01:05:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1622883#M28</guid>
      <dc:creator>makinako</dc:creator>
      <dc:date>2023-03-28T01:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: JCShell documentation and examples for DEFUN</title>
      <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1624925#M34</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/180285"&gt;@makinako&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Yes, it is strange not&amp;nbsp;documented in JCShell user manual, and I have also asked a few people but there seems to be no such document at all. I am sorry about that! All I can do is sharing example. If you need it, I may share you via the Case Portal. Please submit a private ticket for it according to the following video.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nxp.com/video/tutorial-for-nxp-support-case-portal:NCP-VIDEO" target="_blank"&gt;https://www.nxp.com/video/tutorial-for-nxp-support-case-portal:NCP-VIDEO&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;BR /&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 05:31:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1624925#M34</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2023-03-30T05:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: JCShell documentation and examples for DEFUN</title>
      <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1645007#M38</link>
      <description>&lt;P&gt;Older versions of JCShell had a directory called "scripts" and there are a number of examples within that directory of the use of DEFUN.&lt;/P&gt;&lt;P&gt;In any event, DEFUN is equivalent to placing the contents of the DEFUN function in a &amp;lt;name&amp;gt;.jcsh file in the defined scripts directory where &amp;lt;name&amp;gt; is the name of the function (and without the cotaining DEFUN END pair).&amp;nbsp; AFAICT, the instantiation of the DEFUN function is deferred until the containing file is called, and then is available for the life of the jcshell session.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 20:58:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1645007#M38</guid>
      <dc:creator>msjcard</dc:creator>
      <dc:date>2023-05-04T20:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: JCShell documentation and examples for DEFUN</title>
      <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1648277#M40</link>
      <description>&lt;P&gt;Thanks for the tip! I found the scripts folder in the v3.7.2.4 package in the archives. In this I found scripts/tools/script_tlv.jcsh which showed an example of arguments used by DEFUN:&lt;/P&gt;&lt;P&gt;So with the script "myscript.jcsh":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;# Testing function arguments
DEFUN my_test_function
	/echo argv[0] is ${argv[0]}
	/echo argv[1] is ${argv[1]}
	/echo argv[2] is ${argv[2]}
END

# Run it with various arguments
my_test_function A B C
my_test_function A B
my_test_function A&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And executing it using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;myscript 1 2 3&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I deliberately put "1&amp;nbsp; 2 3" to make sure it is not getting argv from the arguments to the main script instead of the call to the function)&lt;/P&gt;&lt;P&gt;And I get the output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;argv[0] is A 
argv[1] is B 
argv[2] is C 
argv[0] is A 
argv[1] is B 
argv[2] is 
argv[0] is A 
argv[1] is 
argv[2] is &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;P.S.&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/59276"&gt;@Kan_Li&lt;/a&gt;&amp;nbsp;a suggestion for NXP is to update and re-introduce these scripts into the JCShell releases as well as explicitly document DEFUN.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 03:04:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/JCShell-documentation-and-examples-for-DEFUN/m-p/1648277#M40</guid>
      <dc:creator>makinako</dc:creator>
      <dc:date>2023-05-11T03:04:43Z</dc:date>
    </item>
  </channel>
</rss>

