freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

第8章基于gprs技術的遠程監(jiān)控系統(tǒng)(編輯修改稿)

2025-06-12 21:23 本頁面
 

【文章內容簡介】 9d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78, }。 U16 GetCrc16(const U8* pData, U8 nLength) { U16 fcs = 0xffff。 pData++。 while(nLength0) { fcs = (fcs 8) ^ crctab16[(fcs ^ *pData) amp。 0xff]。 nLength。 pData++。 } return ~fcs。 } U8 IsCrc16Good(const U8 *pData, U8 nLength) { U16 fcs = 0xffff。 pData++。 while(nLength0) { fcs = (fcs 8) ^ crctab16[(fcs ^ *pData) amp。 0xff]。 nLength。 pData++。 } return (fcs == 0xf0b8)。 // 0xf0b8 is CRCITU39。sMagic Value } /********************************find buff************************************/ /* author: muyi date: * rework: date: * function: find out the frame in uart0_revbuff[256]。check the crc ,if the crc is right ,delete 9 the ff 03 * after the start 7e *IO: return 1 when crc ok ,0 when crc false */ U8 Find_Frame(void) { U8 back_count0 = uart0_count。 U8 flag_start7e = FAIL。 U8 flag_end7e = FAIL。 U8 start7e = 0。 U8 end7e = 0。 U8 i = 0。 U8 j = 0。 U8 k = 0。 U8 temp[150]。 for (k=0。 k255。 k++,back_count0) // find the end 7e { if (uart0_revbuff[back_count0] == 0x7e) { if (uart0_revbuff[back_count01] == 0x7e) //in case of....7e7e.... { back_count0。 end7e=back_count0。 //mark the end 7e flag_end7e = OK。 break。 } else { end7e = back_count0。 //mark the end 7e flag_end7e = OK。 break。 } } } back_count0。 for (k=0。 k255。 k++,back_count0) //find the start 7e { if (uart0_revbuff[back_count0] == 0x7e) { start7e = back_count0。 //mark the start 7e flag_start7e = OK。 break。 } } if (flag_start7e == FAIL || flag_end7e == FAIL) //if there is no frame , go to the end goto END。 k=0。 //copy the found frame from uart0_recbuff[] to temp[] for (i=start7e,j=0。 k0x02。 i++,j++) { temp[j] = uart0_revbuff[i]。 if (uart0_revbuff[i] == 0x7e) 10 k++。 } receiveFrame[0] = temp[0]。 //start7e for (i=1,j=1。 temp[i]!=0x7e。 i++,j++) //transfer meaning { if (temp[i] == 0x7d) { receiveFrame[j]=(temp[i+1]amp。0x20)?(temp[i+1]amp。0xdf):(temp[i+1]|0x20)。 i++。 } else receiveFrame[j] = temp[i]。 } receiveFrame[j] = temp[i]。 if ( IsCrc16Good(receiveFrame , j1) ) { uart0_revbuff[start7e] = 0。 // clear the found frame in the revbuff0 uart0_revbuff[end7e] = 0。 if (receiveFrame[1] == 0xff) { for (i=1。 i149。 i++) //if receiveFrame[1]=0xff ,then drop it { receiveFrame[i] = receiveFrame[i+1]。 } } if (receiveFrame[1] == 0x03) //if receiveFrame[1]=0x03 ,then drop it { for (i=1。 i149。 i++) { receiveFrame[i] = receiveFrame[i+1]。 } } return 1。 } else // if crc check fail then clear the receiveFrame[] { for (i=0。 i150。 i++) { receiveFrame[i] = 0。 } return 0。 } END: return 0 。 } /***********************************lcp**********************************/ void Lcp(void) { U8 *p_lcp=receiveFrame。 U16 crc16。 11 U8 flag=0。 U8 i。 Static U8。 copy1[]={0x7e,0xff,0x03,0xc0,0x21,0x03,0x00,0x00,0x08,0x03,0x04,0xc0,0x23,0x00,0x00,0x7e}。 //pap U8 temp[50]。 U8 flag_sd=1。 p_lcp=p_lcp+3。 switch(*p_lcp) { case 0x01: //request { p_lcp=p_lcp+4。 do { switch (*p_lcp) { case 0x01: //MaximumReceiveUnit pass { p_lcp=p_lcp+4。 }break。 case 0x02: //AsyncControlCharacterMap pass { p_lcp=p_lcp+6。 }break。 case 0x03: //AuthenticationProtocol chap to pap { if ( *(p_lcp+1) == 0x05 ) { flag=1。 p_lcp=p_lcp+5。 for (i=0。 i10。 i++) { temp[i]=copy1[i]。 } temp[6]=receiveFrame[4]。 //indentifer } else p_lcp=p_lcp+4。 }break。 case 0x05: //MagicNumber { p_lcp=p_lcp+6。 }break。 case 0x07: //ProtocolFieldCompression { p_lcp=p_lcp+2。 }break。 case 0x08: //AddressandControlFieldCompression { p_lcp=p_lcp+2。 }break。 default: break。 } 12 }while( (flag == 0x00) amp。amp。 ( *(p_lcp+2) != 0x7e) )。 if (flag == 0x00 ) { flagLcpServ = OK。 temp[0]=0x7e。 temp[1]=0xff。 temp[2]=0x03。 for(i=1。 i6+receiveFrame[6]。 i++) { temp[i+2]=receiveFrame[i]。 } temp[5]=0x02。 //ack } }break。 case 0x02: { flagLcpClient = OK。 flag_sd = 0。 } case 0x03: { temp[0]=0x7e。 temp[1]=0xff。 temp[2]=0x03。 for(i=1。 i6+receiveFrame[6]。 i++) { temp[i+2]=receiveFrame[i]。 } temp[5]=0x01。 //ack }break。 default:flag_sd=0。break。 } if (flag_sd == 1) { crc16=GetCrc16(temp , temp[8]+4)。 temp[ temp[8]+5 ] = crc16 amp。 0xff。 temp[ temp[8]+6 ] = (crc16 8) amp。 0xff。 Transfer_Meaning( temp , temp[8]+8 )。 PrintBuff(uart0SendBuff , UART0)。 } } /**************************************Pap************************************/ void Pap(void) { if (receiveFrame[3] == 0x02 ) { flagPap = OK。 } } /****************
點擊復制文檔內容
范文總結相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1