Changes between Initial Version and Version 1 of Wave_Server_Protocol_Doc

01/19/12 18:25:13 (10 years ago)



  • Wave_Server_Protocol_Doc

    v1 v1  
     1'''Earthworm Wave Server Protocol''' 
     4This appendix is taken straight from the wave_serverV.c code comments, as there was no formal description of the protocol for clients to use to get waveforms from an Earthworm Wave Server (either wave_serverV or Winston). ISTI made modifications and amendments to the protocol, as some items were not described at all, or well, in the code comments. 
     6Last modified April 19, 2010, Paul Friberg 
     10 * <s><c><n><l> is short-hand for site code, channel code, network and location id. 
     11 * <flags> :: F | F<letter> ... <letter> 
     12Currently Supported Flags: 
     14 -      R - All requested data is right of the tank (after the tank). 
     16 -      L - All requested data is left of the tank (before the tank). 
     18 -      G - All requested data is in a gap in the tank. 
     20 -      B - The Client's request was bad. It contained incorrect syntax. 
     22 -      C - The tank from which the client requested data is corrupt. (Data may or may not be available for other time intervals in the tank. WARNING! This flag indicates that the tank is corrupt, this means data from other time intervals may be inaccurate) 
     24 -      N - The requested channel(tank) was not found in this wave_server. 
     26 -      U - An unknown error occurred. 
     28 * <datatype> is two character code ala CSS. Only supports i2, i4, s2, and s4. i for Intel; s for Sparc. 2 meaning two-bytes per integer, 4 ... 
     29 * Replies are ASCII, including trace data. 
     30 * <starttime> and <endtime> are double precision unix epochs since Jan 1,1970, including any fractions of seconds desired. 
     31 * The <request id> was added later to permit the wave viewer client to keep track of which reply belongs to which query. The idea is that the client sends this as part of its request. To us it's an arbitrary ASCII string. We simply echo this string as the first thing in our reply. We don't care what it is. The motivation is that the wave viewer would occasionally get confused as to which reply belonged to which of it's requests, and it would sit there, listening for a reply which never came. The request id is echoed as a fixed length 12-character string, null padded on the right if required. 
     32 * <sampling-rate> is in samples per second. 
     33 * Spaces are used between request arguments. 
     35'''Description of Requests and Responses''' 
     39'''MENU:''' <request id> 
     41Returns one line for each tank it has: 
     43<request id> 
     45pin# <s><c><n><l> <starttime> <endtime> <datatype> 
     47. . . . . 
     49pin# <s><c><n><l> <starttime> <endtime> <datatype> 
     55'''MENUPIN:''' <request id> <pin#> 
     57Returns as above, but only for specified pin number: 
     59<request id> <pin#> <s><c><n><l> <starttime> <endtime> <datatype> <\n> 
     63'''MENUSCNL:''' <request id> <s><c><n><l> 
     65Returns as above, but for specified <s><c><n><l> name: 
     67<request id> <pin#> <s><c><n><l> <starttime> <endtime> <datatype> <\n> 
     71'''GETPIN:''' <request id> <pin#> <starttime> <endtime> <fill-value> 
     73Returns trace data for specified pin and time interval. Gaps filled with <fill-value>. 
     75<request id> <pin#> <s><c><n><l> F <datatype> 
     77<starttime> <sampling rate> sample(1) sample(2)... sample(nsamples) 
     79<\n> {the samples are ASCII} 
     83If the requested time is older than anything in the tank, the reply is: <request id> <pin#> <s><c><n><l> FL <datatype> <oldest time in tank> <sampling rate> \n for the case when the requested interval is younger than anything in the tank, the reply is <request id> <pin#> <s><c><n><l> 
     85FR <datatype> <youngest time in tank> <sampling rate> \n 
     89NOTE: the GETPIN request has never worked in wave_serverV. As pin numbers fade into the distance, it is unlikely that this request will ever be supported. 
     91'''GETSCNL:''' <request id> <s><c><n><l> <starttime> <endtime> <fill-value> 
     93Returns as above, but for specified scnl name. 
     95<request id> <pin#> <s><c><n><l> F <datatype> <starttime> <sampling-rate > 
     97sample(1) sample(2)... sample(nsamples) <\n> 
     103'''GETSCNLRAW:''' <request id> <s><c><n><l> <starttime> <endtime> 
     105Returns trace data in the original binary form in which it was put into the tank (as a TRACEBUF2 packet). Whole messages will be supplied, so that the actual starttime may be older than requested, and the end time may be younger than requested. The reply is part ASCII, terminated by a "\n", followed by binary messages: 
     109<request id> <pin#> <s><c><n><l> F <datatype> <starttime> <endtime> 
     111<bytes of binary data to follow> <\n>. The line above is all in . All below is binary, byte order as found in the tank: 
     113<trace_buf msg> ... <trace_buf msg> 
     117If the requested time is older than anything in the tank, the reply is: 
     119<request id> <pin#> <s><c><n><l> FL <datatype> <oldest time in tank> <\n> 
     123For the case when the requested interval is younger than anything in the tank, the reply is: 
     125<request id> <pin#> <s><c><n><l> FR <datatype> <youngest time in tank> <\n> 
     129For the case when the requested interval falls completely in a gap, the reply is: 
     131<request id> <pin#> <s><c><n><l> FG <datatype> <\n>