What is Nak Limit?

别说谁变了你拦得住时间么 提交于 2020-01-03 09:05:17

问题


Am trying to understand how the Android Open Accessory API works with the Arduino ADK board, I've been able send and receive information but I just want to know how everything works. I got to this function description:

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

From some googling I figured that NAK is some code that gets sent if something went wrong during the handshake, so is NAK limit the number of communication errors one is able to receive?


回答1:


NAK is no Communication error. It simply states that the Device is not ready to send a reply or that there are no data to send at this moment. As I understand it the NAK limit in this function will just make sure that there's a defined end for the function. In case of Full Speed USB a NAK will be generated every 1ms. For more information about the NAK try this: http://www.beyondlogic.org/usbnutshell/usb3.shtml#USBPacketTypes



来源:https://stackoverflow.com/questions/8686130/what-is-nak-limit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!