Я подключаюсь к нему по IP, но когда я пытаюсь переименовать его в EPC памяти у меня ошибка.
Это мой код:
Код: Выделить всё
reader = new RFIDReader("XXX.XXX.XXX.XXX", 5084, 0);
reader.Connect();
Код: Выделить всё
string newTagId = tb_rename.Text;
name_length = newTagId.Length;
TagAccess.WriteAccessParams writeAccessParams = new TagAccess.WriteAccessParams();
writeAccessParams.AccessPassword = 0;
writeAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_EPC;
writeAccessParams.ByteOffset = 0;
if (name_length % 2 != 0)
{
Console.WriteLine("bad length of name");
return;
}
writeAccessParams.WriteDataLength = (uint) (name_length / 2);
byte[] newTagData = new byte[name_length / 2];
for (int index = 0; index < writeAccessParams.WriteDataLength; index += 2)
{
newTagData[index] = byte.Parse(newTagId.Substring(index * 2, 2),
System.Globalization.NumberStyles.HexNumber);
newTagData[index + 1] = byte.Parse(newTagId.Substring((index + 1) * 2, 2),
System.Globalization.NumberStyles.HexNumber);
}
writeAccessParams.WriteData = newTagData;
reader.Actions.TagAccess.WriteWait(selectedTagId, writeAccessParams, null);
Спасибо
Я пробую другой идентификатор, разную длину, другой банк памяти, но ничего не получается. ...
Подробнее здесь: https://stackoverflow.com/questions/789 ... in-c-sharp