int hex2str(unsigned int data, char* s, int len)
{
int i;
s[len] = 0;
for (i = len - 1; i >= 0; i--, data >>= 4)
{
if ((data & 0xf) <= 9)
s[i] = (data & 0xf) + '0';
else
s[i] = (data & 0xf) + 'A' - 0x0a;
}
return 1;
}