What is Nak Limit?

I’m trying to understand how the Open Open Access API works with the Arduino ADK, I was able to send and receive information, but I just want to know how everything works. I got a description of this function:

int AndroidAccessory::read(void *buff, int len, unsigned int nakLimit) { return usb.newInTransfer(1, in, len, (char *)buff, nakLimit); } 

From some googling, I realized that NAK is a code that is sent if something went wrong during a handshake, so that NAK limits the number of communication errors that can be received?

+6
source share
1 answer

NAK is not a communication error. He simply claims that the device is not ready to send a response or that there is currently no data to send. As far as I understand, the NAK limit in this function simply ensures that a certain end is defined for the function. In case of Full Speed ​​USB NAK will be generated every 1 ms. For more information on NAK, try the following: http://www.beyondlogic.org/usbnutshell/usb3.shtml#USBPacketTypes

+1
source

Source: https://habr.com/ru/post/904788/


All Articles