完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我有几个关于使用Android SDK的ST24DV标签的问题。
1)readMailboxMessage(0,0)总是返回第一个字节,该字节为零。这个零第一个字节似乎来自标签本身,但我没有在数据表中找到任何参考。 2)readMailboxMessage(0,1)其中参数1是邮箱地址,参数2是要读取的字节数,永远不返回任何内容,而函数为calles的异步线程终止。为什么是这样? 3)fastReadMailboxMessage()和fastWriteMailboxMessage与2)中的函数调用具有相同的行为。我的硬件(华为Mate 7)不支持这些快速操作模式吗? 任何帮助将非常感激。 你的,安德烈亚斯 #fastwritemailboxmessage #readmailboxmessage#first-byte #zero#st25dv #fastreadmailboxmessage 以上来自于谷歌翻译 以下为原文 Hi, I have a few questions about the use of the Android SDK for the ST24DV tags. 1) readMailboxMessage(0,0) allways returns a first byte which is zero. This zero-first byte seems to come from the tag itself, but I did not find any reference in the datasheet. 2) readMailboxMessage(0,1) where argument one is the mailbox adress, and argument two is the amount of bytes to read, never returns anything and the asyncrounous thread in which the function is calles terminates. Why is this? 3) fastReadMailboxMessage() and fastWriteMailboxMessage sho the same behavoir as the function call in 2). Is it possible, that these fast operation modes are not supported by my hardware (Huawei Mate 7)? Any help would be very appreciated. Yours, Andreas #fastwritemailboxmessage #readmailboxmessage #first-byte #zero #st25dv #fastreadmailboxmessage |
|
相关推荐
5个回答
|
|
你好安德烈亚斯,
首先,对于所有快速传输命令,必须使用ST25DVTag.enableMailbox()命令启用邮箱。 问题1: myST25DVTag.readMailboxMessage(0,0)将读取I2C接口写入的邮箱的完整内容。以下陈述是等效的。 response = myST25DVTag.readMailboxMessage(0,0); 完成相同的结果: int len = myST25DVTag.readMailboxMessageLength(); response = myST25DVTag.readMailboxMessage(0,len); 问题2: myST25DVTag.readMailboxMessage(0,1)将抛出BAD_PARAMETER STException。 这是因为这一事实 ST25DVTag。 readMailboxMessage(int address,int size)获取要从邮箱中读取的实际字节数。标签理解的RF命令返回(大小+ 1)字节。 要使用RF命令读取字节,您需要发送(大小+ 1)值为0.当对地址0执行此操作时,该命令将实际返回邮箱的全部内容,如问题1所示。 由于标记的行为,决定为参数元组(0,1)抛出BAD_PARAMETER异常。 如果要读取第一个字节,建议读取邮箱的完整内容,然后选择第一个字节。 关于你的问题3: ST25 SDK可用于Android或任何Java应用程序。 readers 目录中的库为ST和FEIG ELECTRONIC的USB读卡器提供支持。 ST类型5读卡器支持快速命令,但不适用于Android手机。 有关快速传输模式流程的更多信息,请参阅本应用笔记: http://www.st.com/resource/en/application_note/dm00328899.pdf 最好的祝福 以上来自于谷歌翻译 以下为原文 Hello Andreas, First, for all the fast transfer commands , you must enable the mailbox with the ST25DVTag.enableMailbox() command. For question 1: myST25DVTag.readMailboxMessage(0,0) will read the full content of the mailbox as written by the I2C interface. The following statements are equivalent. response = myST25DVTag.readMailboxMessage(0, 0); accomplishes the same result as: int len = myST25DVTag.readMailboxMessageLength(); response = myST25DVTag.readMailboxMessage(0, len); For question 2: myST25DVTag.readMailboxMessage(0,1) will throw a BAD_PARAMETER STException. This arises from the fact that ST25DVTag. readMailboxMessage(int address, int size) takes the actual number of bytes that you want to read from the mailbox. The RF command understood by the tag returns (size + 1) bytes. To read a byte with the RF command, you would need to send a (size + 1) value of 0. When doing so for address 0, the command will actually return the whole content of the mailbox, as seen in question 1. Because of the tag's behavior, it was decided to throw a BAD_PARAMETER exception for the parameter tuple (0, 1). If you want to read the first byte, it is recommended to read the full content of the mailbox then select the first byte. Regarding your question 3: The ST25 SDK can be used for Android or any Java applications. Libraries in the readers directory provide support for USB readers from ST and FEIG ELECTRONIC. Fast commands are supported by ST type 5 readers but do not apply to Android phones. More information on the fast transfer mode flow can be found in this application note: http://www.st.com/resource/en/application_note/dm00328899.pdf Best regards |
|
|
|
你好Damien,
非常感谢你非常详细的答案!然而,我仍然不明白,为什么 byte [] sendByte = {0xAA}; mST25DV.writeMailboxMessage(sendByte); byte [] recByte = mSt25DV.readMailboxMessage(0,0); 回报 {0x00,0xAA} 对于recByte 。为什么第一个零字节被添加?另外我有一个新问题:在测试填充整个256字节邮箱所需的时间时,我来到了 java.io.IOException:收发长度超过支持的最大值 尝试发送超过241个字节时发生异常。我认为这是一个Android / Java问题,你能证实这一点吗? 期待着听到您的意见, 安德烈亚斯 以上来自于谷歌翻译 以下为原文 Hello Damien, thank you very much for the very detailed answer! However what I still dont understand is, why byte[] sendByte = {0xAA}; mST25DV.writeMailboxMessage(sendByte); byte[] recByte = mSt25DV.readMailboxMessage(0,0); returns {0x00, 0xAA} for recByte . Why is that first zero-byte added?Plus I have a new question: While testing how much time it takes to fill the whole 256 bytes of the mailbox, I came to the point where a java.io.IOException: Transceive length exceeds supported maximum exception occured when trying to send more than 241 bytes. I think this is a Android/Java problem, can you confirm this? Looking forward to hear from you, Andreas |
|
|
|
嗨安德烈亚斯,
返回的第一个字节 byte [] recByte mSt25DV.readMailboxMessage(0,0); 实际上是Iso命令的状态字节。值0x00表示操作成功。 错误值以字节0x01开头,后跟Iso15693规范文档中描述的错误字节。 要检索实际的邮箱消息,请复制不带第一个字节的字节数组: byte [] message = Arrays.copyOfRange( recByte ,1,recByte 。长度); 但是,我认为您刚刚指出API中的不一致,因为在读取大小= 1的情况下不返回状态字节...这有点乱。正确的解决方法是删除所有读取大小的状态字节,但需要主要版本的st25sdk库(并打破现有的应用程序)。感谢您提请我们注意这一点。 对于Android Transceive长度错误,这可能来自智能手机上的IsoDep实施。虽然ST25DV标签可以发送高达256字节数据的响应+ 7字节协议= 263字节,但并非所有NFC读取器和控制器都可以容纳这个长度。 这就是我们在RFReaderInterface API中添加了getMaxTransmitLengthInBytes()和getMaxReceiveLengthInBytes()方法的原因。调用那些来获取设备支持的最大值,然后相应地设置max read命令(考虑到ST25DV数据表中详细说明的readMessage命令的7字节开销)。 最好的祝福, 达米安 以上来自于谷歌翻译 以下为原文 Hi Andreas, The first byte returned by byte[] recByte mSt25DV.readMailboxMessage(0,0); is actually the Iso command's status byte. A value of 0x00 means a successful operation. Error values start with byte 0x01 followed by the error byte described in the Iso15693 specification document. To retrieve the actual mailbox message, copy the byte array without the first byte: byte[] message = Arrays.copyOfRange( recByte , 1, recByte .length); However, I think you just pointed out an inconsistency in the API as the status byte is NOT returned in the case of a read size = 1... It's a bit of a mess. The correct fix would be to remove the status byte for all read sizes but would require a major release of the st25sdk library (and break existing apps). Thanks for bringing up this point to our attention. For the Android Transceive length error, this may come from the IsoDep implementation on your smartphone. While the ST25DV tag can send responses up to 256 bytes of data + 7 bytes of protocol = 263 bytes, not all NFC readers and controllers can accommodate this length. This is why we have added getMaxTransmitLengthInBytes() and getMaxReceiveLengthInBytes() methods in the RFReaderInterface API. Call those to get the max value supported by your device then set your max read command accordingly (taking into account those 7 bytes of overhead detailed in the ST25DV's datasheet for the readMessage command). Best regards, Damien |
|
|
|
非常感谢你! SD25 SDK非常好用,但文档可能会更好一些。另一方面,如果有一个代码(大多数情况下)解释自己,并且这个代码无法通过代码回答的问题论坛,谁需要一个文档
|
|
|
|
嗨安德烈亚斯,
我们已经考虑了你的评论。 SDK 1.2.0版删除了不连贯的返回 readMailboxMessage(n,1)。 从现在开始,在所有读取大小的情况下,在数据之前返回状态字节。 请参阅以下帖子: https://community.st.com/message/198545-st25-sdk-v120-available-online 以上来自于谷歌翻译 以下为原文 Hi Andreas, we have taken your remark into account. Version 1.2.0 of the SDK removes the incoherent return of the readMailboxMessage(n, 1). The status byte is returned before the data in all cases of read sizes from now on. See the following post: https://community.st.com/message/198545-st25-sdk-v120-available-online |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2642 浏览 1 评论
3208 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1783 浏览 1 评论
3611 浏览 6 评论
5989 浏览 21 评论
940浏览 4评论
1317浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
585浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1304浏览 3评论
1362浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 03:42 , Processed in 1.393476 second(s), Total 86, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号