miriserver documentation

14
MiriServer documentation V1.7.0, written by Steffen Schirmer Startup 2 Parameters 2 General parameters 2 File names as parameter 2 The Interfaces 3 (Win)LIRC-Interface 3 What is (Win)LIRC? 3 General 3 Ifrared Receiver Hardware 4 Self building receiver 4 General 4 WinLirc 4 Purchasable receiver 4 Ir2Pc 4 IRMan 4 Hardware for a button-cicuit 5 For 15 buttons 5 For 7 buttons and a rotary pulse encoder 5 TCP-IP-Interface 6 General stuff 6 MiriServer answers 7 Examples 7 Command-Reference 8 MoveMouse 8 ClickMouse 9 SetMousePos 9 SwitchProfile 9 ExitWindows 10 SimulateKeyStroke 10 SimulateKeyStroke_Down 10 SimulateKeyStroke_UP 10 ExecuteFile 11 ExecutePluginFunction 11 ExecuteMacro 11 PlayScreenMacro 11 CDRom 12 ScreenSaver 12 Volume 12 SendJaLCDsCommand 13 Sleep 13 Repeat 13 ShowScreenMessage 13 Variables-Reference 14 Table 14 Examples 14

Upload: adriana-radu

Post on 22-Apr-2015

47 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MiriServer Documentation

MiriServer documentation V1.7.0, written by Steffen Schirmer

Startup 2 Parameters 2

General parameters 2 File names as parameter 2

The Interfaces 3 (Win)LIRC-Interface 3

What is (Win)LIRC? 3 General 3

Ifrared Receiver Hardware 4 Self building receiver 4

General 4 WinLirc 4

Purchasable receiver 4 Ir2Pc 4 IRMan 4

Hardware for a button-cicuit 5 For 15 buttons 5 For 7 buttons and a rotary pulse encoder 5

TCP-IP-Interface 6 General stuff 6 MiriServer answers 7 Examples 7

Command-Reference 8 MoveMouse 8 ClickMouse 9 SetMousePos 9 SwitchProfile 9 ExitWindows 10 SimulateKeyStroke 10 SimulateKeyStroke_Down 10 SimulateKeyStroke_UP 10 ExecuteFile 11 ExecutePluginFunction 11 ExecuteMacro 11 PlayScreenMacro 11 CDRom 12 ScreenSaver 12 Volume 12 SendJaLCDsCommand 13 Sleep 13 Repeat 13 ShowScreenMessage 13

Variables-Reference 14 Table 14 Examples 14

Page 2: MiriServer Documentation

Startup

Parameters You can startup MiriServer with several parameters. Startup parameters are not case sensitive.

General parameters /NoSplash No splash screen will be shown during startup. /Sleep MiriServer will wait 10 seconds until it finally starts up. This is needed to avoid problems with the COM-Port at Windows startup. You can edit the parameters in the properties of the MiriServer-Shortcut, or if you start Miriam automatically on Windows start, with the program Regedit at HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\MiriServerStart.

File names as parameter If one of the parameters is a filename MiriServer will try to open these file. MiriServer is able to open following file-types:

*.mPLG MiriServer Plugins (will open with the “PluginEditor”)

*.mMAC MiriServer Macros (will open with the “MacroEditor”)

*.mREC MiriServer ScreenMacros (will open with the “ScreenMacroRecorder”)

Page 3: MiriServer Documentation

The Interfaces

(Win)LIRC-Interface

What is (Win)LIRC? WinLIRC allows you to transmit and receive standard infrared remote control signals. This allows you to control your computer using almost any standard infrared remote control. It also allows your computer to control other equipment which uses these signals (stereo equipment). WinLIRC is the Windows equivalent of LIRC, the Linux Infrared Remote Control program. WinLIRC (through version 0.6) was originally written by Jim Paris. Later releases are written and maintained on sourceforge.net.

