1 |
///Real route identification/////////////////////////////////////////// |
2 |
#include "descript.h" |
3 |
void FindRoute(int buffer3[], int *rr) |
4 |
{ |
5 |
int i; |
6 |
int tmp=0, tmp1=0, tmp2=0; |
7 |
int count=0, count1=0, count2=0; |
8 |
|
9 |
tmp=buffer3[8]; |
10 |
if ((tmp!=0)&&(tmp!=0xFF)) |
11 |
{ |
12 |
for (i=9;i<72;i++) |
13 |
{if (tmp==buffer3[i]) count+=1;} |
14 |
} |
15 |
|
16 |
tmp1=buffer3[9]; |
17 |
if ((tmp1!=0)&&(tmp!=0xFF)) |
18 |
{ |
19 |
for (i=10;i<72;i++) |
20 |
{if (tmp1==buffer3[i]) count1+=1;} |
21 |
} |
22 |
|
23 |
tmp2=buffer3[10]; |
24 |
if ((tmp2!=0)&&(tmp!=0xFF)) |
25 |
{ |
26 |
for (i=11;i<72;i++) |
27 |
{if (tmp2==buffer3[i]) count2+=1;} |
28 |
} |
29 |
|
30 |
if (count>50) |
31 |
{ |
32 |
*rr=tmp; |
33 |
} |
34 |
else if (count1>49) |
35 |
{ |
36 |
*rr=tmp1; |
37 |
} |
38 |
else if (count2>48) |
39 |
{ |
40 |
*rr=tmp2; |
41 |
} |
42 |
else |
43 |
{ |
44 |
*rr=0; |
45 |
} |
46 |
// cout<<count<<" "<<count1<<" "<<count2<<"\n"; |
47 |
// cout<<tmp<<" "<<tmp1<<" "<<tmp2<<"\n"; |
48 |
// cout<<*rr<<"\n"; |
49 |
} |
50 |
|