Sophie

Sophie

distrib > Mageia > 5 > x86_64 > by-pkgid > 8733295824cb8633b29dede17b1d614e > files > 198

anyremote-doc-6.4-3.mga5.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

	<title>anyRemote &middot; Control your computer with your phone</title>

	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<meta name="description" content="anyRemote project page - Bluetooth remote control tool" />

	<link rel="stylesheet" href="data/master.css" type="text/css" media="all" title="Default Style" charset="utf-8" />
	<script src="data/effects.js" type="text/javascript" charset="utf-8"></script>

	<link rel="alternate" title="Feed" href="data/feed.xml" type="application/rss+xml" />

	<link rel="icon" href="data/logo-favicon.png" type="image/png" />
	<link rel="shortcut icon" href="data/logo-favicon.png" type="image/png" />

</head>

<body id="docs">

	<a class="skip" name="top">&nbsp;</a>
	<a class="skip" href="#content">Skip to content</a>

	<div id="head">
		<div id="logo">
			<h1><a href="index.html"><img src="data/logo-head.png" alt="logo" /> anyRemote</a></h1>
		</div>
		<div id="navigation"><div class="padding">
			<a href="index.html"><span>About</span></a>
			<a href="frontend.html"><span>Screenshots</span></a>
			<a href="dload.html"><span>Download</span></a>
			<a href="docs.html" class="active"><span>Documentation</span></a>
			<a href="faq.html"><span>FAQ</span></a>
			<a href="contacts.html"><span>Contact</span></a>
			<a href="thanks.html"><span>Special Thanks</span></a>
		</div></div>
	</div>

	<div id="sidebar"><div class="padding">
		<dl class="info">
			<dt>Information</dt>
			<dd>
				<p>Please use the two sidebar boxes below to browse through the anyRemote Documentation!</p>
			</dd>
		</dl>
		<dl class="docs">
			<dt>Documentation</dt>
			<dd>
				<ul>
					<li><a href="pre-setup.html">Before install</a></li>
					<li><a href="pre.html">Software prerequisites</a></li>
					<li><a href="install.html">Compilation and installation</a></li>
					<li><a href="mode.html">Which mode to choose ?</a></li>
					<li><strong>Setup</strong>
						<ul>
							<li><a href="setup-at.html">Setup: AT mode</a>
								<ul>
									<li><a href="event.html">Event reporting</a></li>
									<li><a href="ckpd-emulation.html">Keypad emulation events</a></li>
								</ul>
							</li>
							<li><a href="setup-server.html">Setup: Server mode</a></li>
						</ul>
					</li>
					<li><a href="use.html">How to use anyRemote</a>
						<ul>
							<li><a href="android-client.html">Android Client</a></li>
							<li><a href="use-jc.html">J2ME Client</a></li>
							<li><a href="web.html">Web Interface</a></li>
							<li><a href="cm-xml.html">XML Services Interface</a></li>
							<li><a href="cfg-howto.html">How to create simple configuration file</a></li>
							<li><a href="bemused.html">Bemused Support</a></li>
							<li><a href="iviewer.html">Command Fusion iViewer support</a></li>
						</ul>
					</li>
					<li><a href="devices.html">Tested devices</a></li>
					<li><a href="phones.html">Phone specific details</a></li>
					<li><a href="tips-tricks.html">Tips &amp; tricks</a></li>
					<li><a href="man.html">Man page</a></li>
				</ul>
			</dd>
		</dl>
		<dl class="docs-advanced">
			<dt>Advanced</dt>
			<dd>
				<ul>
					<li><a href="http://elpraga.bshellz.net/HOWTOstartanyRemoteatboottime.html">miniHOWTO: start anyRemote at boot time and create a multimedia computer</a> (externally maintained)</li>
					<li><strong>Format of configuration files</strong>
						<ul>
							<li><strong>Server mode</strong>
								<ul>
									<li><a href="conf-server.html">Configuration file format</a></li>
									<li><a href="conf-server-ex.html">Configuration file examples</a></li>

									<li><a href="set.html">Set(...) / ExecAndSet(...) commands</a></li>
									<li><a href="set-fm.html">Set(filemanager ... ) command</a></li>
									<li><a href="set-icons.html">Set(icons ...) command and available icon set</a></li>
									<li><a href="set-list.html">Set(list ... ) and Set(iconlist ... ) commands</a></li>
									<li><a href="set-menu.html">Set(menu ... ) command</a></li>
									<li><a href="set-parameter.html">Set(parameter, ... ) commands</a></li>
									<li><a href="set-text.html">Set(text ... ) command</a></li>
									<li><a href="set-window.html">Set(image ... ) command</a></li>
								</ul>
							</li>
							<li><strong>AT mode</strong>
								<ul>
									<li><a href="conf-at.html">Configurational file format</a></li>
									<li><a href="conf-at-ex.html">Configurational file examples</a></li>
								</ul>
							</li>
							<li><strong>Common</strong>
								<ul>
									<li><a href="make.html">Make(...) command</a></li>
									<li><a href="emulate.html">Emulate(...) command</a></li>
									<li><a href="dbus.html">Dbus(...) command</a></li>
									<li><a href="vars.html">Variable substitution</a></li>
									<li><a href="ev-handlers.html">Event handlers</a></li>
									<li><a href="icon-themes.html">Icon themes for J2ME client</a></li>
								</ul>
							</li>
						</ul>
					</li>
				        <li><a href="ir.html">anyRemote and InfraRed</a></li>
				</ul>
			</dd>
		</dl>
		<dl class="contact">
			<dt>Contact</dt>
			<dd>
				<p>We will be pleased for any questions, suggestions, patches and examples of configuration files!</p>
				<ul>
					<li>Post in the <a href="http://sourceforge.net/forum/?group_id=162923">Forum</a></li>
					<li>Please, send e-mails to  <a href="mailto:anyremote&#64;mail&#46;ru">anyremote&#64;mail&#46;ru</a></li>
				</ul>
			</dd>
		</dl>
		<!--HOSTINGLOGO-->
	</div></div> <!-- sidebar -->

	<div id="content"><div class="padding">

		<a class="skip" name="content">&nbsp;</a>

		<h1>Variable substitution</h1>

		<p>In Exec(), Make(var,...), Load(), Include() commands is it possible to use internal "variables". Several of them are predefined.</p>
		
		<h1>Variables list</h1>
		
		<h3>$(Home)</h3>
                
		<p>User home directory (<i>$HOME</i>) will be substituted instead of $(Home):</p>
		<pre>1=ExecAndSet(list,replace,Files in home,ls $(Home))</pre>

		<h3>$(Mode)</h3>
                
		<p>Current mode will be substituted instead of $(Mode):</p>
		<pre>2=Make(mode,xmms);Exec(kdialog --msgbox "New mode is $(Mode)")</pre>

		<h3>$(CfgDir)</h3>
		<p>Directory with configuration files substituted instead of $(CfgDir).</p>
		<p>In most cases it is <strong>/usr/share/anyremote/cfg-data</strong>. Actually it depends on <strong>--prefix</strong> value which was used at build time.</p>
		<p>It is posible to override this by setting <strong>AR_CFGDIR</strong> environment value.</p>
                <pre>3=ExecAndSet(list,replace,Cfg Files,ls -1 $(CfgDir))</pre>

		<h3>$(TmpDir)</h3>
		<p>Is is suggested to use $(TmpDir) in configuration files in commands which stores data in files.</p>
		<p>Default value of $(TmpDir) variable is <strong>$HOME/.anyRemote</strong>.</p>
                <pre>4=Exec(ls -1 $HOME > $(TmpDir)/home.list)</pre>

		<h3>$(WaitSeconds)</h3>
		<p>This variable used to stop scripts started inside <a href="set.html">ExecAndSet(...)</a> or <a href="make.html">Make(...)</a> commands 
		to avoid hang-up of anyRemote. If $(WaitSeconds) is set to positive value then after waiting for specified amount of seconds started script 
		<a href="http://linux.die.net/man/2/kill">killed by SIGTERM</a> signal.</p>
		<p>Default value of $(WaitSeconds) variable is <strong>-1</strong>, that means it does not used.</p>
                <pre>(Init)=Make(var,WaitSeconds,by_value,30)</pre>

		<h3>$(UpdateTimeout)</h3>
		<p>This variable used to control applocation state update timeout.</p>
		<p>Default value of $(UpdateTimeout) variable is <strong>5</strong> seconds.</p>
                <pre>(Init)=Make(var,UpdateTimeout,by_value,3);

