SyncML在蓝牙车载信息娱乐设备上的设计与实现

  作者:马建辉 山东省科学院自动化研究所 汽车电子重点实验室 吕梦兴 南京工业大学土木工程学院交通工程系 时间:2009-12-11来源:电子产品世界

unsigned int vcard_parse(void)
 {   
  unsigned int cnt,end,i,phone_index;
  char* p;
  end=vcard_length; 
  value_initia();
  /*begin to parse vcard*/
  for (cnt=13; cnt      after"BEGIN:VCARD"*/
  {
           if((0xd==an_complete_vcard[cnt])&&(0xa==an_
                                     complete_vcard[cnt+1]))
          {  
        /*extract a property,another property parameter or vcard end*/
                    cnt=cnt+2;/*skip rn*/
       /*if vcard end*/ 
        p=&an_complete_vcard[cnt];
                     if(0==uCompareASCIIName(p,"END:VCARD",9))
                        {
                if(vcard_cmd==ADD)
                  { 
                                                 phonebook_insert();
                        }//the vcard cmd ADD
    else if(vcard_cmd==REPLACE)
    {   
    }// the vcard cmd REPLACE 
     return 0;
  }else if(0==uCompareASCIIName(p,"TEL;",4))
  {    
         cnt=cnt+4;/* TEL property ,first skip "TEL;"*/           …
           p=&an_complete_vcard[cnt];
           if(0==uCompareASCIIName(p,"PREF",4))/*mobile
            phonenumber*/
       {     
    cnt=cnt+4;/*skip the "PREF"*/
      ...
                                 cnt=cnt-2;/*check next rn,in the "for",cnt++,so -2,not -1*/
  }else if(0==uCompareASCIIName(p,"VOICE",5))
  {
  }else if(0==uCompareASCIIName(p,"CELL",4))
  { 
  }else if(0==uCompareASCIIName(p,"HOME",4))
  {
  }else if(0==uCompareASCIIName(p,"WORK",4))
  {
  } else if(0==uCompareASCIIName(p,"CAR",3))
  {  
  }
  } else if(0==uCompareASCIIName(p,"TEL:",4))
  { //some phone’s telephone have no parameter,
           for example TEL:10086  
  }else if(0==uCompareASCIIName(p,"N",1))
  { //name property
  }
       }
 }
return 0;
}
  其中,uCompareASCIIName是比较字符串函数,对输入的两个字符串不分大小写按字节进行比较,具体代码略。

1 2 3 4

关键词: SyncML 蓝牙 车载信息娱乐设备 绑定 OBEX 200912

加入微信
获取电子行业最新资讯
搜索微信公众号:EEPW

或用微信扫描左侧二维码

相关文章

查看电脑版