- if((tem_len % 2) == 0)
- {
- for(i = 0 ,j =0; i < tem_len;i++,j++)
- {
- tem_h = (BYTE)(Cbuf<<4)&0xf0 ;
- tem_l = (BYTE)(Cbuf[++i]&0x0f);
- Bbuf[j] = tem_h | tem_l;
- }
- *blen = (tem_len/2);
- }
- else
- {
- if(tem_len == 1)
- {
- Bbuf[0] = (BYTE)(Cbuf[tem_len-1]&0x0f);
- *blen = tem_len;
- }
- else
- {
- for(i = 0 ,j =0; i < tem_len-1;i++,j++)
- {
- tem_h = (BYTE)(Cbuf<<4)&0xf0 ;
- tem_l = (BYTE)(Cbuf[++i]&0x0f);
- Bbuf[j] = tem_h | tem_l;
- }
- Bbuf[tem_len/2] = (BYTE)(Cbuf[tem_len-1]&0x0f);
- *blen = (tem_len/2)+1;
- }
- }
- }
|