I am working on NFC mifare card reader and am trying to create a byte array like this, but i get an error
int FIX_SECTOR_COUNT = 16;
const int numOfSector = 16;
const int numOfBlockInSector = 4;
byte[][][] buffer = new byte[FIX_SECTOR_COUNT][numOfSector][numOfBlockInSector];
Error CS0178 Invalid rank specifier: expected ',' or ']
so i did this
byte[][][] buffer = new byte[][][] { };
but i need help instantiating it.
i need the byte array to do something like this:
try
{
taskTag.Connect();
for (int s = 0; s < numOfSector; s++)
{
if (taskTag.AuthenticateSectorWithKeyA(s, MifareClassic.KeyDefault.ToArray()))
{
for (int b = 0; b < numOfBlockInSector; b++)
{
int blockIndex = (s * numOfBlockInSector) + b;
buffer[s][b] = taskTag.ReadBlock(blockIndex);
}
}
}
success = true;
}
catch (Java.IO.IOException e)
{
e.PrintStackTrace();
}
if (success)
{
string stringBlock = "";
for (int i = 0; i < numOfSector; i++)
{
stringBlock += i + " :\n";
for (int j = 0; j < numOfBlockInSector; j++)
{
for (int k = 0; k < MifareClassic.BlockSize; k++)
{
stringBlock += string.Format("%02X", buffer[i][j][k] & 0xff) + " ";
}
stringBlock += "\n";
}
stringBlock += "\n";
}
}