Prev
Next

Description of configuration file format (Server-style)

Since version 2.0 format of configurational file was changed. Description of format of configurational file for versions 1.X could be found here.

You may find some predefined configuration files in cfg-examples/Server-style directory:

You may find some predefined configuration files for Bemused emulation in cfg-examples/Bemused-emulation directory:

All examples have on-screen help binded to "* *" (press "*" two times).

I hope after investigation of these configuration files You'll become more familiar with its format.

Description of configurational file format (Server-style):

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

Device=bluetooth:10

Device to connect; default value is /dev/rfcomm0.

If anyRemote works as server correct value for Device could be: Device=socket:"port" or Device=bluetooth:"channel"or just Device=bluetooth (to choose first available channel).

Log=true

Print or not to print logging info to the file /tmp/anyremote.log, default value is false.

Debug=true

Print or not to print verbose logging info to the file /tmp/anyremote.log, default value is true.Works only if Log=true.

Screen=true

Send or don't send any commands (SetStatus(), SetTitle(), etc.) to phone. Default value is false.

MaxTextSize=18

Set the maximal size of text which can be sent to phone by Set(text...) command. MaxTextSize measured in chunks of 240 byte size. So, 18 chunks is about 4Kbyte. Set MaxTextSize to -1 to unset the limit. Default value is 18.

[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 rather complex commands inside Exec(), for example:

Command could be parametrized (see here for details):

Macro() command

This command used to group several commands:

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(timerId, timeout, maxTimes, tag, command)

This command similar to the ExecAndSet(), but it will be executed periodically by timer. See detailed description here.

For example, the following command 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 timerId. If results of the executed command is the same as previous one, then results will not be sent to Java client.

CancelTimer()

Format: CancelTimer(timerId)

This command deletes timer previously created by Timer() command by specified timerId.

Load() command

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

Include() command

This command used to include definitions from [Keys] section from external cfg.file:

Only [Keys] section will be loaded (no [Aliases] and [Alarms]). 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 mainly 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 also is used in Bemused server emulation.

There are several "internal" commands:

TempDisconnect used to temporary (1 minute) disconnecting from phone:

Exit command used to exit from application:

Switch off "remote control" functionality without disconnecting:

Switch on "remote control" functionality:

Change mode:

There are several "events" could be triggered:

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

(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, example is for soundcard #0):

Take a look to the order of commands above. RemoteOff command is the last one. If You change order to

then Exec(amixer -c 0 sset Master,0 mute) will not be executed.

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

Variable substitution:

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

Current time will be substituted instead of $(Time):

Current mode be substituted instead of $(Mode):

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

There are $(Param) and $(Index) variables defined in handling command issues from Java Client menus. See here for details.

[Alarms] section

Format:

Alarm_file=command1;command2;...

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





Prev
Next
Home