/* Following 3 functions taken from gsmdecode-0.7bis, with permission -  */
static int hc2b(unsigned char hex)
/* Following 3 functions taken from gsmdecode-0.7bis, with permission -  */
static int hc2b(unsigned char hex)
{
	hex = g_ascii_tolower(hex);
	if ((hex >= '0') && (hex <= '9'))
		return hex - '0';
	if ((hex >= 'a') && (hex <= 'f'))
		return hex - 'a' + 10;
	return -1;
}