新聞中心

        EEPW首頁 > 汽車電子 > 設計應用 > SyncML在藍牙車載信息娛樂設備上的設計與實現

        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是比較字符串函數,對輸入的兩個字符串不分大小寫按字節進行比較,具體代碼略。

        本文引用地址:http://www.104case.com/article/101084.htm


        評論


        相關推薦

        技術專區

        關閉
        主站蜘蛛池模板: 交城县| 江门市| 宽甸| 壶关县| 潼关县| 喀喇沁旗| 宁乡县| 大新县| 德保县| 凭祥市| 永定县| 旌德县| 焉耆| 盱眙县| 晋州市| 蕉岭县| 牡丹江市| 隆化县| 通城县| 香河县| 许昌市| 托里县| 天台县| 汕头市| 都江堰市| 巴彦县| 慈利县| 大邑县| 嘉黎县| 平顺县| 阿合奇县| 宣化县| 平定县| 济南市| 乌拉特后旗| 大关县| 陆丰市| 赤峰市| 宜川县| 潢川县| 宁河县|