General MiriServer is able to connect itself to a (Win)LIRC-Server. In this case (Win)LIRC will take care of handling the infrared receiver and will send all the received stuff to MiriServer. Have a look at the (Win)LIRC-Website (and the pretty good documentation) at: http://winlirc.sourceforge.net. The advantage to use (Win)LIRC to handle the receiver in comparison to MiriServer is that (Win)LIRC is sometimes much better in receiving, decoding and interpreting signals from a simple receiver than MiriServer.

Page 4: MiriServer Documentation

Ifrared Receiver Hardware

Self building receiver

General (no content yet)

WinLirc (no content yet)

Purchasable receiver

Ir2Pc (no content yet)

IRMan (no content yet)

Page 5: MiriServer Documentation

Hardware for a button-cicuit

For 15 buttons

For 7 buttons and a rotary pulse encoder

Page 6: MiriServer Documentation

TCP-IP-Interface

General stuff The TCP-IP-Interface can be used to send commands to MiriServer. External programs can execute functions and commands in MiriServer. For a list of available commands, take a look at the “commands reference”. The interface is useful for remote administration via telnet-client, but it can also be used by programs to send data (even over a LAN) to MiriServer. Using this, anyone can develop own clients which can use the huge functionality of MiriServer. If you enable the internal TCP-IP-Server in the configuration dialog, then there will be one open port for communication. The port number and number of maximum connections can also be changed in the configuration dialog. If the connection was established successfully MiriServer answers and sends a list of available functions to the client. Then it waits for input. This input can be sent character by character or as a whole line. In any case it has to end with “CrLf” (meaning ASCII 13 & 10). MiriServer will answer on any full line with a “statuscode” consisting of three digits and a text message, eventually followed by additional data (e.g. the function-list or the active profile). The three digits in front of the statuscode can be easily processed in external programs (the same concept is used by the FTP-protocol). MiriServer also sometimes sends information to all connected clients. One event that causes this is the change of the available functions or active profile. Another event is on exiting MiriServer, so if the user closes the program, MiriServer sends a “terminate” to all connected clients.

Page 7: MiriServer Documentation

MiriServer answers

010 Okay

020 Ready

030 Success

055 Greetings

100 Information (general)

110 Information about active profile

120 A “Hint” from MiriServer (e.g. a description of an executed function)

130 Information about the Server-Version

140 Information “terminate”

200 Start of something (general)

210 Start of sending function-list (will end with “020 – Ready”)

600 Error (general)

610 Error (something unknown/miss-typed)

620 Error (something is missing/does not exists)

630 Error (Failed to interpret/convert)

666 Error (general fail, fail to do something, however which matter)

677 Error (no access / access denied)

Examples There is a code-example for a working client included in the MiriServer installation. Take a look at the directory: %MiriServerDirectory%\src\. The code is written in Object Pacal (Borland Delphi [5]).

Page 8: MiriServer Documentation

Command-Reference This reference contains the supported commands of MiriServer V1.0.0. Later versions may support even more commands, please check the version history on http://sixdots.de/miriserver. Usually a command’s syntax is as follows:

CommandName ( param_1, param_2, ..., param_n ) ;

The commands and its parameters usually are not case sensitive. Parameters can (but don’t have to) be locked by quotations and have to be separated by commas. A Space character will be ignored.

MoveMouse (Move mouse over the screen.) Syntax: MoveMouse(direction, steps);

Parameters: direction: Moving direction. Can be: X+ X- Y+ Y-

steps Optional numerical value. Number of pixels about the mouse cursor will be moved. Default is 10.

Example: MoveMouse(x+, 20); MoveMouse(y-, 43);

Name of Command

Parameters of the Command

Brackets for the parameters

Brackets for the parameters

Semicolon that define the end of the command.

Page 9: MiriServer Documentation

ClickMouse (Simulates a mouse click) Syntax: ClickMouse(button, clicktype);

Parameters: button The mouse button. Can be: Left Middle Right

