在向门控器发送信号的时候,播放声音和通过GPIO向wiegand发送信号的时候,由于wiegand的资源优先级别不够和声音的播放可能发生了冲突,有时向GPIO发送信号的时候,发送失败。
static void wiegand_send_byte(int fd, unsigned char data, unsigned char bit)
{
unsigned long arg = (bit << 8) | data;
if (ioctl(fd, WIEGAND_IOCTL_OUTPUT, arg) != 0)
DEBUG_PRINT("Failed to output data. Fd is %d, arg is %ld
", fd, arg);
}