什么是珞限制?

2023-09-07 18:06:12 作者:妞丶给爷站住

我试图去了解Android开放配件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一些code,一旦发生握手期间​​不对的被发送,因此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的情况下,将NAK每1ms产生。有关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

相关推荐