蓝牙车载产品的兼容性设计
对于号码字段的提取,关键字不仅是HOME、WORK、CELL、CAR,还要把PREF、VOICE作为可以被识别的关键字,而且有手机不带关键字,把不带关键字的处理为CELL即手机属性即可。
本文引用地址:https://www.eepw.com.cn/article/108773.htm呼叫时间,其字段以X-IRMC-CALL-DATETIME表示,其标准格式举例如下:20080112T1212,年四个字节,月和日分别两个字节,但对于部分手机,其月和日没有严格遵循该规范,月+日字段共两个字节或共三个字节,这就需要根据月和日的特性进行特殊处理了。处理代码如下,月日字节数为temp_month_date_length,存放在temp_month_date数组中,
if(temp_month_date_length==2)
{
temp_month=temp_month_date[0]-0x30;
temp_date=temp_month_date[1]-0x30;
}
else if(temp_month_date_length==3)
{
if(temp_month_date[0]>0x31)//then the character must be month
{
//214-2 14
temp_month=temp_month_date[0]-0x30;
temp_date=(unsigned char)((temp_month_date[1]
-0x30)*10+(temp_month_date[2]-0x30));
}
else if(temp_month_date[1]>0x32)
{
//130-1 30
temp_month=temp_month_date[0]-0x30;
temp_date=(unsigned char)((temp_month_date[1]
-0x30)*10+(temp_month_date[2]-0x30));
}
else
{
//114 to month=11 date=4
temp_month=(unsigned char)((temp_month_date[0]
-0x30)*10+(temp_month_date[1]-0x30));
temp_date=temp_month_date[2]-0x30;
if(temp_month>=11)
{
temp_month=0;
temp_date=0;
}
}
}
结语
兼容性是蓝牙产品开发中的难点问题,本文分析了兼容性问题出现的原因,并结合具体实例分析其解决方法,有很好的借鉴意义。
评论