Reading Serial Data From C (OSX /dev/tty)

后端 未结 4 1152
南方客
南方客 2021-01-22 21:46

I am trying to read data from a bluetooth barcode scanner (KDC300) using C. Here is the code I have so far, and the program successfully establishes a bluetooth connection to th

4条回答
  •  不知归路
    2021-01-22 22:06

    This line:

            while((res = read(fd,buf,255)) == 0);
    

    Does not do what you think it does. That's a while loop with an empty body.

提交回复
热议问题