static int HexStrToHexArray(char HexArray[], char HexStr[])
{
int i = 0,index = 0;
for(i = 0; HexStr[i]; i += 2)
{
if(HexStr[i] >= 'A' && HexStr[i] <= 'F')
{
HexArray[index] = HexStr[i] - 'A' + 10;
}
else
{
HexArray[index] = HexStr[i] - '0';
}
if(HexStr[i + 1] >= 'A' && HexStr[i + 1] <= 'F')
{
HexArray[index] = (HexArray[index] << 4) | (HexStr[i + 1] - 'A' + 10);
}
else
{
HexArray[index] = (HexArray[index] << 4) | (HexStr[i + 1] - '0');
}
++index;
}
return index;
}