06.01.2015 Views

INfinity 510 Protocol Reference Guide - Sirit

INfinity 510 Protocol Reference Guide - Sirit

INfinity 510 Protocol Reference Guide - Sirit

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 5 - Embedded Reader Applications<br />

The output shows that hello.py has ended. To view the information passed<br />

to the standard output, run use reader.apps.view_log function,<br />

passing the pid associated with the application:<br />

> reader.apps.view_log(1963)<br />

ok<br />

Hello! args passed: test<br />

To set this application to run at system boot, pass the autostart<br />

parameter to the reader.apps.start_python command:<br />

> reader.apps.start_python<br />

(filename=hello.py,args=test, autostart=true)<br />

ok pid = 2018<br />

Running reader.apps.list_running shows that the application is<br />

configured as auto, which means it will run again at system boot time:<br />

ok<br />

PID CONFIG STATUS COMMAND<br />

1963 manual ended hello.py test<br />

2018 auto ended hello.py test<br />

Remove an application by running the reader.apps.stop command,<br />

passing the pid associated with the application:<br />

> reader.apps.stop(1963)<br />

ok<br />

> reader.apps.list_running<br />

ok<br />

PID CONFIG STATUS COMMAND<br />

2018 auto ended hello.py test<br />

Java Application Example<br />

The java application TowersOfHanoi executes the classic game of the same<br />

name. To start the application, invoke it with the<br />

reader.apps.start_java command.<br />

> reader.apps.start_java (classname=TowersOfHanoi)<br />

ok pid = 2219<br />

To verify the program completed, use the reader.apps.list_running<br />

function:<br />

> reader.apps.list_running<br />

ok<br />

PID CONFIG STATUS COMMAND<br />

2018 auto ended hello.py test<br />

2219 manual ended ./ TowersOfHanoi<br />

<strong>INfinity</strong> <strong>510</strong> <strong>Protocol</strong> <strong>Reference</strong> <strong>Guide</strong> 39

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!