- local writecommand = Command:new{cmd = cmds.CMD_T55XX_WRITE_BLOCK, arg1 = configdata ,arg2 = 0, arg3 = 0}
- local err = core.SendCommand(writecommand:getBytes())
- if err then return oops(err) end
- local response = core.WaitForResponseTimeout(cmds.CMD_ACK,TIMEOUT)
-
- if response then
- local count,cmd,arg0 = bin.unpack('LL',response)
- if(arg0==1) then
- dbg("Writing success")
- else
- return nil, "Couldn't read block.."
- end
+ elseif _ == 1 then
+
+ dbg("Writing to T55x7 TAG")
+
+ local config = cmd:format(bitrate, modulation, clockrate)
+ dbg(('lf t55xx write 0 %s'):format(config))
+
+ config = tonumber(config,16)
+ local writecommand = Command:new{cmd = cmds.CMD_T55XX_WRITE_BLOCK, arg1 = config ,arg2 = 0, arg3 = 0}
+ local err = core.SendCommand(writecommand:getBytes())
+ if err then return oops(err) end
+ local response = core.WaitForResponseTimeout(cmds.CMD_ACK,TIMEOUT)
+ else
+ dbg(cmd)
+ core.console( cmd )