Vz:Doc:SerControl
From M1Research
(Difference between revisions)
(One intermediate revision not shown) | |||
Line 20: | Line 20: | ||
};</pre> | };</pre> | ||
- | Commands to <b>VZ</b> could be build by | + | Commands to <b>VZ</b> could be build and parsed by functions from <code>vzCmd.dll</code> (see source code <code>[{{SERVER}}//viewvc/viewvc.cgi/vz/trunk/src/vzCmd/ vzCmd folder]</code> folder). |
- | Commands creating examples (snipplets from <code>tvdevctl</code> automation: | + | Commands creating examples (snipplets from <code>tvdevctl</code> automation): |
+ | <pre> | ||
+ | char buf[1024]; | ||
+ | int buf_len = 0; | ||
+ | int param = 0; | ||
+ | |||
+ | |||
+ | //---------------------------------------------------- | ||
+ | |||
+ | vz_serial_cmd_create | ||
+ | ( | ||
+ | buf, &buf_len, | ||
+ | VZ_CMD_RESET_DIRECTOR, "d_ab_mix", ¶m, | ||
+ | NULL | ||
+ | ); | ||
+ | |||
+ | //---------------------------------------------------- | ||
+ | |||
+ | vz_serial_cmd_create | ||
+ | ( | ||
+ | buf, &buf_len, | ||
+ | VZ_CMD_START_DIRECTOR, "d_ab_mix", ¶m, | ||
+ | NULL | ||
+ | ); | ||
+ | |||
+ | //---------------------------------------------------- | ||
+ | |||
+ | char artist[1024], title[1024], recorders[1024]; | ||
+ | /* | ||
+ | set variable here | ||
+ | */ | ||
+ | vz_serial_cmd_create | ||
+ | ( | ||
+ | buf, &buf_len, | ||
+ | VZ_CMD_SET, "t_artist_c", "s_text", artist, | ||
+ | VZ_CMD_SET, "t_title_c", "s_text", title, | ||
+ | VZ_CMD_SET, "t_recorder_c", "s_text", recorder, | ||
+ | NULL | ||
+ | ); | ||
+ | </pre> |
Latest revision as of 20:47, 24 March 2007
Serial Control protocol is used to control VZ throw serial link - most usefull to autiomation/playlist transmit system.
To enable Serial Control protocol make sure you uncommented section serserver.
Serial link operates on 115200 speed with odd parity and confired using code:
// configure DCB lpdcb; memset(&lpdcb, 0, sizeof(DCB)); lpdcb.BaudRate = (UINT) CBR_115200; // 115200 b/s // a. 1 start bit ( space ) lpdcb.ByteSize = (BYTE) 8; // b. 8 data bits lpdcb.Parity = (BYTE) ODDPARITY; // c. 1 parity bit (odd) lpdcb.StopBits = (BYTE) ONESTOPBIT; // d. 1 stop bit (mark) lpdcb.fParity = 1; lpdcb.fBinary = 1; if (!(SetCommState(serial_port_handle, &lpdcb))) { printf("serserver: ERROR! Unable to configure '%s' [err: %d]\n",serial_port_name, GetLastError()); ExitThread(0); };
Commands to VZ could be build and parsed by functions from vzCmd.dll
(see source code vzCmd folder
folder).
Commands creating examples (snipplets from tvdevctl
automation):
char buf[1024]; int buf_len = 0; int param = 0; //---------------------------------------------------- vz_serial_cmd_create ( buf, &buf_len, VZ_CMD_RESET_DIRECTOR, "d_ab_mix", ¶m, NULL ); //---------------------------------------------------- vz_serial_cmd_create ( buf, &buf_len, VZ_CMD_START_DIRECTOR, "d_ab_mix", ¶m, NULL ); //---------------------------------------------------- char artist[1024], title[1024], recorders[1024]; /* set variable here */ vz_serial_cmd_create ( buf, &buf_len, VZ_CMD_SET, "t_artist_c", "s_text", artist, VZ_CMD_SET, "t_title_c", "s_text", title, VZ_CMD_SET, "t_recorder_c", "s_text", recorder, NULL );