clicktype The way of clicking the button. Can be: Up Down Click

Example: ClickMouse(Left, Click); ClickMouse(Right, Down); ClickMouse(Right, Up);

SetMousePos (Set the mouse cursor to a specified X,Y-postion on the screen) Syntax: SetMousePos(x, y);

Parameters: X Numerical value of the horizontal pixel position on the screen. y Numerical value of the vertical pixel position on the screen.

Example: SetMousePos(20, 50);

SwitchProfile (Switch to a specified or to the next Profile in MiriServer) Syntax: SwitchProfile(profilename);

Parameters: profilename Text value. Name of profile, MiriServer should be switch to.

Special info: If parameter is left blank, MiriServer will switch to the next profile.

Page 10: MiriServer Documentation

ExitWindows (Exit, shutdown, logoff, suspend or reboot Windows) Syntax: ExitWindows(exittype, delaycount);

Parameters: exittype The way of shutting down Windows. Can be: Shutdown Reboot LogOff PowerOff Force Standby Hibernate

delaycount Optional numerical value that stands for the count of executions that will be needed until something will happen. Is needed to protect the function "ExitWindows();".

Example: ExitWindows(Shutdown); ExitWindows(Reboot); ExitWindows(Standby); ExitWindows(Shutdown, 8); ExitWindows(Reboot, 10);

SimulateKeyStroke (Simulate a global keystroke) Syntax: SimulateKeyStroke(key_1, key_2, key_3, ..., key_n);

Parameters: keys List of keys that should be simulated. The number of parameters depends on the number of keys to simulate. The parameters are “virtual key codes”. A list of all key codes can be found on the internet. Virtual key codes like “A” or “C” are also possible.

Example: SimulateKeyStroke(A); SimulateKeyStroke(VK_F1); SimulateKeyStroke(VK_CONTROL, VK_ESCAPE); SimulateKeyStroke(VK_MENU, VK_F4); SimulateKeyStroke(VK_CONTROL, VK_MENU, VK_DEL);

SimulateKeyStroke_Down Like “SimulateKeyStroke”, but only simulates key DOWN..

SimulateKeyStroke_UP Like “SimulateKeyStroke”, but only simulates key UP.

Page 11: MiriServer Documentation

ExecuteFile (Execute a specified file or application) Syntax: ExecuteFile(filename, param);

Parameters: filename Name of the file that should be executed. param Optional parameter for the execute-parameter.

Example: ExecuteFile(‘C:\program files\notepad.exe’, ‘d:\tes t.txt’); ExecuteFile(‘C:\program files\winamp\winamp.exe’);

ExecutePluginFunction (Execute a function from a MiriServer-Plugin) Syntax: ExecutePluginFunction(pluginfilname, pluginfunction );

Parameters: pluginfilename Filename of the MiriServer-Plugin. pluginfunction Name of the plugin-function that should be executed.

Example: ExecutePluginFunction(‘%PLUGINDIR%\Winamp.mPLG’, ‘N ext’); ExecutePluginFunction(‘%PLUGINDIR%\Winamp.mPLG’, ‘S top’); ExecutePluginFunction(‘D:\MyPlayer.mPLG’, ‘Start Pl aying’);

ExecuteMacro (Execute a MiriServer-Macro) Syntax: ExecuteMacro(macrofilename);

Parameters: macrofilename Filename of the MiriServer-Macro that should be executed.

Example: ExecuteMacro(‘%MACRODIR%\test.mMAC’); ExecuteMacro(‘D:\MyMacroTestDir\IncredibleFunction. mMAC’);

PlayScreenMacro (Play back a MiriServer-ScreenMacro) Syntax: PlayScreenMacro(filename);

Parameters: filename Filename of the MiriServer-ScreenMacro that should be played.

Example: PlayScreenMacro(‘%SCREENMACRODIR%\test.mREC’); PlayScreenMacro(‘D:\MyRecording\TestRecording.mMAC’ );

