/* Auto connect to recently used remote bluetooth device.  */
tBtResult BTAutoConnect()
/* Auto connect to recently used remote bluetooth device.  */
tBtResult BTAutoConnect()
{
	char cDevAddrArray[TEL0026_MAX_SCAN_DEVICES*15]={""};
	unsigned char ucDevCnt = 0;
	unsigned char i;
	unsigned char ucRes;
	ucDevCnt = BTScanRemoteDevice(1, 12, 16, cDevAddrArray);
	for(i=0; i<ucDevCnt*15; i+=15)
	{
		BTAddrConv(&cDevAddrArray[i]);
		ucRes = BTLocateAuthDevice(&cDevAddrArray[i]);
		if(ucRes == BT_ERR_OK)
		{
			ucRes = BTDeviceConnect(&cDevAddrArray[i]);
			if(ucRes == BT_ERR_OK)
				return BT_ERR_OK;
		}
	}
	return ucRes;
}