5=Macro(PLAY);Timer(UPDATE_STATE,$(UpdateTimeout),0);</pre>

		<h3>$(AllowedOnly)</h3>
		<p>This variable used to setup access control. If $(AllowedOnly) is set to <strong>true</strong> then 
		connection accepted only from hosts specified in file  <strong>$HOME/.anyRemote/allowed_hosts</strong> file.</p>
		<p>Default value of $(AllowedOnly) variable is <strong>false</strong> that means no access control is applied.</p>
		<p>File <strong>$HOME/.anyRemote/allowed_hosts</strong> should contains allowed IP and Bluetooth addresses one address per line, for example:</p>
                <pre>192.168.1.1
127.0.0.1
0008F4163049</pre>
		<p>Access control can be applied to Bluetooth, TCP, Web server and XML services interfaces connection.</p>

		<h3>$(BtAddr)</h3>
		<p><i>[Server-mode only]</i> $(BtAddr) variable will be substituted with bluetooth address of the phone after successful connection by J2ME/Android client.</p>
		<p>If connection absent (or established not in Server mode through bluetooth) this variable will have empty value.</p>
                <pre>(Connect)=Exec(kdialog --msgbox "Connected by $(BtAddr)")</pre>

		<h3>$(Bluez)</h3>
		<p>$(Bluez) variable will have value <strong>yes</strong> if anyRemote is compiled with <a href="http://www.bluez.org/">Bluez</a> support, 
		or will have value <strong>no</strong> if anyRemote is compiled without <a href="http://www.bluez.org/">Bluez</a> support.</p>
                <pre>(Init)=Exec(kdialog --msgbox "anyRemote compiled with Bluez - $(Bluez)")</pre>

		<h3>$(Xtest)</h3>
		<p>$(Xtest) variable will have value <strong>yes</strong> if anyRemote is compiled with XTest support, 
		or will have value <strong>no</strong> if anyRemote is compiled without XTest support.</p>
                <pre>(Init)=Exec(kdialog --msgbox "anyRemote compiled with XTest - $(Xtest)")</pre>

		<h3>$(MixerCard)</h3>
		<p>This variable is used in configuration files which are uses <a href="http://alsa.opensrc.org/index.php/Amixer">amixer</a> utility to 
		control sound volume.</p>
		<p>$(MixerCard) variable will have default value <strong>0</strong>. You can reset this variable to appropriate value if
		Your system have different sound card configuration.</p>
                <pre>(Init)=Make(var,MixerCard,by_value,1)</pre>
		<p>The most simple way to do this is to use <a href="ev-handlers.html">hook_*</a> files. So, just add command</p>
		<pre>Make(var,MixerCard,by_value,1)</pre> 
		<p>to <strong>$HOME/.anyRemote/hook_init</strong> file.</p>
		<p>Also, take a look at <a href="tips-tricks.html">here</a></p>

		<h3>$(MixerChannel)</h3>
		<p>This variable is used in configuration files which are uses <a href="http://alsa.opensrc.org/index.php/Amixer">amixer</a> utility to 
		control sound volume.</p>
		<p>$(MixerChannel) variable will have default value <strong>Master</strong>. You can reset this variable to appropriate value if
		Your system have different sound card configuration.</p>
                <pre>(Init)=Make(var,MixerChannel,by_value,PCM)</pre>
		<p>The most simple way to do this is to use <a href="ev-handlers.html">hook_*</a> files. So, just add command</p>
		<pre>Make(var,MixerChannel,by_value,PCM)</pre> 
		<p>to <strong>$HOME/.anyRemote/hook_init</strong> file.</p>
 		<p>Also, take a look at <a href="tips-tricks.html">here</a></p>
              
		<h2>Variables used to control internal behaviour of anyRemote</h2>
                
                <p>If You need to tune internal behaviour of anyRemote, then it is good idea to use these variable in <a href="ev-handlers.html">(Init)</a> event handler or 
                in $HOME/.anyRemote/<a href="ev-handlers.html">hook_init</a> file.</p>
                
                <h3>$(Device)</h3>
                <p>This variable allows to specify connect string.</p>
                <p>The same can be done by specifying <strong>-s ...</strong> command line parameter.</p>
                <p>$(Device) variable will have default value <strong>bluetooth:19,tcp:5197,web:5080</strong> 
                (which is used in Server mode, so You have to care about this parameter in AT mode)</p>
		<p>If anyRemote works as server correct then value for <strong>Device</strong> could be:</p>
		<ul>
			<li><strong>bluetooth:_channel_</strong>or just <strong>bluetooth</strong> (to choose first available channel).</li>
			<li><strong>tcp:_port_</strong></li> 
			<li><strong>web:_port_</strong></li> 
			<li><strong>cmxml:_port_</strong></li> 
			<li><strong>local:/dev/ircomm#</strong></li>
		</ul>
		<p>If anyRemote works in AT mode then correct value for <strong>Device</strong> could be:</p>
		<ul>
			<li><strong>rfcomm:XX:XX:XX:XX:XX:XX:Y</strong></li> 
			<li><strong>/dev/ircomm#</strong></li> 
			<li><strong>/dev/ttyACM#</strong></li> 
			<li><strong>ilirc:/path/to/socket_file</strong></li>
			<li><strong>stdin</strong></li>
		</ul>
		<p> where <a href="setup-at.html">XX:XX:XX:XX:XX:XX</a> is the bluetooth address of the phone and last <a href="setup-at.html">Y</a> is the channel number and
		where <strong>#</strong> is just a number</p>
                <pre>(Init)=Make(var,Device,by_value,rfcomm:00:12:EE:32:20:2B:1)</pre>
               
                <h3>$(Logging)</h3>
		<p>Print or not to print logging info to the file <i>$HOME/.anyRemote/anyremote.log</i>.</p>
                <p>$(Logging) variable can be set to <strong>false|true|debug</strong> and will have default 
		value <strong>false</strong>. </p>
		<p>Set it to <i>debug</i> for verbose logging.</p> 
		<p>The same can be done by specifying <strong>-log</strong> command line parameter.</p>
                <pre>(Init)=Make(var,Logging,by_value,debug);</pre>
		<p>By default all logging information stored in <i>$HOME/.anyRemote/anyremote.log</i> file. This could be altered by setting <i>AR_TMPDIR</i> environment variable. If <i>AR_TMPDIR</i> environment variable is set then logging information will be printed to <i>${AR_TMPDIR}/anyremote.log.${USER}</i></p>
                 
  
                <h3>$(ServiceName)</h3>
		<p><i>[Server mode over bluetooth only]</i> This variable is used specify SDP service name.</p>
                <p>$(ServiceName) variable have default value <strong>anyRemote</strong></p>
 		<p>The same can be done by specifying <strong>-name ...</strong> command line parameter.</p>
                <pre>(Init)=Make(var,ServiceName,by_value,myName);</pre>
 
                <h3>$(FromEncoding)</h3>
		<p><i>[Server mode only]</i> Anyremote J2ME client supports only <a href="http://en.wikipedia.org/wiki/UTF-8">UTF8</a> encoding.</p>
		This variable is used to convert data from specified encoding to <a href="http://en.wikipedia.org/wiki/UTF-8">UTF8</a>.</p>

                <pre>(Init)=Make(var,FromEncoding,by_value,ISO-8859-15);</pre>
 	
		<p>Conversion from specified encoding to <a href="http://en.wikipedia.org/wiki/UTF-8">UTF8</a> will be automatically applied
		to the following commands:</p>
        	<pre>ExecAndSet(list,add|replace,...);
