send statusbyte to microHam device
| 556 | // send statusbyte to microHam device |
| 557 | // |
| 558 | static void writeFlags() |
| 559 | { |
| 560 | unsigned char seq[4]; |
| 561 | int ret; |
| 562 | |
| 563 | DEBUG("%10d:Sending FlagByte: %02x\n", TIME, statusbyte); |
| 564 | getlock(); |
| 565 | seq[0] = 0x08; |
| 566 | |
| 567 | if (statusbyte & 0x80) |
| 568 | { |
| 569 | seq[0] = 0x09; |
| 570 | } |
| 571 | |
| 572 | seq[1] = 0x80; |
| 573 | seq[2] = 0x80; |
| 574 | seq[3] = 0x80 | statusbyte; |
| 575 | |
| 576 | if ((ret = write(uh_device_fd, seq, 4)) < 4) |
| 577 | { |
| 578 | MYERROR("WriteFlags failed with %d\n", ret); |
| 579 | |
| 580 | if (ret < 0) |
| 581 | { |
| 582 | perror("WriteFlagsError:"); |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | freelock(); |
| 587 | } |
| 588 | |
| 589 | |
| 590 | #if defined(HAVE_SELECT) |