SW1SW2=6781 swCommandTooLong


[ Follow Ups ] [ BasicCard User Forum ]

Posted by matthiash (91.46.74.243) on June 28, 2010 at 15:47:08:

Hi,
i have a Cardprogramm with a SaveReordc Command:

Declare Command &H50 &H0A SaveRecord (Number as integer, Label as string * 25, Name1 as string * 25, Name2 as string * 25, Password as string * 25)

Command &H50 &H0A SaveRecord (Number as integer, Label as string * 25, Name1 as string * 25, Name2 as string * 25, Password as string * 25)

The Terminalprogramm looks like this:

Record.Label = "Testlabel"
Record.Name1 = "Testname1"
Record.Name2 = "Testname2"
Record.Password = "Testpasswort"

Call SaveRecord(99, Record.Label, Record.Name1, Record.Name2, Record.Password)

So, all works fine and SW1SW2 return 9000.

No i try this in C# with this Code:

cmd_SaveRecord.Reset();
cmd_SaveRecord.Append(Number);
cmd_SaveRecord.AppendBasicStringN(new BasicCardStringN(25, UserDatas[0], BasicCardStringN.CharsetIdAscii));
cmd_SaveRecord.AppendBasicStringN(new BasicCardStringN(25, UserDatas[1], BasicCardStringN.CharsetIdAscii));
cmd_SaveRecord.AppendBasicStringN(new BasicCardStringN(25, UserDatas[2], BasicCardStringN.CharsetIdAscii));
cmd_SaveRecord.AppendBasicStringN(new BasicCardStringN(25, UserDatas[3], BasicCardStringN.CharsetIdAscii));

BasicCardResponse rsp = DoCommandAndResponse(cmd_SaveRecord);
rsp.CheckSW1SW2();

Now SW1SW2 returns 6781 (swCommandTooLong). But if i Debug the APDU, it lokks like this:

CommandAPDU:
50 0A 00 00 68 00 00 00 00 54 65 73 74 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 62 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 63 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

This is very smaller than 256 Bytes, as you can see at the Byte with the value 68. What is wrong with my Code?

I'm using a Professional BasicCard ZC55.





Follow Ups:


[ Follow Ups ] [ BasicCard User Forum ]