public int encodeUCS2_0x81(char[] src, char[] des, int maxLen)
{
int i, j, len;
int base = 0xFF000000;
short[] tmpAlphaId = new short[40*4+4+1];
char[] temp = new char[5];
for (int i = 0; i < input.length(); i++) {
String hexInt = Integer.toHexString(input.charAt(i));
for (int j = 0; j < (4 - hexInt.length()); j++)
output.append("0");
output.append(hexInt);
}
return output.toString();
}
public int rild_sms_hexCharToDecInt(char[] hex, int length)
{
int i = 0;
int value, digit;
for (i = 0, value = 0; i < length && hex[i] != ‘\0‘; i++)
{
if (hex[i]>=‘0‘ && hex[i]<=‘9‘)
{
digit = hex[i] - ‘0‘;
}
else if ( hex[i]>=‘A‘ && hex[i] <= ‘F‘)
{
digit = hex[i] - ‘A‘ + 10;
}
else if ( hex[i]>=‘a‘ && hex[i] <= ‘f‘)
{
digit = hex[i] - ‘a‘ + 10;
}
else
{
return -1;
}
value = value*16 + digit;
}
return value;
}
public int countTheLength(char[] line, int maxlen)
{
char[] alphaId = new char[40*4+4+1];
char[] temp = new char[5];
int tmp, i, j;
int nameLimited = maxlen;
//pack Alpha Id
int len = line.length;
if ((len%4) != 0) {
//LOGE("The alphaId should encode using Hexdecimal: %s", line);
}else if(len > (40*4)) {
//LOGE("The alphaId shouldn‘t longer than RIL_MAX_PHB_NAME_LEN");
}