diff --git a/src/sondemod.c b/src/sondemod.c index 9fc2b17..223eb4d 100644 --- a/src/sondemod.c +++ b/src/sondemod.c @@ -3325,12 +3325,13 @@ static void decodem10(char rxb[], uint32_t rxb_len, uint32_t ip, uint32_t frompo float vbat,temp1,temp2; char to[1200]; uint32_t time0; - int typ; - - switch((unsigned char)(rxb[5]-',')){ - case 0: typ=ST_M10; break; - case 1: typ=ST_M10GT; break; - case 2: typ=ST_M2K2; break; + int typ,typt; + typt=(unsigned char)rxb[5]-','; + + switch(typt){ + case 1: typ=ST_M10; break; + case 2: typ=ST_M10GT; break; + case 3: typ=ST_M2K2; break; } rxb[5]=','; diff --git a/src/sondeudp.c b/src/sondeudp.c index c59ece9..0b03f44 100644 --- a/src/sondeudp.c +++ b/src/sondeudp.c @@ -2192,8 +2192,8 @@ static void decodeframe10(uint32_t m) for(i=0;i<9;i++) //nazwa s[i+13]=ids[i]; s[22]=0; - if( lat>-90.0 && lat<90.0 && lon>=-180.0 && lon<=180.0 && alt>0.0 && alt<45000.0 && dir>=0 && dir<361 && v>=0 && v<600 && - vv>-200 && vv<200 && vbat>0 && vbat<10 && temp1>-270.0 && temp1<100.0 && temp2>-270.0 && temp2<100.0){ + //if( lat>-90.0 && lat<90.0 && lon>=-180.0 && lon<=180.0 && alt>0.0 && alt<45000.0 && dir>=0 && dir<361 && v>=0 && v<600 && vv>-200 && vv<200 && vbat>0 && vbat<10 && temp1>-270.0 && temp1<100.0 && temp2>-270.0 && temp2<100.0){ + if( lat>-90.0 && lat<90.0 && lon>=-180.0 && lon<=180.0 && alt>0.0 && alt<45000.0 && dir>=0 && dir<361 && v>=0 && v<600 && vv>-200 && vv<200 && vbat>0 && vbat<10){ sprintf(s,"%s,%012lu,%09.5f,%010.5f,%05.0f,%03.0f,%05.1f,%05.1f,%05.2f,%06.1f,%06.1f,%06.0f\n",s,time0,lat,lon,alt,dir,v,vv,vbat,temp1,temp2,fq555); alludp(chan[m].udptx, 105, s, 105); }