Zdenka Šibíková
/
vytah
vytah
Fork of CRC by
Diff: main.cpp
- Revision:
- 3:cfd90d96f26a
- Parent:
- 2:cd46eb6deb30
--- a/main.cpp Mon Dec 04 15:49:59 2017 +0000 +++ b/main.cpp Mon Dec 04 22:45:42 2017 +0000 @@ -54,6 +54,7 @@ char naodoslanie[6]; char odpoved[5]; char crc=0x00; +char sprava[4]; char ccc[256]={0, 94, 188, 226, 97, 63, 221, 131, 194, 156, 126, 32, 163, 253, 31, 65, 157, 195, 33, 127, 252, 162, 64, 30, 95, 1, 227, 189, 62, 96, 130, 220, 35, 125, 159, 193, 66, 28, 254, 160, 225, 191, 93, 3, 128, 222, 60, 98, @@ -74,7 +75,41 @@ int main() { - +while(true){ + if(pc.readable()==1){ + sprava[0]=pc.getc(); + break; + + } + } +while(true){ + if(pc.readable()==1){ + sprava[1]=pc.getc(); + break; + } + } +while(true){ + if(pc.readable()==1){ + sprava[2]=pc.getc(); + break; + } + } +while(true){ + if(pc.readable()==1){ + sprava[3]=pc.getc(); + break; + } + } + int pom=sprava[3]+1; + for(int i=0;i<pom;i++){ +while(true){ + if(pc.readable()==1){ + sprava[1]=pc.getc(); + break; + } + } } + + int dlzka=sizeof(naodoslanie)/sizeof(naodoslanie[0]); naodoslanie[0]=0xA0;//zaciatocny bajt