Changes between Version 1 and Version 2 of TraCI


Ignore:
Timestamp:
Jan 25, 2010, 9:20:23 PM (14 years ago)
Author:
cristian.gratie
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TraCI

    v1 v2  
    99| message length (4 bytes) | command_1 | command_2 | ... | command_n |
    1010+--------------------------+-----------+-----------+-----+-----------+
     11
     12message length = the length of the message, including this header
    1113}}}
    1214
     
    1618| length (1 byte) | identifier (1 byte) | content |
    1719+-----------------+---------------------+---------+
     20
     21length - ubyte = the length of the command (including this header)
     22identifier - ubyte = the identifier of the command
     23content = command body, contains one or  more values of predefined types
    1824}}}
    1925or, for longer commands
     
    2228| 0 (1 byte) | length (4 bytes) | identifier (1 byte) | content |
    2329+------------+------------------+---------------------+---------+
     30
     31Note: this makes sense because the first byte of the shorter form can never be zero.
    2432}}}
    2533
    26 The server will reply with a single message contaning the responses to every command received, in the same order.
     34The server will reply with a single message contaning the responses to every command received, in the same order. Every command is first acknowledged by the server with the following response
     35{{{
     36+-----------------+---------------------+-----------------+-------------+
     37| length (1 byte) | identifier (1 byte) | result (1 byte) | description |
     38+-----------------+---------------------+-----------------+-------------+
    2739
     40length - ubyte = the length of the response
     41identifier - ubyte = matches the identifier of the command sent by the client
     42result - ubyte = can have the following values:
     43   - 0x00 = success
     44   - 0xff = failure
     45   - 0x01 = not implemented
     46description - string = some commands also offer a description of the result
     47}}}
     48
     49Most commands also return some values. These values are packed in a separate response that follows the acknowledge message. The general form of such a response is the following:
     50{{{
     51+-----------------+---------------------+---------+
     52| length (1 byte) | identifier (1 byte) | content |
     53+-----------------+---------------------+---------+
     54
     55length - ubyte = length of the response
     56identifier - ubyte = identifier of the response (usually associated with the identifier of the command)
     57content = response body, contains the requested information
     58}}}
     59
     60Stopping the simulation:
     61{{{
     62+---------------+-------------------+
     63| 0x02 (length) | 0x7f (identifier) |
     64+---------------+-------------------+
     65
     66closes the simulation and replies with an acknowledge message
     67}}}
     68
     69Retrieving information about lanes
     70{{{
     71+--------+-------------------+------------------+------------------+
     72| length | 0xa3 (identifier) | variable (ubyte) | lane ID (string) |
     73+--------+-------------------+------------------+------------------+
     74
     75lane ID = the id of the lane
     76variable = the value to be retrived for the lane
     77   - 0x00 = list of all lane ID's (sent ID is ignored) (string*)
     78   - 0x31 = edge id (string)
     79
     80the response has the form
     81+--------+-------------------+------------------+------------------+---------------------+--------------+
     82| length | 0xb3 (identifier) | variable (ubyte) | lane ID (string) | return type (ubyte) | return value |
     83+--------+-------------------+------------------+------------------+---------------------+--------------+
     84
     85variable = matches the sent value
     86lane ID = matches the sent value
     87return type = the identifier of the return type
     88return value = value that corresponds to the return type
     89}}}
     90
     91
     92