31 std::cout <<
"Starting hand detector..." << std::endl;
46 struct ifaddrs *ifaddr, *ifa;
49 if (-1 == getifaddrs(&ifaddr))
55 for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa->ifa_next, n++)
84 char *port_name_c_str = &port_name[0];
85 if (ec_init(port_name_c_str))
99 char *port_name_c_str = &port_name[0];
100 if (ec_init(port_name_c_str))
105 hand_serial = *
reinterpret_cast<uint32 *
>(wbuf + 0x0E);
112 std::cout <<
"No socket connection on " << port_name_c_str <<
". Excecute as root.";
119 int i, wkc, ainc = 4;
137 estat =
etohs(estat);
141 for (i =
start ; i < (
start + length) ; i+=ainc)
145 ebuf_[i+1] = b8 >> 8;
146 ebuf_[i+2] = b8 >> 16;
147 ebuf_[i+3] = b8 >> 24;
148 ebuf_[i+4] = b8 >> 32;
149 ebuf_[i+5] = b8 >> 40;
150 ebuf_[i+6] = b8 >> 48;
151 ebuf_[i+7] = b8 >> 56;
156 for (i =
start ; i < (
start + length) ; i+=ainc)
160 ebuf_[i+1] = b4 >> 8;
161 ebuf_[i+2] = b4 >> 16;
162 ebuf_[i+3] = b4 >> 24;