1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426
|
<!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 · 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"> </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 & 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@mail.ru">anyremote@mail.ru</a></li>
</ul>
</dd>
</dl>
<!--HOSTINGLOGO-->
</div></div> <!-- sidebar -->
<div id="content"><div class="padding">
<a class="skip" name="content"> </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 using <strong>-cfgdir</strong> commandline option.</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>
<p>It is posible to override this by using <strong>-tmpdir</strong> commandline option.</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>
<li><strong>avahi</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 <strong>$HOME/.anyRemote/anyremote.log</strong> file.
This could be altered by setting <strong>$(TmpDir)</strong> variable or <strong>-tmpdir</strong> commandline option.
<p>If <strong>$(TmpDir)</strong> variable or <strong>-tmpdir</strong> commandline option are points outside of user home directory, then
logging information will be printed to the file <strong>$(TmpDir)/anyremote.log.${USER}</strong></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@mail.ru">anyRemote</a>. Website by <a href="http://www.martinlettner.info">m.lettner</a>.</p>
</div>
</body>
</html>
|