Mercurial > hg > fxanalyse
diff kk-data-provider.c @ 192:f105ac22da05
Fixes
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Mon, 31 Mar 2014 17:03:31 +0200 |
parents | bc980095a24d |
children | 4b74b81e0c79 |
line wrap: on
line diff
--- a/kk-data-provider.c Mon Mar 31 17:03:31 2014 +0200 +++ b/kk-data-provider.c Mon Mar 31 17:03:31 2014 +0200 @@ -39,18 +39,18 @@ /* get serial port name configuration */ rv = Ini_GetStringIntoBuffer(configuration, "KK", "port", port, sizeof(port)); - if (! rv) + if (rv < 1) strncpy(port, DEFAULT_PORT, sizeof(port)); /* channel number */ rv = Ini_GetInt(configuration, "KK", "nchan", &nchan); - if (! rv) + if (rv < 1) nchan = DEFAULT_NCHAN; /* enable scrambler */ rv = Ini_GetInt(configuration, "KK", "scrambler", &scrambler); - if (! rv) - scrambler = FALSE; + if (rv < 1) + scrambler = 0; /* free */ Ini_Dispose(configuration); @@ -140,7 +140,7 @@ /* scrambler */ cmd = "\x50"; cmd[0] += scrambler; - rv = FX_Send("\x50"); + rv = FX_Send(cmd); if (! rv) { SendMessage(mainThreadId, FX_Error()); goto error; @@ -171,7 +171,8 @@ break; } - if (strneq(resp, "2900", 4)) { + /* 2900 with scrambler off or 2910 with scrambler on */ + if (strneq(resp, "29", 2)) { /* timestamp */ gettimeofday(&event.time, NULL); @@ -200,10 +201,8 @@ with some other information */ } else if (strneq(resp, "7020", 4)) { /* undocumented packet. it probably reports the header for - subsequent data packets. match it against expected value */ - if (strcmp(resp + 6, "$2900")) { - SendMessage(mainThreadId, "KK Counter: %s", resp); - } + subsequent data packets */ + SendMessage(mainThreadId, "KK Counter packet header: %s", resp + 7); } else if (strneq(resp, "7F51", 4)) { /* measurement interval synchronized */ SendMessage(mainThreadId, "KK Counter measurement interval synchronized");