ExecAndSet(iconlist,add|replace,...);
ExecAndSet(filemanager,add|replace,left|right...);
	</pre>
		<p>Reverse conversion to specified encoding from <a href="http://en.wikipedia.org/wiki/UTF-8">UTF8</a> will be automatically applied
		to the <a href="vars.html#params_index">$(Param)</a> environment variable.</p>

                <h3>$(ToEncoding)</h3>
		<p><i>[Server mode only]</i>This variable is used along with <strong>$(FromEncoding)</strong>. 
		In most cases there are no needs to change it.</p>

                <p>$(ToEncoding) variable have default value <strong>UTF-8</strong></p>
		
		<h2>Variables used by <a href="web.html">web</a> and <a href="cm-xml.html">XML services</a> interfaces</h2>
                		
		<h3>$(ScreenSize)</h3>
                <p><i>[only by <a href="web.html">web interface</a>]</i> This variable should be set to minimal value of <strong>width</strong> and 
		<strong>heigth</strong> of device screen size.  
		Default value is <strong>240</strong>.</p>
                <pre>(Init)=Make(var,ScreenSize,by_value,480)</pre>

		<h3>$(RefreshPage)</h3>
                <p><i>[by <a href="web.html">web</a> and <a href="cm-xml.html">XML services</a> interfaces]</i> 
		This variable to automatically refresh page. Refresh rate should be specified in seconds.  
		Default value is <strong>-1</strong> that means <strong><i>no refresh</i></strong>.</p>
                <pre>(Init)=Make(var,RefreshPage,by_value,5)</pre>

		<h3>$(IpAddr)</h3>
                <p><i>[only by <a href="cm-xml.html">XML services</a> interface]</i> 
		This variable defines IP address of computer with anyRemote, which will be used in XML replyes. 
		Default value is platform dependent.</p>
		
		<h2>Variables used only in <a href="setup-at.html">AT-mode</a></h2>
                
		<h3>$(AutoConnect)</h3>
                <p><i>[AT-mode only]</i> This variable can be set to <strong>true</strong> or <strong>false</strong> and 
		have default value <strong>false</strong>.</p>
		<p>If value of this variable is <strong>true</strong>, then anyRemote will try to re-connect to phone 
		automatically.</p>
		<p>The same can be done by specifying <strong>-a</strong> command line parameter.</p>
                <pre>(Init)=Make(var,AutoConnect,by_value,true)</pre>
               
                <h3>$(AutoRepeat)</h3>
                <p><i>[AT-mode only]</i> This variable can be set to <strong>true</strong> or <strong>false</strong> and have default value <strong>false</strong>.</p>
                <p>This variable is used to switch on/off auto repeat feature (as on PC keyboard - about 10 times per second). 
                Useful for mouse and keyboard emulation.</p> 
                <pre>(Init)=Make(var,AutoRepeat,by_value,true)</pre>

                <h3>$(Baudrate)</h3>
                <p><i>[AT-mode only]</i> Baudrate to use; default value is <strong>19200</strong></p> 
  		<p>Possible values for <strong>Baudrate</strong> could be:</p>
		<ul>
			<li><strong>300</strong></li>
			<li><strong>1200</strong></li>
			<li><strong>2400</strong></li>
			<li><strong>9600</strong></li>
			<li><strong>19200</strong></li>
			<li><strong>38400</strong></li>
			<li><strong>57600</strong></li>
			<li><strong>115200</strong> (if supported)</li>
			<li><strong>230400</strong> (if supported)</li>
		</ul>
                <pre>(Init)=Make(var,Baudrate,by_value,9600);</pre>
                
                <h3>$(CharSet)</h3>
                <p><i>[AT-mode only]</i> This variable will have default value <strong>8859-1</strong>.</p>
		<p>This variable allows to specify charset by <strong>AT+CSCS=...</strong> command.</p>
                <pre>(Init)=Make(var,CharSet,by_value,8859-1)</pre>
                
                <h3>$(CmerOff)</h3>
		<p><i>[AT-mode only]</i> This variable is used to tune <strong><a href="event.html">AT+CMER=...</a></strong> command which exits phone from "echo" mode. 
                In "echo" mode phone will send key codes of pressed buttons to anyRemote. This variable have no default value. 
                If this variable is not set anyRemote will try to determine it automatically.</p>
                <pre>(Init)=Make(var,CmerOff,by_value,AT+CMER=0,0,0,0,0)</pre>
                
                <h3>$(CmerOn)</h3>
                <p><i>[AT-mode only]</i> Used when anyRemote is in <strong>AT-mode</strong> only.</p>
		<p>This variable is used to tune <strong><a href="event.html">AT+CMER=...</a></strong> command which enters phone in "echo" mode. 
                In "echo" mode phone will send key codes of pressed buttons to anyRemote. This variable have no default value. 
                If this variable is not set anyRemote will try to determine it automatically.</p>
                <pre>(Init)=Make(var,CmerOn,by_value,AT+CMER=3,2,0,0,0)</pre>
 
		<h3>$(TwoWayComm)</h3>
		<p><i>[AT-mode only]</i> Send or don't send any commands (SendCKPD(), etc.) to the phone. 
		Can be set as <strong>true</strong> or <strong>false</strong>. Default value is <strong>false</strong>.</p>
                <pre>(Init)=Make(var,TwoWayComm,by_value,true)</pre>
 
		<h3>$(RetrySeconds)</h3>
	        <p><i>[AT-mode only]</i> Duration in seconds beetween attempts to reconnect to the phone in case if connection fails. 
		Default value is <strong>60</strong>. Works in conjunction with <strong>AutoConnect</strong> parameter.</p>
                <pre>(Init)=Make(var,RetrySeconds,by_value,120);</pre>
                
		<h3>$(ToMainMenu)</h3>
		<p><i>[AT-mode only]</i> CKPD sequence which used to reach main screen of the phone from any 
		of phone's menus. For example, on Motorola-V500 to press "Red Cancel" button is enough to get out from any menu.</p>
		<p>If set, that sequence will be sent to phone after each key press. 
		Default value is empty string. This parameter is a kind of shortcut which allows not to specify 
		<a href="conf-at.html">SendCKPD(E)</a> command for each Key_Code.</p>
                <pre>(Init)=Make(var,ToMainMenu,by_value,E);</pre>
                
		<h2>Variables used only in <a href="iviewer.html">iViewer</a> mode</h2>
                
		<h3>$(IViewer)</h3>
                <p><i>[iViewer mode only]</i> This variable can be set to <strong>true</strong> or <strong>false</strong> and 
		have default value <strong>false</strong>.</p>
		<p>If value of this variable is <strong>true</strong>, then anyRemote will use it as a hint to optimize 
		handling of iViewer heartbeat messages.</p>
                <pre>(Init)=Make(var,IViewer,by_value,true)</pre>

		<h2><a name="params_index">Parametrized replies</a></h2>
                
		<p><i>[Server-mode only]</i> There are $(Param) and $(Index) variables defined in handling command issued from 
		anyRemote client <a href="set-menu.html">menus</a>. Use <strong>$$</strong> inside braces to specify parametrized commands.
		</p>
                <pre>Choose($$)=Exec(xmmsctrl track $(Index));\
           Exec(kdialog --msgbox "Selected track is $(Param)")</pre>
                
                <h2>User-defined variables</h2>
                
		<p>In addition to the predefined internal variables it is possible to define custom internal variables 
		with <a href="make.html">Make(var,....)</a> command.</p>
		
                <pre>5=Make(var,my_variable,by_value,3.141526);
5=Make(var,now_is,echo "Now is "`date`);</pre>

	</div></div> <!-- content -->

	<div id="foot">
		<p>Maintained by <a href="mailto:anyremote&#64;mail&#46;ru">anyRemote</a>. Website by <a href="http://www.martinlettner.info">m.lettner</a>.</p>
	</div>

</body>
</html>