How to create simple configuration file
Configuration file examples
You may find predefined configuration files in cfg-data directory. Firstly, take a look to the simple configuration file like cfg-data/Serever-mode/player-template.cfg. After investigation of some configuration files You'll became more familiar with its format.
How To
Specify parameters
In general it needs to specify only (for AT mode):
(Init)= ... Make(var,Device,by_value,rfcomm:00:12:EE:32:20:2B:1);
where 00:12:EE:32:20:2B is the bluetooth address of the phone and last 1 is the channel number. Other parameters can be used by default.
Specify keys to handle
A short example, which:
- Shows popup message if button 1 pressed.
- Show "Hello" string in title field of java client if button 2 pressed. Valid in Server mode.
- Set current time to the status field of java client if button 3 pressed. Valid in Server mode.
[Protocol]=Server 1=Exec(kdialog --msgbox "Hello!") 2=Set(title,"Hello!") 3=ExecAndSet(status,date +"%M:%S") ...
Exec() command is the mostly used one. It is used to run specified command.
Set()/ExecAndSet() commands used to control look and behavour of java client, which is used in Server mode.
To make custom setup of java client main window upon connection:
(Connect)=Set(icons,TheTitle,\ 1,vol_down,2,mute,3,vol_up,4,rewind,9,next,\ *,question,#,pause);\ Set(status,Connected now);\ Set(title,Hello!);
As You can see it is possible to execute more than one command at once.
At the end, another "almost" real Server mode example which contols Amarok/KDE3 player:
[Protocol]=Server % Run amarok when connected (Connect)=Exec(amarok); % Volume control 1=Exec(dcop amarok player volumeDown) 2=Exec(dcop amarok player mute) 3=Exec(dcop amarok player volumeUp) % Play, rewind back and forward 4=Exec(dcop amarok player seekRelative -10) 5=Exec(dcop amarok player play);Set(title,Playing); 6=Exec(dcop amarok player seekRelative 10) % Previous song, stop playback and next song 7=Exec(dcop amarok player prev); 8=Exec(dcop amarok player stop);Set(title,Stopped); 9=Exec(dcop amarok player next); % Pause playback 0=Exec(dcop amarok player pause);Set(title,Paused); [End]
Lines starting with % are considered as a comment.