Vz:Doc:SerControl

From M1Research

(Difference between revisions)
Jump to: navigation, search
Line 16: Line 16:
     if (!(SetCommState(serial_port_handle, &lpdcb)))
     if (!(SetCommState(serial_port_handle, &lpdcb)))
     {
     {
-
  printf("serserver: ERROR! Unable to configure '%s' [err: %d]\n",serial_port_name, GetLastError());
+
    printf("serserver: ERROR! Unable to configure '%s' [err: %d]\n",serial_port_name, GetLastError());
     ExitThread(0);
     ExitThread(0);
     };</pre>
     };</pre>

Revision as of 20:35, 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:

    // 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);
    };
Personal tools