什么是极限? [英] What is Nak Limit?
问题描述
我正在尝试了解 Android Open Accessory API 如何与 Arduino ADK 板配合使用,我已经能够发送和接收信息,但我只想知道一切是如何工作的.我得到了这个函数描述:
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);
}
通过谷歌搜索,我发现 NAK 是一些在握手期间出现问题时发送的代码,那么 NAK 是否限制了一个人能够接收的通信错误的数量?
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?
推荐答案
NAK 是没有通信错误.它只是说明设备尚未准备好发送回复或此时没有数据要发送.据我了解,此函数中的 NAK 限制将确保该函数有一个定义的结束.在全速 USB 的情况下,将每 1 毫秒生成一次 NAK.有关 NAK 的更多信息,请尝试:http://www.beyondlogic.org/usbnutshell/usb3.shtml#USBPacketTypes
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
这篇关于什么是极限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!