Page 12: MiriServer Documentation

CDRom (Open or close the default or a specified CD-Rom-Drive) Syntax: CDRom(action, driveletter);

Parameters: action CD-Rom action. Can be: Open Close

driveletter Optional parameter. Letter of drive that should be opened or closed. If left blank, MiriServer will take the default CD-Rom-Drive.

Example: CDRom(Open); CDRom(Close); CDRom(Open, F); CDRom(Close, F);

ScreenSaver (Activate or deactivate the Windows-Screensaver) Syntax: ScreenSaver(action);

Parameters: action Screensaver-action. Can be: activate deactivate

Example: ScreenSaver(activate); ScreenSaver(deactivate);

Volume (Set Windows-Volume, mute it or turn it up, down) Syntax: Volume(action, percent);

Parameters: action Volume action. Can be: Up Down Set Mute Unmute MuteUnMute

percent Numerical value (in percent: 0..100). This parameter is partially optional.

Example: Volume(Set, 0); Volume(Set, 50); Volume(Down); Volume(Up); Volume(Down, 10); Volume(Up, 30); Volume(Mute); Volume(UnMute); Volume(MuteUnmute);

Page 13: MiriServer Documentation

SendJaLCDsCommand (Connect to a JaLCDs-Server and send a specified command) Syntax: SendJaLCDsCommand(host, port, command);

Parameters: host Hostname of the JaLCDs-Server port Port of the JaLCDs-Server. Normaly 10 possible ports; range

9825-9834. command Text value. Command that should be send to the JaLCDs-Server.

For more Information have a look at the JaLCDs-Documentation.

Example: SendJaLCDsCommand(localhost, 9825, ‘screen LCDScree n1’); SendJaLCDsCommand(127.0.0.1, 9830, ‘lcdoutput off’) ;

Sleep (Sleep for a while) Syntax: Sleep(milliseconds);

Parameters: milliseconds Numerical value in milliseconds. 1000 milliseconds = 1 second.

Example: Sleep(6000); Sleep(500);

Repeat (Repeat the specified commands x-times) Syntax: Repeat(count, listofcomands);

Parameters: count Numerical value. Number of repeats. listofcommands A list of MiriServer-Commands seperated by ‘;’, which should be

executed.

Example: Repeat(12, ‘Volume(down); Sleep(200);’);

ShowScreenMessage (Shows a message in front of the screen.) Syntax: ShowScreenMessage(text, seconds);

Parameters: text Text that should be shown on the screen. seconds Optional parameter. Duration, in seconds, of showing the

message. If left blank, MiriServer will show the message 3 seconds.

Example: ShowScreenMessage(%TIME%); ShowScreenMessage(%DATE%, 4); ShowScreenMessage(%TIME%#13#10%DATE%, 6); ShowScreenMessage(‘This is a test!’, 2); ShowScreenMessage(‘Line1#13#10Line2’);

Page 14: MiriServer Documentation

Variables-Reference There are some variables which you can use in MiriServer. Variables are case sensitive and usually in uppercase letters, locked by a percent sign.

Table

#13#10 Line break

%PLUGINDIR% Plugin-Directory

%MACRODIR% Macro-Directory

%SCREENMACRODIR% Screenmacro-Directory

%PROGRAMDIR% Application-Directory

%TIME% Current time

%DATE% Current date

%COMPUTERNAME% Name of the computer.

%WINDOWCAPTION% Caption of program-window. (only in Plugins)

%HANDLECAPTION% Caption directly from given handle (only in Plugins)

%WINAMPTITLE% Currently playing title from Winamp

%MORETVPROGRAMNUMBER% Current program-number of MoreTV

%MORETVPROGRAMNAME% Current program-name of MoreTV

Examples

ExecutePluginFunction(‘%PLUGINDIR%\Winamp.mPLG’, ‘N ext’);