TestWiki

From Electrolab
Jump to: navigation, search
#if 0
static void plop_dummy_reader(void *arg) {
        (void)arg;
        uint8_t buf[64];
        struct sockaddr_in sin;
        struct hostent *hp = gethostbyname("192.168.42.101");
        memset((char *) &sin, 0, sizeof(sin));
        memcpy((char *) &sin.sin_addr, hp->h_addr, hp->h_length);
        sin.sin_family = hp->h_addrtype;
        sin.sin_port = htons(2000);
 
        buf[0] = RFID_UDP_READER;
        buf[1] = 7;
        buf[2] = 98;
        buf[3] = 0x20;
        buf[4] = 0x40;
        buf[5] = 0x10;
        buf[6] = 0x90;
        buf[7] = 0x30;
        buf[8] = 0x50;
        plop_udp_recv(&sin, buf, 9);
 
        timeout(plop_dummy_reader, NULL, 5000);
}
#endif