<< Click to display table of contents >> TRVCamSender.SendCmd, BeginCmd, EndCmd, WaitSendCmd |
Methods for sending commands to TRVCamReceiver (when the sender is connected via the network with TRVCamReceiver either directly or through TRVMediaServer).
procedure BeginCmd;
procedure EndCmd;
procedure WaitForSendCmd(IsProcessMessages: Boolean;
AMediaIndex: Word = 0);
procedure SendCmd(Cmd: TRVCmd; vGUIDTo: TRVMAnsiString = '';
vGUIDGroup: TRVMAnsiString = ''; AMediaIndex: Word = 0);
Names of commands sent to a server must not start from 'RV_' or 'RVS_', These prefixes are reserved for system commands.
SendCmd sends Cmd to the client specified in vGUIDTo (if vGUIDTo is empy, GUIDTo property is used instead). If they are empty, the command is sent to clients belonging to the group having identifier vGUIDGroup (if vGUIDGroup is empty, GUIDGroup property is used instead). Otherwise, the command is sent to the default receivers (if they are defined). When the client's receiver receives a command, OnReceiveCmdData event occurs.
Commands with names starting from 'RVSU_' are processed specially. They are sent to the server itself (GUID parameters are ignored). When the server receives it, OnServerCmd event occurs. These commands are not resent by the server to clients. Commands to the server must not be large: the total command size, including all internal information, must not exceed 8912 bytes.
SendCmd sends Cmd to the receiver, vGUIDTo may specify a receiver identifier (if vGUIDTo is empy, GUIDTo property is used instead). Group identifier is ignored. When the receiver receives a command, OnReceiveCmdData event occurs.
SendCmd only initiates sending, and exits before this command is actually sent. Do not free Cmd object, it will be freed by TRVCamSender.
You can use WaitForSendCmd to wait untill all commands are sent. If IsProcessMessages=True, WaitForSendCmd contains a cycle calling Application.ProcessMessages, so check Application.Terminated after.
If you need to send several commands, call BeginCmd, then call multiple SendCmd, then call EndCmd. In this mode, commands are accumulated when calling SendCmd, and sent only in EndCmd.
The optional AMediaIndex parameter allows defining the index of media channel, thus linking this command to this channel. In the most applications, you can leave this parameter equal to 0.
See also