From ee508088368eba60dcdba4ead6f85da07522592d Mon Sep 17 00:00:00 2001 From: Tim Everett <tim.everett3@gmail.com> Date: Wed, 21 Aug 2019 20:15:45 -0600 Subject: [PATCH] - Merge B33 changes from 2.4.3 code --- app/appcmn/serioptdlg.dfm | 9 +++-- src/ephemeris.c | 2 +- src/rcv/binex.c | 80 +++++++++++++++++++++++++++++++++++++-- src/rcv/comnav.c | 2 +- src/rcv/novatel.c | 2 +- src/rcv/nvs.c | 2 +- src/rcv/swiftnav.c | 8 ++-- src/rcv/tersus.c | 6 +-- src/rinex.c | 22 +++++++---- src/rtkcmn.c | 48 +++++++++++------------ src/rtklib.h | 8 ++-- src/rtkpos.c | 1 + src/stream.c | 14 ++++--- 13 files changed, 143 insertions(+), 61 deletions(-) diff --git a/app/appcmn/serioptdlg.dfm b/app/appcmn/serioptdlg.dfm index af0d501..742ed42 100644 --- a/app/appcmn/serioptdlg.dfm +++ b/app/appcmn/serioptdlg.dfm @@ -79,11 +79,11 @@ object SerialOptDialog: TSerialOptDialog TabOrder = 0 end object BitRate: TComboBox - Left = 76 - Top = 29 + Left = 74 + Top = 32 Width = 77 Height = 21 - DropDownCount = 12 + DropDownCount = 13 TabOrder = 3 Text = '115200' Items.Strings = ( @@ -98,7 +98,8 @@ object SerialOptDialog: TSerialOptDialog '57600' '115200' '230400' - '460800') + '460800' + '921600') end object Port: TComboBox Left = 74 diff --git a/src/ephemeris.c b/src/ephemeris.c index 0bf6163..8f62ba2 100644 --- a/src/ephemeris.c +++ b/src/ephemeris.c @@ -101,7 +101,7 @@ static int eph_sel[]={ /* GPS,GLO,GAL,QZS,BDS,SBS */ /* variance by ura ephemeris -------------------------------------------------*/ static double var_uraeph(int sys, int ura) { if (sys==SYS_GAL) - return SQR(uravalue(sys,ura)); + return SQR(sisa_value(ura)); else return ura<0||14<ura?SQR(6144.0):SQR(ura_value[ura]); } diff --git a/src/rcv/binex.c b/src/rcv/binex.c index d29924c..bce80ad 100644 --- a/src/rcv/binex.c +++ b/src/rcv/binex.c @@ -18,6 +18,9 @@ * fix bug on unchange-test of beidou ephemeris * 2018/10/10 1.7 fix problem of sisa handling in galileo ephemeris * add receiver option -GALINAV, -GALFNAV +* 2018/12/06 1.8 fix bug on decoding galileo ephemeirs iode (0x01-04) +* 2019/05/10 1.9 save galileo E5b data to obs index 2 +* 2019/07/25 1.10 support upgraded galileo ephemeris (0x01-14) *-----------------------------------------------------------------------------*/ #include "rtklib.h" @@ -459,7 +462,7 @@ static int decode_bnx_01_01(raw_t *raw, unsigned char *buff, int len) eph.fit=flag&0xFF; eph.flag=(flag>>8)&0x01; eph.code=(flag>>9)&0x03; - eph.sva=uraindex(ura,SYS_GPS); + eph.sva=uraindex(ura); if (!strstr(raw->opt,"-EPHALL")) { if (raw->nav.eph[eph.sat-1].iode==eph.iode&& @@ -631,8 +634,7 @@ static int decode_bnx_01_04(raw_t *raw, unsigned char *buff, int len) eph.toe=gpst2time(eph.week,eph.toes); eph.toc=gpst2time(eph.week,eph.toes); eph.ttr=adjweek(eph.toe,tow); - eph.sva=uraindex(ura,SYS_GAL); - + eph.sva=ura<0.0?(int)(-ura)-1:sisa_index(ura); /* sisa index */ if (!strstr(raw->opt,"-EPHALL")) { if (raw->nav.eph[eph.sat-1].iode==eph.iode&& raw->nav.eph[eph.sat-1].iodc==eph.iodc) return 0; /* unchanged */ @@ -768,7 +770,7 @@ static int decode_bnx_01_06(raw_t *raw, unsigned char *buff, int len) eph.toc=gpst2time(eph.week,eph.toes); eph.ttr=adjweek(eph.toe,tow); eph.fit=(flag&0x01)?0.0:2.0; /* 0:2hr,1:>2hr */ - eph.sva=uraindex(ura,SYS_QZS); + eph.sva=uraindex(ura); eph.code=2; /* codes on L2 channel */ if (!strstr(raw->opt,"-EPHALL")) { @@ -779,6 +781,75 @@ static int decode_bnx_01_06(raw_t *raw, unsigned char *buff, int len) raw->ephsat=eph.sat; return 2; } +/* decode binex mesaage 0x01-14: upgraded decoded galileo ephmemeris ---------*/ +static int decode_bnx_01_14(raw_t *raw, unsigned char *buff, int len) +{ + eph_t eph={0}; + unsigned char *p=buff; + double tow,ura,sqrtA; + int prn,tocs,eph_sel=0; + + trace(4,"binex 0x01-14: len=%d\n",len); + + if (strstr(raw->opt,"-GALINAV")) eph_sel=1; + if (strstr(raw->opt,"-GALFNAV")) eph_sel=2; + + if (len>=135) { + prn =U1(p)+1; p+=1; + eph.week =U2(p); p+=2; /* gal-week = gps-week */ + tow =I4(p); p+=4; + tocs =I4(p); p+=4; + eph.toes =I4(p); p+=4; + eph.tgd[0]=R4(p); p+=4; /* BGD E5a/E1 */ + eph.tgd[1]=R4(p); p+=4; /* BGD E5b/E1 */ + eph.iode =I4(p); p+=4; /* IODnav */ + eph.f2 =R4(p); p+=4; + eph.f1 =R4(p); p+=4; + eph.f0 =R8(p); p+=8; + eph.deln =R4(p)*SC2RAD; p+=4; + eph.M0 =R8(p); p+=8; + eph.e =R8(p); p+=8; + sqrtA =R8(p); p+=8; + eph.cic =R4(p); p+=4; + eph.crc =R4(p); p+=4; + eph.cis =R4(p); p+=4; + eph.crs =R4(p); p+=4; + eph.cuc =R4(p); p+=4; + eph.cus =R4(p); p+=4; + eph.OMG0 =R8(p); p+=8; + eph.omg =R8(p); p+=8; + eph.i0 =R8(p); p+=8; + eph.OMGd =R4(p)*SC2RAD; p+=4; + eph.idot =R4(p)*SC2RAD; p+=4; + ura =R4(p); p+=4; + eph.svh =U2(p); p+=2; + eph.code =U2(p); /* data source defined as rinex 3.03 */ + } + else { + trace(2,"binex 0x01-14: length error len=%d\n",len); + return -1; + } + if (!(eph.sat=satno(SYS_GAL,prn))) { + trace(2,"binex 0x01-14: satellite error prn=%d\n",prn); + return -1; + } + if (eph_sel==1&&!(eph.code&(1<<9))) return 0; /* only I/NAV */ + if (eph_sel==2&&!(eph.code&(1<<8))) return 0; /* only F/NAV */ + + eph.A=sqrtA*sqrtA; + eph.iodc=eph.iode; + eph.toe=gpst2time(eph.week,eph.toes); + eph.toc=gpst2time(eph.week,tocs); + eph.ttr=adjweek(eph.toe,tow); + eph.sva=ura<0.0?(int)(-ura)-1:sisa_index(ura); /* sisa index */ + if (!strstr(raw->opt,"-EPHALL")) { + if (raw->nav.eph[eph.sat-1].iode==eph.iode&& + raw->nav.eph[eph.sat-1].iodc==eph.iodc) return 0; /* unchanged */ + } + raw->nav.eph[eph.sat-1]=eph; + raw->ephsat=eph.sat; + return 2; +} /* decode binex mesaage 0x01: gnss navigaion informtion ----------------------*/ static int decode_bnx_01(raw_t *raw, unsigned char *buff, int len) { @@ -798,6 +869,7 @@ static int decode_bnx_01(raw_t *raw, unsigned char *buff, int len) case 0x04: return decode_bnx_01_04(raw,buff+1,len-1); case 0x05: return decode_bnx_01_05(raw,buff+1,len-1); case 0x06: return decode_bnx_01_06(raw,buff+1,len-1); + case 0x14: return decode_bnx_01_14(raw,buff+1,len-1); } return 0; } diff --git a/src/rcv/comnav.c b/src/rcv/comnav.c index 6eea680..cb2f06c 100644 --- a/src/rcv/comnav.c +++ b/src/rcv/comnav.c @@ -989,7 +989,7 @@ static int decode_bdsephemerisb(raw_t *raw) eph.cic =R8(p); p+=8; eph.cis =R8(p); eph.A =sqrtA*sqrtA; - eph.sva =uraindex(ura,SYS_CMP); + eph.sva =uraindex(ura); if (raw->outtype) { msg=raw->msgtype+strlen(raw->msgtype); diff --git a/src/rcv/novatel.c b/src/rcv/novatel.c index 656a2cf..998e3ac 100644 --- a/src/rcv/novatel.c +++ b/src/rcv/novatel.c @@ -1028,7 +1028,7 @@ static int decode_bdsephemerisb(raw_t *raw) eph.cic =R8(p); p+=8; eph.cis =R8(p); eph.A =sqrtA*sqrtA; - eph.sva =uraindex(ura,SYS_CMP); + eph.sva =uraindex(ura); if (raw->outtype) { msg=raw->msgtype+strlen(raw->msgtype); diff --git a/src/rcv/nvs.c b/src/rcv/nvs.c index 48ac1a5..eb0f9d1 100644 --- a/src/rcv/nvs.c +++ b/src/rcv/nvs.c @@ -197,7 +197,7 @@ static int decode_gpsephem(int sat, raw_t *raw) eph.f2 = R4(&puiTmp[114]) * 1e+3; eph.f1 = R4(&puiTmp[118]); eph.f0 = R4(&puiTmp[122]) * 1e-3; - eph.sva = uraindex(I2(&puiTmp[126]),SYS_GPS); + eph.sva = uraindex(I2(&puiTmp[126])); eph.iode = I2(&puiTmp[128]); eph.iodc = I2(&puiTmp[130]); eph.code = I2(&puiTmp[132]); diff --git a/src/rcv/swiftnav.c b/src/rcv/swiftnav.c index 04bae7b..09e094e 100644 --- a/src/rcv/swiftnav.c +++ b/src/rcv/swiftnav.c @@ -494,7 +494,7 @@ static void decode_gpsnav_common_dep1(uint8_t *_pBuff, eph_t *_pEph) { _pEph->toes = U4(_pBuff + 4); uWeekE = U2(_pBuff + 8); - _pEph->sva = uraindex(R8(_pBuff + 10), SYS_GPS); /* URA index */ + _pEph->sva = uraindex(R8(_pBuff + 10)); /* URA index */ _pEph->fit = U4(_pBuff + 18) / 3600; /* _pEph->flag = U1(_pBuff + 22); SBP payload does not have L2 flag */ _pEph->svh = U1(_pBuff + 23); @@ -539,7 +539,7 @@ static void decode_gpsnav_common(uint8_t *_pBuff, eph_t *_pEph) { _pEph->toes = U4(_pBuff + 4); uWeekE = U2(_pBuff + 8); - _pEph->sva = uraindex(R4(_pBuff + 10), SYS_CMP); /* URA index */ + _pEph->sva = uraindex(R4(_pBuff + 10)); /* URA index */ _pEph->fit = U4(_pBuff + 14) / 3600; /* _pEph->flag = U1(_pBuff + 18); SBP payload does not have L2 flag */ _pEph->svh = U1(_pBuff + 19); @@ -584,7 +584,7 @@ static void decode_bdsnav_common(uint8_t *_pBuff, eph_t *_pEph) { _pEph->toes = U4(_pBuff + 4) - BDS_SECOND_TO_GPS_SECOND; uWeekE = U2(_pBuff + 8); - _pEph->sva = uraindex(R4(_pBuff + 10),SYS_CMP); /* URA index */ + _pEph->sva = uraindex(R4(_pBuff + 10)); /* URA index */ _pEph->fit = U4(_pBuff + 14) ? 0 : 4; _pEph->flag = U1(_pBuff + 18); @@ -629,7 +629,7 @@ static void decode_galnav_common(uint8_t *_pBuff, eph_t *_pEph) { _pEph->toes = U4(_pBuff + 4); uWeekE = U2(_pBuff + 8); - _pEph->sva = uraindex(R4(_pBuff + 10), SYS_GAL); /* URA index */ + _pEph->sva = sisa_index(R4(_pBuff + 10)); /* URA index */ _pEph->fit = U4(_pBuff + 14) ? 0 : 4; _pEph->flag = U1(_pBuff + 18); diff --git a/src/rcv/tersus.c b/src/rcv/tersus.c index c75488c..207ceba 100644 --- a/src/rcv/tersus.c +++ b/src/rcv/tersus.c @@ -429,8 +429,8 @@ static int decode_gpsephemb(raw_t *raw) eph.toe=gpst2time(eph.week,eph.toes); eph.toc=gpst2time(eph.week,toc); eph.ttr=adjweek(eph.toe,tow); - eph.sva=uraindex(ura,SYS_GPS); - + eph.sva=uraindex(ura); + if (!strstr(raw->opt,"-EPHALL")) { if (timediff(raw->nav.eph[eph.sat-1].toe,eph.toe)==0.0&& raw->nav.eph[eph.sat-1].iode==eph.iode&& @@ -543,7 +543,7 @@ static int decode_bdsephemerisb(raw_t *raw) eph.cic =R8(p); p+=8; eph.cis =R8(p); eph.A =sqrtA*sqrtA; - eph.sva =uraindex(ura,SYS_CMP); + eph.sva =uraindex(ura); if (raw->outtype) { msg=raw->msgtype+strlen(raw->msgtype); diff --git a/src/rinex.c b/src/rinex.c index 5bfb470..19a7b26 100644 --- a/src/rinex.c +++ b/src/rinex.c @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------------ * rinex.c : rinex functions * -* Copyright (C) 2007-2018 by T.TAKASU, All rights reserved. +* Copyright (C) 2007-2019 by T.TAKASU, All rights reserved. * * reference : * [1] W.Gurtner and L.Estey, RINEX The Receiver Independent Exchange Format @@ -92,6 +92,7 @@ * 2016/10/10 1.27 add api outrnxinavh() * 2018/10/10 1.28 support galileo sisa value for rinex nav output * fix bug on handling beidou B1 code in rinex 3.03 +* 2019/08/19 1.29 support galileo sisa index for rinex nav input *-----------------------------------------------------------------------------*/ #include "rtklib.h" @@ -1105,7 +1106,7 @@ static int decode_eph(double ver, int sat, gtime_t toc, const double *data, eph->code=(int)data[20]; /* GPS: codes on L2 ch */ eph->svh =(int)data[24]; /* sv health */ - eph->sva=uraindex(data[23],sys); /* ura (m->index) */ + eph->sva=uraindex(data[23]); /* ura (m->index) */ eph->flag=(int)data[22]; /* GPS: L2 P data flag */ eph->tgd[0]= data[25]; /* TGD */ @@ -1136,7 +1137,7 @@ static int decode_eph(double ver, int sat, gtime_t toc, const double *data, /* bit 4-5: E5a HS */ /* bit 6: E5b DVS */ /* bit 7-8: E5b HS */ - eph->sva =uraindex(data[23],sys); /* ura (m->index) */ + eph->sva =sisa_index(data[23]); /* sisa (m->index) */ eph->tgd[0]= data[25]; /* BGD E5a/E1 */ eph->tgd[1]= data[26]; /* BGD E5b/E1 */ @@ -1153,7 +1154,7 @@ static int decode_eph(double ver, int sat, gtime_t toc, const double *data, eph->ttr=adjweek(eph->ttr,toc); eph->svh =(int)data[24]; /* satH1 */ - eph->sva=uraindex(data[23],sys); /* ura (m->index) */ + eph->sva=uraindex(data[23]); /* ura (m->index) */ eph->tgd[0]= data[25]; /* TGD1 B1/B3 */ eph->tgd[1]= data[26]; /* TGD2 B2/B3 */ @@ -1165,7 +1166,7 @@ static int decode_eph(double ver, int sat, gtime_t toc, const double *data, eph->toe=adjweek(gpst2time(eph->week,data[11]),toc); eph->ttr=adjweek(gpst2time(eph->week,data[27]),toc); eph->svh =(int)data[24]; /* sv health */ - eph->sva=uraindex(data[23],sys); /* ura (m->index) */ + eph->sva=uraindex(data[23]); /* ura (m->index) */ eph->tgd[0]= data[25]; /* TGD */ } if (eph->iode<0||1023<eph->iode) { @@ -1259,7 +1260,7 @@ static int decode_seph(double ver, int sat, gtime_t toc, double *data, seph->acc[0]=data[5]*1E3; seph->acc[1]=data[9]*1E3; seph->acc[2]=data[13]*1E3; seph->svh=(int)data[6]; - seph->sva=uraindex(data[10],SYS_SBS); + seph->sva=uraindex(data[10]); return 1; } @@ -2425,7 +2426,12 @@ extern int outrnxnavb(FILE *fp, const rnxopt_t *opt, const eph_t *eph) outnavf(fp,eph->flag ); fprintf(fp,"\n%s",sep ); - outnavf(fp,uravalue(sys,eph->sva)); + if (sys==SYS_GAL) { + outnavf(fp,sisa_value(eph->sva)); + } + else { + outnavf(fp,uravalue(eph->sva)); + } outnavf(fp,eph->svh ); outnavf(fp,eph->tgd[0] ); /* GPS/QZS:TGD, GAL:BGD E5a/E1, BDS: TGD1 B1/B3 */ if (sys==SYS_GAL||sys==SYS_CMP) { @@ -2627,7 +2633,7 @@ extern int outrnxhnavb(FILE *fp, const rnxopt_t *opt, const seph_t *seph) outnavf(fp,seph->pos[1]/1E3 ); outnavf(fp,seph->vel[1]/1E3 ); outnavf(fp,seph->acc[1]/1E3 ); - outnavf(fp,uravalue(SYS_SBS,seph->sva)); + outnavf(fp,uravalue(seph->sva)); fprintf(fp,"\n%s",sep ); outnavf(fp,seph->pos[2]/1E3 ); diff --git a/src/rtkcmn.c b/src/rtkcmn.c index c8ee183..e4926c5 100644 --- a/src/rtkcmn.c +++ b/src/rtkcmn.c @@ -2631,37 +2631,35 @@ static void uniqseph(nav_t *nav) trace(4,"uniqseph: ns=%d\n",nav->ns); } /* ura index to ura nominal value (m) ----------------------------------------*/ -extern double uravalue(int sys, int sva) +extern double uravalue(int sva) { - if (sys==SYS_GAL) { - if (sva<= 49) return sva*0.01; - if (sva<= 74) return 0.5+(sva- 50)*0.02; - if (sva<= 99) return 1.0+(sva- 75)*0.04; - if (sva<=125) return 2.0+(sva-100)*0.16; - return -1.0; /* unknown or NAPA */ - } - else { - return 0<=sva&&sva<15?ura_nominal[sva]:8192.0; - } + return 0<=sva&&sva<15?ura_nominal[sva]:8192.0; } -extern int uraindex(double value, int sys) +/* ura value (m) to ura index ------------------------------------------------*/ +extern int uraindex(double value) { int i; - - if (sys==SYS_GAL) { - if (value>0 && value<0.5) - i=(int)(value*100+0.5); - else if (value>=0.5 && value<1.0) - i=50+(int)((value-0.5)/2*100+0.5); - else if (value>=1.0 && value<2.0) - i=75+(int)((value-1.0)/4*100); - else if (value>=2.0 && value<6.0) - i=100+(int)((value-2.0)/16*100+0.5); - else i=125; - } else - for (i=0;i<15;i++) if (ura_value[i]>=value) break; + for (i=0;i<15;i++) if (ura_value[i]>=value) break; return i; } +/* galileo sisa index to sisa nominal value (m) ------------------------------*/ +extern double sisa_value(int sisa) +{ + if (sisa<= 49) return sisa*0.01; + if (sisa<= 74) return 0.5+(sisa- 50)*0.02; + if (sisa<= 99) return 1.0+(sisa- 75)*0.04; + if (sisa<=125) return 2.0+(sisa-100)*0.16; + return -1.0; /* unknown or NAPA */ +} +/* galileo sisa value (m) to sisa index --------------------------------------*/ +extern int sisa_index(double value) +{ + if (value<0.0 || value>6.0) return 255; /* unknown or NAPA */ + else if (value<=0.5) return (int)(value/0.01); + else if (value<=1.0) return (int)((value-0.5)/0.02)+50; + else if (value<=2.0) return (int)((value-1.0)/0.04)+75; + return (int)((value-2.0)/0.16)+100; +} /* unique ephemerides ---------------------------------------------------------- * unique ephemerides in navigation data and update carrier wave length * args : nav_t *nav IO navigation data diff --git a/src/rtklib.h b/src/rtklib.h index 4193fa1..e9083a8 100644 --- a/src/rtklib.h +++ b/src/rtklib.h @@ -58,7 +58,7 @@ extern "C" { #define VER_RTKLIB "demo5" /* library version */ -#define PATCH_LEVEL "b32" /* patch level */ +#define PATCH_LEVEL "b33" /* patch level */ #define COPYRIGHT_RTKLIB \ "Copyright (C) 2007-2019 T.Takasu\nAll rights reserved." @@ -1647,8 +1647,10 @@ EXPORT int input_rnxctr(rnxctr_t *rnx, FILE *fp); EXPORT double eph2clk (gtime_t time, const eph_t *eph); EXPORT double geph2clk(gtime_t time, const geph_t *geph); EXPORT double seph2clk(gtime_t time, const seph_t *seph); -EXPORT double uravalue(int sys, int ura); -EXPORT int uraindex(double value, int sys); +EXPORT double uravalue(int ura); +EXPORT int uraindex(double value); +EXPORT double sisa_value(int sisa); +EXPORT int sisa_index(double value); EXPORT void eph2pos (gtime_t time, const eph_t *eph, double *rs, double *dts, double *var); EXPORT void geph2pos(gtime_t time, const geph_t *geph, double *rs, double *dts, diff --git a/src/rtkpos.c b/src/rtkpos.c index 3d7ce4e..86a0070 100644 --- a/src/rtkpos.c +++ b/src/rtkpos.c @@ -1779,6 +1779,7 @@ static int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa,int gps,int glo,in } else { errmsg(rtk,"lambda error (info=%d)\n",info); + nb=0; } free(D); free(y); free(Qy); free(DP); free(b); free(db); free(Qb); free(Qab); free(QQ); diff --git a/src/stream.c b/src/stream.c index 6452f59..d87aa28 100644 --- a/src/stream.c +++ b/src/stream.c @@ -63,6 +63,7 @@ * fix bug on timeset() in gpst instead of utc * update trace levels and buffer sizes * 2019/05/10 1.27 fix bug on dropping message on tcp stream (#144) +* 2019/08/19 1.28 support 460800 and 921600 bps for serial *-----------------------------------------------------------------------------*/ #include <ctype.h> #include "rtklib.h" @@ -335,7 +336,8 @@ static DWORD WINAPI serialthread(void *arg) static serial_t *openserial(const char *path, int mode, char *msg) { const int br[]={ - 300,600,1200,2400,4800,9600,19200,38400,57600,115200,230400,460800 + 300,600,1200,2400,4800,9600,19200,38400,57600,115200,230400,460800, + 921600 }; serial_t *serial; int i,brate=115200,bsize=8,stopb=1,tcp_port=0; @@ -354,7 +356,7 @@ static serial_t *openserial(const char *path, int mode, char *msg) }; #else /* regular Linux with higher baudrates */ const speed_t bs[]={ - B300,B600,B1200,B2400,B4800,B9600,B19200,B38400,B57600,B115200,B230400,B460800 + B300,B600,B1200,B2400,B4800,B9600,B19200,B38400,B57600,B115200,B230400,B460800,B921600 }; #endif /* ifdef __APPLE__ */ struct termios ios={0}; @@ -373,8 +375,8 @@ static serial_t *openserial(const char *path, int mode, char *msg) if ((p=strchr(path,'#'))) { sscanf(p,"#%d",&tcp_port); } - for (i=0;i<11;i++) if (br[i]==brate) break; - if (i>=12) { + for (i=0;i<13;i++) if (br[i]==brate) break; + if (i>=14) { sprintf(msg,"bitrate error (%d)",brate); tracet(1,"openserial: %s path=%s\n",msg,path); free(serial); @@ -810,7 +812,7 @@ static int readfile(file_t *file, unsigned char *buff, int nmax, char *msg) } /* seek time-tag file to get next tick and file position */ while ((int)(file->tick_n-t)<=0) { - + if (fread(&file->tick_n,sizeof(tick),1,file->fp_tag)<1|| fread(file->size_fpos==4?(void *)&fpos_4B:(void *)&fpos_8B, file->size_fpos,1,file->fp_tag)<1) { @@ -827,7 +829,7 @@ static int readfile(file_t *file, unsigned char *buff, int nmax, char *msg) sprintf(msg,"end"); } else { - sprintf(msg,"T%+.1fs",(int)t*0.001); + sprintf(msg,"T%+.1fs",(int)t*0.001); } file->wtime = timeadd(file->time,(int)t*0.001); timeset(timeadd(gpst2utc(file->time),(int)file->tick_n*0.001)); -- GitLab