#include "PalmType.h"
#include "p_util.h"

static CCHAR _cDtmfKeys[MAP_KEY_NUM] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '#', 'T'};

UCHAR p_getKeyId(UCHAR iChar)
{
	DCHAR i;

	for (i = 0; i < MAP_KEY_NUM; i ++)
	{
		if(iChar == _cDtmfKeys[i])
		{		
			return i;
		}
	}

	return MAP_KEY_UNKNOWN;
}

UCHAR p_getAsciiKey(UCHAR iChar)
{
	if (iChar >= 0 && iChar < MAP_KEY_NUM)
	{
		return (UCHAR)(_cDtmfKeys[iChar]);
	}
	else
	{
		return 0;
	}
}
