There only needs to be relatively short delay between the different
messages, but the delay between different messages varies quite
much. The delays introduced here are far from being optimal, but
reducing the delays too much causes unexpected behaviour.
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
exit(1);
}
- usleep(1000 * 1000);
+ usleep(30 * 1000);
printf("Sending: ");
print_hex(msg->data + 1, datalen(msg->data) - 1);
print_ascii(msg->data + 1, datalen(msg->data) - 1);
struct msg msg;
msg.direction = OUT;
+ usleep(100 * 1000);
SET_FIRST_BYTE(0x01);
SET_BYTES(0x04);
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(250 * 1000);
SET_BYTE(1, 0x15);
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
SET_BYTE(1, 0x05);
send_msg(&msg, fd, uc);
read_msgs(fd);
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
SET_BYTE(1, byte2);
send_msg(&msg, fd, uc);
read_msgs(fd);
SET_BYTE(1, 0x15);
for (i = 0; i < 6; i++) {
+ usleep(100 * 1000);
send_msg(&msg, fd, uc);
read_msgs(fd);
}
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
SET_BYTE(1, 0x05);
send_msg(&msg, fd, uc);
read_msgs(fd);
send_pattern(fd, uc, 'R', 'X');
send_pattern(fd, uc, 'W', 'K');
+ usleep(100 * 1000);
SET_FIRST_BYTE(0x08);
SET_BYTES('O');
SET_BYTES('b');
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(410 * 1000);
SET_FIRST_BYTE(0x02);
SET_BYTES('R');
SET_BYTES('|');
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
SET_BYTE(1, 'Y');
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
SET_BYTE(1, 'W');
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
SET_BYTE(1, 'K');
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
SET_BYTE(1, 'C');
send_msg(&msg, fd, uc);
read_msgs(fd);
send_pattern(fd, uc, 'R', 'Z');
+ usleep(100 * 1000);
SET_FIRST_BYTE(0x01);
SET_BYTES(0x04);
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
SET_BYTE(1, 0x15);
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
SET_BYTE(1, 0x05);
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
SET_BYTE(1, 0x04);
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
SET_BYTE(1, 0x06);
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
send_msg(&msg, fd, uc);
read_msgs(fd);
+ usleep(100 * 1000);
do {
send_msg(&msg, fd, uc);
read_and_verify(&in, fd);