Configuration file format: Server mode

Configuration file examples

You may find some predefined configuration files in /etc/anyremote/Server-mode and /etc/anyremote/Bemused-emulation directories. After investigation of these configuration files You became more familiar with its format.

Format description

Comments

Line starting with a % considered as a comment line.

Long command can be splitted into the several lines. You have to put backslash (\) as the last character to continue a command to the next line.


Parameters section

AutoRepeat=false

Auto repeat feature (as on PC keyboard - about 10 events per second). Usefull for mouse emulation, for example. Default value is false.

Baudrate=19200

Baudrate to use; default value is 19200. Used mainly in AT mode.

Device=bluetooth:19

Connect string. Default value is bluetooth:19.

If anyRemote works as server correct value for Device could be:

Log=true|false|debug

Print or not to print logging info to the file $HOME/.anyRemote/anyremote.log, default value is false. Use Log=debug for verbose logging.

By default all logging informationin will be stored in $HOME/.anyRemote/anyremote.log file. This could be altered by setting AR_TMPDIR environment variable. If AR_TMPDIR environment variable is set then logging information will be printed to ${AR_TMPDIR}/anyremote.log.${USER}

Screen=true

Send or don't send any commands (Set(status,...), Set(title,...), etc.) to the phone. Default value is false, so You must set it to true if plans to use anyRemote in Server mode.

GuiAppName="application name"

GuiAppBinary="name of executable"

GuiAppRun="command do determine is application running or not; must returns OK or NOK"

GuiAppIcon="icon name"

GuiAppType=Application|Custom|Example

These parameters are used by GUI frontends only.


[Aliases] section

Format:

Key_Code=New_alias

and then use "One" in [Keys] section instead of "1" or "49":

[Keys] section

A short example:

Format:

Key_Codes=Command1;Command2;Command3;....

Where CommandX could be:

Exec() command

It is possible to define multi-key commands

It is not good idea to define:

simultaneously, since only one command will works (which one - depends on search order).

It is possible to group keymappings in so-called "mode" to set more than one command to the key:

If current mode is not default mode (see SetMode() command), then firstly key will be searched in current mode and if not found then it will be searched in default mode. As a result it needs to use (EnterMode) and (ExitMode) "events" very carefully in default mode.

It is possible to write quite complex commands inside Exec(), for example:

Macro() command

This command used to create new keymapping:

Macro() command can contain condition:

Conditional Macro() will be execute only if a result of execution of command is equal to string "0".

Note: In shells result code of command execution stored in $? environment variable.

Set()

These commands used to control and customize GUI of Java client. See detailed description here.

It is possible to change:

  • caption of screen
  • title and status fields
  • arrange icons from predefined icon set,
  • change background and foreground color,
  • change font size
  • change icon layouts (skins)
  • use internal vibrator of the phone
  • set fullscreen mode
  • set debug mode
  • show text on the screen of cell phone
  • show list on the screen of cell phone
  • add custom menus
ExecAndSet()

Format: ExecAndSet(tag,command)

This command similar to the Set(), but uses the output of command specified as a string to set GUI elements of Java client specified in tag field. See detailed description here.

Timer()

Format: Timer(key, timeout, maxTimes) or

Timer(key, cancel|pause|continue)

This command sets/removes a timer for the key specified. A command sequence, associated with this key will be executed periodically.

For example, the following commands run 'dcop amarok player nowPlaying' command 2 times with timeout equal to 5 sec and set result to the title field of Java client:

The following command run 'date' command every 10 sec and set result to the status field of Java client:

It is impossible to have two active timer commands with the same key.

To delete existing timer use the following command: Also, see note about data caching.

Load() command

This command used to load commands from file and execute them:

Include() command

This command used to include definitions from external configuration file:

Only [Keys], [Aliases] and [Alarms] sections will be loaded (Parameters section will not be loaded). Definitions from included file will not rewrite existing definitions if any.

Send()

Format: Send(string, string_value)

or Send(byte, byte_value1, byte_value2,...)

Send to the Java client specified string or sequence of bytes. This command is used in Bemused server emulation.

byte_valueX is string representation of 1 - 255 values. Send(byte, ...) command sends to the Java client specified bytes of data, one by one. Mainly this command is used to Bemused server emulation.

ExecAndSend()

Format: ExecAndSend(tag,command)

This command similar to the Send(tag, ...), but uses the output of command specified as a string to send. So, it is possible to execute dynamically created command. This command is used in Bemused server emulation.

Get()

Format: Get(screeen_size|cover_size|model) or

Get(is_exists,16|32,_icon_name_)

This command used to retrieve from phone some information.

Get(screeen_size) used to get screen size of cell phone. As a response to this command two replies will be send: SizeX(width,) and SizeY(height,). SizeX(width,) reply will be the first one.

Get(model) used to get "microedition.platform" property of Java client. For many phones this property contains manufacturer and model number (like "SonyEricssonK750i/R1CA021" for SE-K750). As a response to this command Model(,_string_) reply will be send.

Get(is_exists,...) used to determine was icon with given name and size uploaded to phone or not. As a response to this command IconExists(_icon_name_,) or IconNotExists(_icon_name_,) reply will be send.

Get(cover_size) used to determine maximalsize of cover image which can be shown by Set(cover, ...) command. As a response to this command one reply will be send: CoverSize(_size_,)

Make()

Format: Make(flush|disconnect|mode|remote|var[,....])

This command used control local state of anyRemote.

See detailed description here.

Exit

Exit command used to exit from application.

SetMode()

Change current keymapping group (do not mix this with AT/Server mode !).

Alse see description of (EnterMode) and (ExitMode) event handlers below.


There are several "events" could be triggered:

(Init) event will be fired when anyRemote is initialized:

(Exit) event will be fired when anyRemote is exiting:

(Connect) event will be fired when connection established:

(Disconnect) event will be fired when connection is lost:

Auto-lock example:

Incoming call handling. Not sure it will works for all JSR-82 capabled phones. But it works at least for SE-K750.

End of call handling. Not sure it will works for all JSR-82 capabled phones. But it works at least for SE-K750.

Auto-mute example (amixer utility should be installed):

If mode is changed by SetMode() then (ExitMode) event for current keymapping group and (EnterMode) event for the new keymapping group will be fired:


Variable substitution:

In Exec(), ExecAndSet(), Make(var,...), Load(), Include() commands is it possible to use several predefined internal "variables".

Current mode be substituted instead of $(Mode):

Directory in which resides used configuration file will be substituted instead of $(CfgDir):

There are $(Param) and $(Index) variables defined in handling command issued from Java Client menus. Use $$ inside braces to specify parametrized commands.

In addition to the predifined internal variables it is possible to define custom internal variables with Make(var,....) syntax.

[Alarms] section

Format:

Alarm_file=command1;command2;...

When file Alarm_file will be created, then command1, command2 ... will be executed.

About · Download · Documentation · FrontEnds · Contacts ·