; ; @ANO_SCRIPT_NAME remote_control ; @ANO_SCRIPT_VERSION 0.0.2 ; @ANO_SCRIPT_DESCRIPTION Example how to run functions remotely ; ; @ANO_FLAGS_VAR_NAME_SUBS [ ] ; @ANO_FLAGS_VAR_WARN_UNUSED [ ] ; ; Copyright (c) 2016-2024, Jani Salonen ; All rights reserved. ; main { ; ; This is main program, just start remote thread and let it handle ; remote connections. Program terminates when "remote_end" label is ; called (see below) or is pressed. ; remote_init } function remote_test [remote: allow] (param1, param2, param3) { ; ; To call this function remotely (set SECRET with -na switch): ; ; $ telnet localhost 2109 ; SECRET remote_test int:1 uint:2 float:3.3 ; ; or by using remotetool: ; ; $ echo 'remote_test 1 2 3' | ./engine/tools/remotetool -na SECRET ; ; End code returned to caller is the sum of params or -1 if error ; occurs. ; dump param1 dump param2 dump param3 end (param1 + param2 + param3) } function remote_end [remote: allow] { ; ; To call this function remotely (set SECRET with -na switch): ; ; $ telnet localhost 2109 ; SECRET remote_end ; ; or by using remotetool: ; ; $ echo 'remote_end' | ./engine/tools/remotetool -na SECRET ; ; Exit code returned to caller is 123 ; exit (123) } function remote_forbidden { ; ; This function cannot be run remotely, as there is no remote: allow ; attribute. ; }