将数据写入特定标签

发布于 2024-08-17 02:35:56 字数 155 浏览 9 评论 0原文

是否可以使用 Motorola 的 EMDK for .NET / Symbol.rfid2.device dll 将数据写入特定的 RFID 标签(实际上是写入其用户内存)?想象一下,您面前有 2 个标签,并且您只想将数据写入其中之一。

WriteTag方法似乎不支持这一点。

Is it possible to write data to a specific RFID tag (to its user memory actually) by using Motorola's EMDK for .NET / the Symbol.rfid2.device dll ? Imagine you have 2 tags in front of you and you want to write data only to one of them.

The WriteTag method doesn't seem to support this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

西瓜 2024-08-24 02:35:56

我相信有一个带有 Symbol.RFID3.device 的新 EMDK,可让您执行标签特定操作。检查 CS_RFID3Sample3。

签名:

    // Summary:
    //     This method is used to write data to the memory bank of a specific tag.
    //
    // Parameters:
    //   tagID:
    //     EPC-ID of the Tag on which the Write operation is to be performed.
    //
    //   writeAccessParams:
    //     Parameters required for the Write operation.
    //
    //   antennaInfo:
    //     Antennas on which the current operation is to be performed. If this is null,
    //     operation will be performed on all Antennas.
    public void WriteWait(string tagID, TagAccess.WriteAccessParams writeAccessParams, AntennaInfo antennaInfo);

使用示例:

public RFIDResults WriteTag(string tagId, string writeData, MEMORY_BANK mb, Int32 offset)
    {
        byte[] writeUserData = null;
        writeUserData = new byte[writeData.Length / 2];

        ConvertStringToByteArray(writeData, ref writeUserData);

        TagAccess.WriteAccessParams writeParams = new TagAccess.WriteAccessParams();
        writeParams.AccessPassword = 0;
        writeParams.WriteData = writeUserData;
        writeParams.WriteDataLength = (uint)writeUserData.Length;
        writeParams.MemoryBank = mb;
        writeParams.ByteOffset = (uint)offset;
        try
        {
            m_RfidReader.Actions.TagAccess.WriteWait(tagId, writeParams, null);
            return RFIDResults.RFID_API_SUCCESS;
        }
        catch (OperationFailureException e)
        {
            return e.Result;
        }
    }

I believe there is a new EMDK with Symbol.RFID3.device that allows you to perform tag specific operations. Check CS_RFID3Sample3.

Signature:

    // Summary:
    //     This method is used to write data to the memory bank of a specific tag.
    //
    // Parameters:
    //   tagID:
    //     EPC-ID of the Tag on which the Write operation is to be performed.
    //
    //   writeAccessParams:
    //     Parameters required for the Write operation.
    //
    //   antennaInfo:
    //     Antennas on which the current operation is to be performed. If this is null,
    //     operation will be performed on all Antennas.
    public void WriteWait(string tagID, TagAccess.WriteAccessParams writeAccessParams, AntennaInfo antennaInfo);

Usage example:

public RFIDResults WriteTag(string tagId, string writeData, MEMORY_BANK mb, Int32 offset)
    {
        byte[] writeUserData = null;
        writeUserData = new byte[writeData.Length / 2];

        ConvertStringToByteArray(writeData, ref writeUserData);

        TagAccess.WriteAccessParams writeParams = new TagAccess.WriteAccessParams();
        writeParams.AccessPassword = 0;
        writeParams.WriteData = writeUserData;
        writeParams.WriteDataLength = (uint)writeUserData.Length;
        writeParams.MemoryBank = mb;
        writeParams.ByteOffset = (uint)offset;
        try
        {
            m_RfidReader.Actions.TagAccess.WriteWait(tagId, writeParams, null);
            return RFIDResults.RFID_API_SUCCESS;
        }
        catch (OperationFailureException e)
        {
            return e.Result;
        }
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文