HE4K-DCK-1X User Instructions
DOC-USR-0123-06
______________________________________________________________________________________
Z3 Technology, LLC
♦
100 N 8
th
ST, STE 250
♦
Lincoln, NE 68508-1369 USA
♦
+1.402.323.0702
83
{0x06,0x81,0x01,0x04,0x07,0x03,0xFF,0x00,0x00,0x00},
//zoom out
{0x06,0x81,0x01,0x04,0x07,0x00,0xFF,0x00,0x00,0x00},
//zoom stop
{0x05,0x81,0x09,0x00,0x02,0xFF,0x00,0x00,0x00,0x00},
//Version Inq
{0x06,0x81,0x01,0x04,0x66,0x02,0xFF,0x00,0x00,0x00},
//Pic flip on
{0x06,0x81,0x01,0x04,0x66,0x03,0xFF,0x00,0x00,0x00},
//Pic flip off
};
//open the device in non-blocking way (read will return immediately)
if (argc == 1)
{
usage();
exit(-1);
}
else
{
int portno = 1000, n;
struct sockaddr_in serv_addr;
WSADATA wsa;
printf("\nInitialising Winsock...");
if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0)
{
printf("Failed. Error Code : %d", WSAGetLastError());
return -1;
}
//open tcp socket
s = socket(AF_INET, SOCK_STREAM, 0);
if (s == INVALID_SOCKET)
{
printf("error opening socket : %d\n", WSAGetLastError());
return -2;
}
printf("connecting to %s:%s\n", argv[1], argv[2]);
if (argv[2] != NULL)
{
portno = strtoul(argv[2], NULL, 10);
}
memset((char *) &serv_addr, 0,sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = inet_addr(argv[1]);
serv_addr.sin_port = htons(portno);
if (connect(s,(struct sockaddr *) &serv_addr,sizeof(serv_addr)) < 0)
{
printf("ERROR connecting\n");
return -3;
}
printf("connected!\n");
}
if (s != INVALID_SOCKET) {
help();
while ( 1) {
ch = _getch();