home *** CD-ROM | disk | FTP | other *** search
/ DEFCON 12 / DEFCON_12_CD-ROM_2004.iso / Nothingface / doc / architecture.txt < prev    next >
Text File  |  2004-07-08  |  57KB  |  1,689 lines

  1. The OpenOtto Project
  2.  
  3. $Date: 2004/07/08 02:34:14 $
  4.  
  5. Abstract
  6.  
  7. An open implementation of automotive communication and 
  8. diagnostic protocols.
  9.  
  10. Abstract
  11.  
  12. The goal of the OpenOtto Project is to provide complete 
  13. free and open access to the networked electronic 
  14. devices in an automobile. The interface to vehicle 
  15. devices will be primarily through the standard 
  16. diagnostic connector, though communication will be 
  17. supported through all busses, not only diagnostic 
  18. busses. Access to vehicle devices will include 
  19. monitoring and diagnostics as well as reprogramming and 
  20. enhanced control of their operation.It is important to be aware that there are applications 
  21. that may interfere with the operation of certain safety 
  22. related devices in an automobile, e.g., braking systems 
  23. and airbags.
  24.  
  25. Table of Contents
  26.  
  27. Hardware
  28.     Physical Layer Requirements
  29.         Pulse Width Modulation (PWM)
  30.         Variable Pulse Width Modulation (VPW)
  31.         ISO
  32.         Controller Area Network (CAN)
  33.     Software Data Link Devices
  34.         Serial
  35.         Parallel
  36.         GPIO
  37.     Hardware Data Link Devices
  38.         Microcontroller
  39.         Programmable Hardware
  40.         Development Board
  41. Software
  42.     Device Protocols
  43.         Software Data Link Device Kernel Interface
  44.         OBD Over Stream Protocol
  45.         Network Interface
  46.         OBD Over IP Protocol
  47.     Drivers
  48.         Kernel Driver
  49.         Driver Daemon (ottod)
  50.     Libraries
  51.         Data Link Decode (libobd2-link)
  52.         Vehicle Identification Number (libvin)
  53.         Diagnostic Test Modes (libobd2)
  54.         non-obd protocols
  55.         High Level Application Functions (libotto)
  56.     Applications
  57.         Interface Configuration (ottoconfig)
  58.         Network Monitor (ottodump) 
  59.         Network Scanner (ottoprobe? ottomap? ottoscan?)
  60.         Network Exploration Tool (ottocat)
  61.         Scan Tool (scantool/xscantool)
  62.         Otto Mann (ottomann)
  63. OSI Model
  64. Interface Hardware Support
  65.     Supported Devices
  66.     Unsupported Devices
  67. Protocol Support
  68.     Supported
  69.     Support in Development
  70.     Unsupported
  71.  
  72. List of Tables
  73.  
  74.  
  75.  
  76.  
  77.  Copyright
  78.  
  79. Copyright (c) 1999-2004 Darius Rad
  80.  
  81. This file is part of the OpenOtto project.
  82.  
  83. OpenOtto is free software; you can redistribute it 
  84. and/or modify it under the terms of the GNU General 
  85. Public License as published by the Free Software 
  86. Foundation; either version 2 of the License, or (at 
  87. your option) any later version. 
  88.  
  89. $Id: architecture.lyx,v 1.12 2004/07/08 02:34:14 alpha 
  90. Exp $
  91.  
  92.  Foreword
  93.  
  94.  todo
  95.  
  96.    other things in forward?
  97.  
  98.      history
  99.  
  100.      acknowledgements
  101.  
  102.  Hardware
  103.  
  104. Interface between the computer and the automotive 
  105. physical layer. Certain devices are restricted to 
  106. certain data link layers and/or certain subsets of 
  107. protocols, messages, and addresses.
  108.  
  109. Hardware data link devices and software data link 
  110. devices are similar; the major difference is that in 
  111. hardware data link devices the software that decodes 
  112. the data link is embedded in the device and generally 
  113. referred to as firmware. In all devices except for the 
  114. Programmable Logic based devices, the data link decode 
  115. is performed in software on a microprocessor.
  116.  
  117.  Physical Layer Requirements
  118.  
  119. Provide interface between CMOS/TTL level signals and 
  120. bus level signals. Where applicable based on the bus 
  121. type, provide termination, differential signalling, and 
  122. half duplex interface.
  123.  
  124.  Pulse Width Modulation (PWM)
  125.  
  126. The Pulse Width Modulation (PWM) bus type is specified 
  127. in [sae j1850].
  128.  
  129. +----------------------+------------------------+
  130. |        Bit Encoding  | pulse width modulation |
  131. +----------------------+------------------------+
  132. |          Drive Type  | differential voltage   |
  133. +----------------------+------------------------+
  134. |           Data rate  | 41.6 kbps              |
  135. +----------------------+------------------------+
  136. | Minimum Pulse Width  |  6\mu s                |
  137. +----------------------+------------------------+
  138. |               Media  | dual wire              |
  139. +----------------------+------------------------+
  140. |  Output Low Voltage  | min 0 V, max 1.2 V     |
  141. +----------------------+------------------------+
  142. | Output High Voltage  | min 3.8 V, max 5.25 V  |
  143. +----------------------+------------------------+
  144.  
  145.  
  146. <tab:Pulse-Width-Modulation>Pulse Width Modulation Physical Layer
  147.  
  148.  Variable Pulse Width Modulation (VPW)
  149.  
  150. The Pulse Width Modulation (PWM) bus type is specified 
  151. in [sae j1850].
  152.  
  153. +----------------------+---------------------------------+
  154. |        Bit Encoding  | variable pulse width modulation |
  155. +----------------------+---------------------------------+
  156. |          Drive Type  | voltage                         |
  157. +----------------------+---------------------------------+
  158. |           Data Rate  | 10.4 kbps                       |
  159. +----------------------+---------------------------------+
  160. | Minimum Pulse Width  |  34\mu s                        |
  161. +----------------------+---------------------------------+
  162. |               Media  | single wire                     |
  163. +----------------------+---------------------------------+
  164. |  Output Low Voltage  | min 0 V, max 1.5 V              |
  165. +----------------------+---------------------------------+
  166. | Output High Voltage  | min 6.25 V, max 8 V             |
  167. +----------------------+---------------------------------+
  168.  
  169.  
  170. <tab:Variable-Pulse-Width>Variable Pulse Width Modulation Physical Layer
  171.  
  172.  ISO
  173.  
  174. The ISO bus type is specified in [iso 9141-1]. This physical layer 
  175. is the same as that specified by [iso 14230-1] for vehicles with a 
  176. 12 V electrical system.
  177.  
  178. +----------------------+---------------------+
  179. |        Bit Encoding  | voltage level       |
  180. +----------------------+---------------------+
  181. |          Drive Type  | voltage             |
  182. +----------------------+---------------------+
  183. |           Data Rate  | 10.4 kbps           |
  184. +----------------------+---------------------+
  185. | Minimum Pulse Width  |  67\mu s            |
  186. +----------------------+---------------------+
  187. |               Media  | single wire         |
  188. +----------------------+---------------------+
  189. |  Output Low Voltage  | min 0 V, max 2.4 V  |
  190. +----------------------+---------------------+
  191. | Output High Voltage  | min 9.6 V, max 12 V |
  192. +----------------------+---------------------+
  193.  
  194.  
  195. <tab:ISO-Physical-Layer>ISO Physical Layer
  196.  
  197. The ISO bus type employs a similar signalling scheme to 
  198. a serial port as specified in [tia-232]. With appropriate 
  199. voltage level conversion, a serial UART may be used to 
  200. communicate on an ISO bus.
  201.  
  202.  Controller Area Network (CAN)
  203.  
  204. The Controller Area Network (CAN) bus type is specified 
  205. in [sae j2284].
  206.  
  207. +----------------------+----------------------+
  208. |        Bit Encoding  | voltage level        |
  209. +----------------------+----------------------+
  210. |          Drive Type  | differential voltage |
  211. +----------------------+----------------------+
  212. |           Data Rate  | 500 kbps             |
  213. +----------------------+----------------------+
  214. | Minimum Pulse Width  | 1990 ns              |
  215. +----------------------+----------------------+
  216. |               Media  | dual wire            |
  217. +----------------------+----------------------+
  218. |  Output Low Voltage  | 1.5 V                |
  219. +----------------------+----------------------+
  220. | Output High Voltage  | 3.5 V                |
  221. +----------------------+----------------------+
  222.  
  223.  
  224. <tab:Controller-Area-Network>Controller Area Network Physical Layer
  225.  
  226.  Software Data Link Devices
  227.  
  228. The software data link devices provide little to no 
  229. additional circuitry beyond logic conversion. All data 
  230. link decode is done in software. In these devices, the 
  231. physical layer interface is optimized so that signal 
  232. conversion is directly between the automotive bus and 
  233. the computer bus, instead of converting to and from 
  234. CMOS/TTL signalling.
  235.  
  236. The requirements for the computer interface of a 
  237. software data link device are one bit of input, one bit 
  238. of output, and a double edge sensitive interrupt on the 
  239. input. Processor clock speed, interrupt latency, and 
  240. I/O latency may affect the maximum possible data rates, 
  241. and may make some or all of the network types 
  242. impossible to implement with a particular interface. 
  243. For slower busses, polling with a level sensitive or 
  244. single edge sensitive interrupt or no interrupt may be 
  245. adequate on faster processors.
  246.  
  247.  Serial
  248.  
  249. This device interfaces with a serial port as specified 
  250. by [tia-232]. Only the ISO bus type is compatible with the UART 
  251. of the serial port. For the VPW, PWM, and CAN bus 
  252. types, pulses are measured and generated via software. 
  253. Since the PWM and CAN buses communicate at faster data 
  254. rates, some hardware may not be able to provide the 
  255. real time response necessary to support either or both 
  256. higher speed busses.
  257.  
  258. todo: CAN issues: is CAN feasible at all? CAN Tx vs. 
  259. ISO L-line Tx, which is more useful?
  260.  
  261. +-----------+------------------+------------+---------------+---------------+
  262. | DB-9 pin  | serial function  | direction  |     IRQ       |   function    |
  263. +-----------+------------------+------------+---------------+---------------+
  264. +-----------+------------------+------------+---------------+---------------+
  265. |    1      |       DCD        |    in      |    delta      |    CAN Rx     |
  266. +-----------+------------------+------------+---------------+---------------+
  267. |    2      |       RxD        |    in      |      no       | ISO K-line Rx |
  268. +-----------+------------------+------------+---------------+---------------+
  269. |    3      |       TxD        |    out     |      no       | ISO K-line Tx |
  270. +-----------+------------------+------------+---------------+---------------+
  271. |    4      |       DTR        |    out     |      no       | ISO L-line Tx |
  272. +-----------+------------------+------------+---------------+---------------+
  273. |    5      |       GND        |            |      no       | signal ground |
  274. +-----------+------------------+------------+---------------+---------------+
  275. |    6      |       DSR        |    in      |    delta      | ISO L-line Rx |
  276. +-----------+------------------+------------+---------------+---------------+
  277. |    7      |       RTS        |    out     |      no       |  VPW/PWM Tx   |
  278. +-----------+------------------+------------+---------------+---------------+
  279. |    8      |       CTS        |    in      |    delta      |  VPW/PWM Rx   |
  280. +-----------+------------------+------------+---------------+---------------+
  281. |    9      |       RI         |    in      | falling edge  |               |
  282. +-----------+------------------+------------+---------------+---------------+
  283.  
  284.  
  285. <tab:Serial-Hardware-Interface>Serial Hardware Interface Pin Assignments+-----------+------------------+------------+---------------+----------------+----------+------------+-----+
  286. | DB-9 pin  | serial function  | direction  |     IRQ       |   function     | VPW/PWM  |    ISO     | CAN |
  287. +-----------+------------------+------------+---------------+----------------+----------+------------+-----+
  288. +-----------+------------------+------------+---------------+----------------+----------+------------+-----+
  289. |    1      |       DCD        |    in      |    delta      |                |          |            |     |
  290. +-----------+------------------+------------+---------------+----------------+----------+------------+-----+
  291. |    2      |       RxD        |    in      |      no       |    UART Rx     |          | K-line Rx  |     |
  292. +-----------+------------------+------------+---------------+----------------+----------+------------+-----+
  293. |    3      |       TxD        |    out     |      no       |    UART Tx     |          | K-line Tx  |     |
  294. +-----------+------------------+------------+---------------+----------------+----------+------------+-----+
  295. |    4      |       DTR        |    out     |      no       |  software Tx   |   Tx     | L-line Tx  | Tx  |
  296. +-----------+------------------+------------+---------------+----------------+----------+------------+-----+
  297. |    5      |       GND        |            |      no       | signal ground  |          |            |     |
  298. +-----------+------------------+------------+---------------+----------------+----------+------------+-----+
  299. |    6      |       DSR        |    in      |    delta      |  software Rx   |   Rx     | L-line Rx  | Rx  |
  300. +-----------+------------------+------------+---------------+----------------+----------+------------+-----+
  301. |    7      |       RTS        |    out     |      no       |                |          |            |     |
  302. +-----------+------------------+------------+---------------+----------------+----------+------------+-----+
  303. |    8      |       CTS        |    in      |    delta      |                |          |            |     |
  304. +-----------+------------------+------------+---------------+----------------+----------+------------+-----+
  305. |    9      |       RI         |    in      | falling edge  |                |          |            |     |
  306. +-----------+------------------+------------+---------------+----------------+----------+------------+-----+
  307.  
  308.  
  309. <tab:Serial-Hardware-Interface>Serial Hardware Interface Pin Assignments
  310.  
  311. todo: Each bus connects 
  312.  
  313.  Parallel
  314.  
  315. This device interfaces with a parallel port as 
  316. specified by [ieee 1284]. This device supports the VPW, PWM, and 
  317. ISO bus types. Since only one pin on the parallel port 
  318. triggers an interrupt, and then only on the rising 
  319. edge, additional hardware as well as software overhead 
  320. is necessary to accommodate interfaces on this port.
  321.  
  322. +------------+-------------------------+------------+----------------+---------------+
  323. | DB-25 pin  | parallel port function  | direction  |      IRQ       |   function    |
  324. +------------+-------------------------+------------+----------------+---------------+
  325. +------------+-------------------------+------------+----------------+---------------+
  326. |     1      |        /STROBE          |    out     |                |               |
  327. +------------+-------------------------+------------+----------------+---------------+
  328. |     2      |           D0            |    out     |                | ISO K-line Tx |
  329. +------------+-------------------------+------------+----------------+---------------+
  330. |     3      |           D1            |    out     |                | ISO L-line Tx |
  331. +------------+-------------------------+------------+----------------+---------------+
  332. |     4      |           D2            |    out     |                |  VPW/PWM Tx   |
  333. +------------+-------------------------+------------+----------------+---------------+
  334. |     5      |           D3            |    out     |                |    CAN Tx     |
  335. +------------+-------------------------+------------+----------------+---------------+
  336. |     6      |           D4            |    out     |                |               |
  337. +------------+-------------------------+------------+----------------+---------------+
  338. |     7      |           D5            |    out     |                |               |
  339. +------------+-------------------------+------------+----------------+---------------+
  340. |     8      |           D6            |    out     |                |               |
  341. +------------+-------------------------+------------+----------------+---------------+
  342. |     9      |           D7            |    out     |                |               |
  343. +------------+-------------------------+------------+----------------+---------------+
  344. |    10      |          /ACK           |    in      | positive edge  |  Rx wired OR  |
  345. +------------+-------------------------+------------+----------------+---------------+
  346. |    11      |          BUSY           |    in      |                | ISO K-line Rx |
  347. +------------+-------------------------+------------+----------------+---------------+
  348. |    12      |           PE            |    in      |                | ISO L-line Rx |
  349. +------------+-------------------------+------------+----------------+---------------+
  350. |    13      |         SELIN           |    in      |                |  VPW/PWM Rx   |
  351. +------------+-------------------------+------------+----------------+---------------+
  352. |    14      |        /AUTOFD          |    out     |                |               |
  353. +------------+-------------------------+------------+----------------+---------------+
  354. |    15      |         /ERROR          |    in      |                |    CAN Rx     |
  355. +------------+-------------------------+------------+----------------+---------------+
  356. |    16      |         /INIT           |    out     |                |               |
  357. +------------+-------------------------+------------+----------------+---------------+
  358. |    17      |          /SEL           |    out     |                |               |
  359. +------------+-------------------------+------------+----------------+---------------+
  360. |   18-25    |          GND            |            |                | signal ground |
  361. +------------+-------------------------+------------+----------------+---------------+
  362.  
  363.  
  364. <tab:Parallel-Hardware-Interface>Parallel Hardware Interface Pin Assignments
  365.  
  366.  GPIO
  367.  
  368. The GPIO data link device uses general purpose IO 
  369. (GPIO) pins on a microprocessor or peripheral 
  370. controller. A different kernel driver will be required 
  371. for each device due to variations in the specific 
  372. hardware used.
  373.  
  374.  Hardware Data Link Devices
  375.  
  376. These devices utilize more hardware to decode the data 
  377. link protocol than software data link devices. These 
  378. devices have more complex hardware, are generally more 
  379. expensive, but require less host system resources to operate.
  380.  
  381.  Microcontroller
  382.  
  383.   General Purpose Microcontrollers
  384.  
  385. These devices use a general purpose microcontroller to 
  386. perform the real time functions of data link decode. 
  387. Any general purpose microcontroller would be suitable, 
  388. such as the 68HC11, 8051, or more modern variants such 
  389. as the PIC or AVR. In addition to the microcontroller, 
  390. additional circuitry is necessary to interface the bus 
  391. physical layer.
  392.  
  393.   Special Purpose Microcontrollers
  394.  
  395. There are a few microcontrollers designed specifically 
  396. for automotive diagnostic interface applications. These 
  397. device are generally restricted to network protocols 
  398. necessary for implementing a scantool. Devices may 
  399. contain some or all of the physical layer interface 
  400. circuitry. These devices include the Elm Electronics 
  401. ELM3xx and the Oezen Elektronik Mobydic.
  402.  
  403.   Repurposed Consumer Hardware
  404.  
  405. This device leverages the programmable nature of an 
  406. off-the-shelf USB to serial converter. As with the 
  407. general purpose microcontroller designs, additional 
  408. circuitry is necessary to interface to the bus physical 
  409. layer. Custom firmware is loaded from the host machine 
  410. to the USB adapter to perform decode of the data link protocol.
  411.  
  412.  Programmable Hardware
  413.  
  414. The interface based on programmable hardware, such as 
  415. an FPGA or PLD, performs data link decode with 
  416. programmable logic. Additional circuitry needed is the 
  417. physical interface to the host and the automobile. A 
  418. programmable hardware device can potentially yield 
  419. better performance, which matter most when supporting 
  420. more than one bus in a single device, and when 
  421. supporting high data rate busses.
  422.  
  423.  Development Board
  424.  
  425. This interface is based on an embedded PC. This device 
  426. is much like a software data link device, in that a 
  427. general purpose computer performs data link decode. 
  428. However, that computer does not perform other functions 
  429. such as managing a user interface, but instead 
  430. communicates over a network to another computer. The 
  431. firmware for such devices may be the same as a software 
  432. data link device, i.e., a Linux kernel device driver, 
  433. or it may run a more specialized driver under a simpler 
  434. operating system such as eCos or DOS.
  435.  
  436.  Software
  437.  
  438.  Device Protocols
  439.  
  440.  Software Data Link Device Kernel Interface
  441.  
  442. The kernel device driver presents a character device 
  443. with raw access to the capabilities of the device. Data 
  444. is sent to and from the device file and control 
  445. information is passed via ioctls.
  446.  
  447.   Data
  448.  
  449. The data is composed of 32 bit packets. Each packet 
  450. specifies one pulse. The format of each data packet is 
  451. described in table [tab:data-packet-format].
  452.  
  453. +--------+---------------------------------------------------+
  454. |  bit   | function                                          |
  455. +--------+---------------------------------------------------+
  456. +--------+---------------------------------------------------+
  457. | 31-28  | bus number                                        |
  458. +--------+---------------------------------------------------+
  459. | 25-27  | unused, reserved for future expansion             |
  460. +--------+---------------------------------------------------+
  461. |  24    | pulse polarity                                    |
  462. +--------+---------------------------------------------------+
  463. | 23-0   | pulse length in nanoseconds  1ns-~16.8ms\pm1ns () |
  464. +--------+---------------------------------------------------+
  465.  
  466.  
  467. <tab:data-packet-format>Data Packet Format
  468.  
  469.   Bus Configuration
  470.  
  471. The following ioctls are used to specify the busses to enable:
  472.  
  473.  set_busenable( int busmask )
  474.  
  475.  get_busenable( int *busmask )
  476.  
  477. The bus interfaces to enable is specified as a bitmask, 
  478. a set bit enables the specified bus. Busses that are 
  479. not enabled will not receive or send data.
  480.  
  481.   Pulse Configuration
  482.  
  483. The following ioctls are used to configuration certain pulses:
  484.  
  485.  set_pulse( int id, int pulse )
  486.  
  487.  get_pulse( int id, int *pulse )
  488.  
  489. The interframe separation (IFS) time is the minimum 
  490. pulse required between packets. Any pulse longer than 
  491. this is assumed to be equivalent to, and is reported 
  492. as, this length. The break signal is the maximum 
  493. asserted pulse width, used to interrupt a transfer. The 
  494. interframe separation (IFS) time is the minimum pulse 
  495. required between two packets, also called the bus idle 
  496. time. The odd IDs specify pulses for an asserted bus 
  497. and the even IDs specify pulses for a deasserted bus. 
  498. Therefore, the logical polarity of the pulse is 
  499. specified by the lowest bit. Table [tab:pulse-config] lists the defined 
  500. pulse IDs.
  501.  
  502. +--------+--------+--------------------------------------------------------------+
  503. | Name   | Value  |                         Description                          |
  504. +--------+--------+--------------------------------------------------------------+
  505. +--------+--------+--------------------------------------------------------------+
  506. |  IFS   |   0    | Deasserted bus timeout, also known as interframe separation. |
  507. +--------+--------+--------------------------------------------------------------+
  508. | BREAK  |   1    |          Asserted bus timeout, also known as break.          |
  509. +--------+--------+--------------------------------------------------------------+
  510.  
  511.  
  512. <tab:pulse-config>Pulse Configuration IDs
  513.  
  514. The time parameter is specified in the same format as 
  515. the data packets. The pulse polarity specifies the 
  516. physical polarity of the signal, to allow for 
  517. electrically inverted busses and/or interfaces. The bus 
  518. number field of the pulse is ignored.
  519.  
  520.  <sec:OBD-Over-Stream>OBD Over Stream Protocol
  521.  
  522. The OBD over stream protocol is used to encapsulate 
  523. packetized OBD data over a byte stream. It is used to 
  524. tunnel automotive busses over serial lines and sockets.
  525.  
  526. Table [tab:OBD-Over-Stream] summarizes byte sequences in the stream that 
  527. have special meaning. Where applicable, these byte 
  528. sequences and their numeric values are shared with 
  529. similar implementations (e.g., SLIP and KISS).
  530.  
  531. +----------------+---------------------+
  532. | byte sequence  | meaning             |
  533. +----------------+---------------------+
  534. +----------------+---------------------+
  535. | END            | End of packet.      |
  536. +----------------+---------------------+
  537. | ESC ESC_END    | END data in packet. |
  538. +----------------+---------------------+
  539. | ESC ESC_ESC    | ESC data in packet. |
  540. +----------------+---------------------+
  541.  
  542.  
  543. <tab:OBD-Over-Stream>OBD Over Stream Control Characters
  544.  
  545. For busses that specify an initialization procedure 
  546. that does not utilize the usual bus symbols, this 
  547. procedure will be performed automatically the first 
  548. time the socket is opened. If the initialization 
  549. procedure can determine whether or not a bus is 
  550. present, this information is available through the 
  551. control socket. Any finalization procedure is performed 
  552. after all applications close the socket.
  553.  
  554. An additional socket exists for performing 
  555. configuration and out of band control of bus 
  556. interfaces. Control functions include the following:
  557.  
  558.  Query bus interface parameters,
  559.  
  560.  Change bus interface parameters,
  561.  
  562.  Transmit bus commands (such as initialization or 
  563.   finalization), and
  564.  
  565.  Retrieve results of previous commands.
  566.  
  567. The following parameters are available for each bus interface:
  568.  
  569.  Bus type (vpw, pwm, iso, can, or auto),
  570.  
  571.  Bus speed in bits per second or zero for default rate, and
  572.  
  573.  Initialization to perform on socket open (none, fast, 
  574.   slow, carb, or auto).
  575.  
  576.  <sec:Network-Interface>Network Interface
  577.  
  578.  todo:
  579.  
  580.    sockopts
  581.  
  582.      network protocol, speed, init
  583.  
  584.      address
  585.  
  586.    promiscuous mode for sniffing
  587.  
  588.    support AF_PACKET
  589.  
  590.  OBD Over IP Protocol
  591.  
  592. todo: OBD over other stuff, too?
  593.  
  594. todo: encapsulated packet format, including bus type, 
  595. IFR, normalization bit
  596.  
  597.  Drivers
  598.  
  599.  Kernel Driver
  600.  
  601. A kernel driver is required to perform the interrupt 
  602. and timing functions for each software data link 
  603. device. There is a different kernel driver for each 
  604. variant of the software data link device.
  605.  
  606.  Driver Daemon (ottod)
  607.  
  608. The driver daemon provides a unified interface to all 
  609. the various hardware interfaces. The daemon also 
  610. provides some buffering and other higher level 
  611. functions. For the software data link interfaces, data 
  612. link decode is done in ottod. Multiple applications may 
  613. connect to a single driver daemon. A single ottod may 
  614. support more than one bus through one or more devices. 
  615. The driver daemon communicates with physical devices 
  616. through a kernel device driver, either a standard 
  617. serial device for hardware data link devices or the 
  618. custom device driver for software data link devices. 
  619. Applications communicate with the driver daemon either 
  620. through local AF_UNIX sockets or through a network 
  621. interface of type AF_OBD.
  622.  
  623. Local socket communication is specified in section [sec:OBD-Over-Stream]. 
  624. Data is passed through one socket per bus interface 
  625. while control information is passed through another socket.
  626.  
  627. The network interface implementation is specified in 
  628. section [sec:Network-Interface]. Data is passed through a socket of AF_OBD 
  629. type, while control information is passed via 
  630. getsockopt() and setsockopt().
  631.  
  632. The driver daemon is configured at runtime to associate 
  633. bus interfaces with local sockets or network 
  634. interfaces. Configuration of the driver daemon includes 
  635. the following for each bus interface:
  636.  
  637.  Device file to physical device,
  638.  
  639.  Device type,
  640.  
  641.  Device specific options,
  642.  
  643.  Bus number within device,
  644.  
  645.  Allowed bus types,
  646.  
  647.  Default bus type and speed, and
  648.  
  649.  Default initialization type.
  650.  
  651.  Libraries
  652.  
  653. The library functionality is minimally split up to 
  654. allow logical groups of functions to be separated from 
  655. others without having an inordinate number of libraries 
  656. to keep track of. Functions that are shared between 
  657. different platforms are in their own library since they 
  658. will be built differently from other functions. 
  659. Notably, they will require much broader 
  660. cross-compilation support. Functions related to a 
  661. single standard, governing body, manufacturer, or 
  662. governmental mandate, will be grouped together in their 
  663. own library. Only where a specific need arises will 
  664. functions be split into libraries further than this.
  665.  
  666.  Data Link Decode (libobd2-link)
  667.  
  668. The data link decode library contains functionality 
  669. necessary to decode the data link layer on software 
  670. data link devices. Data link layer is specified in [sae j1850] for 
  671. VPW and PWM and [iso 14230-1] for ISO. Some devices may only support 
  672. a subset of the data link layers if they cannot meet 
  673. the timing requirements necessary for the faster bus 
  674. types. The library can be configured at compile time as 
  675. well as run time to omit the unsupported bus types. 
  676. Compile time configuration is particularly necessary to 
  677. reduce code size for hardware data link devices. The 
  678. data link decode routines are shared, where possible, 
  679. between all software and hardware data link decode 
  680. platforms. These platforms include the host computer, 
  681. the development board, general purpose 
  682. microcontrollers, and the USB serial adapter.
  683.  
  684. Constants are provided to specify all the relevant 
  685. pulses for each bus.
  686.  
  687. The library provides the following functions:
  688.  
  689.   otto_datalinkdecode Decode a series of pulses into 
  690.   data bytes.
  691.  
  692.   otto_datalinkencode Encode data bytes into a series 
  693.   of pulses.
  694.  
  695.  Vehicle Identification Number (libvin)
  696.  
  697. The vehicle identification number (VIN) library 
  698. contains routines to decode the VIN of a vehicle. For 
  699. vehicles manufactured after 1980, the format of the VIN 
  700. is specified in [iso 3779, iso 3780]. From the VIN it is possible to 
  701. determine specifications of a vehicle including make 
  702. (manufacturer), model, model year, trim level, country 
  703. of origin, and other vehicle information. The library 
  704. also contains a routine to verify the VIN checksum. 
  705. Some information may not be available for all vehicles, 
  706. depending on many factors including the willingness of 
  707. the manufacturer to provide such information to the 
  708. public. Each entry is specified as a key/value pair: 
  709. the key is a pattern match expression on the VIN and 
  710. the value is a description of some property of the 
  711. vehicle. Multiple matches are allowed to prevent 
  712. redundancy in the database.
  713.  
  714. The library will define the data type as specified in 
  715. table [tab:Decoded-VIN-Data] for representing a decoded VIN.
  716.  
  717. +---------------+--------------------------------------+
  718. |  member name  | description                          |
  719. +---------------+--------------------------------------+
  720. +---------------+--------------------------------------+
  721. |      country  | Country of manufacture.              |
  722. +---------------+--------------------------------------+
  723. | manufacturer  | Manufacturer name (e.g., Ford).      |
  724. +---------------+--------------------------------------+
  725. |         make  | Make or division (e.g., Land Rover). |
  726. +---------------+--------------------------------------+
  727. |        model  | Model name (e.g., Discovery).        |
  728. +---------------+--------------------------------------+
  729. |       series  | Series or model variant (e.g., SE).  |
  730. +---------------+--------------------------------------+
  731. |         body  | Body type (number of doors, etc.).   |
  732. +---------------+--------------------------------------+
  733. |       engine  | Engine size and fuel type.           |
  734. +---------------+--------------------------------------+
  735. | transmission  | Transmission, weight class.          |
  736. +---------------+--------------------------------------+
  737. |       weight  | Gross vehicle weight rating (GVWR).  |
  738. +---------------+--------------------------------------+
  739. |     emission  | Emission system or rating.           |
  740. +---------------+--------------------------------------+
  741. |    restraint  | Restraint system.                    |
  742. +---------------+--------------------------------------+
  743. |         year  | Model year.                          |
  744. +---------------+--------------------------------------+
  745. |        plant  | Assembly plant.                      |
  746. +---------------+--------------------------------------+
  747. |       serial  | Manufacture sequence number.         |
  748. +---------------+--------------------------------------+
  749.  
  750.  
  751. <tab:Decoded-VIN-Data>Decoded VIN Data Type
  752.  
  753. The library provides the following functions:
  754.  
  755.   otto_vinchecksum Calculate the checksum for a VIN. 
  756.   This value may be compared to the appropriate 
  757.   position to verify a checksum or assigned to that 
  758.   position to create a valid VIN.
  759.  
  760.   otto_vinlookup Lookup the specified VIN in 
  761.  
  762.  Diagnostic Test Modes (libobd2)
  763.  
  764. The OBD2 library implements the majority of the SAE 
  765. OBD2 specification. Support for each group of 
  766. functionality is described below. See the referenced 
  767. specifications for more detailed information about the features.
  768.  
  769. For certain data, such as DTC tables and physical 
  770. addresses, the library contains SAE specified data as 
  771. well as manufacturer specified data. Manufacturer data 
  772. applicability is determined based on VIN pattern matching.
  773.  
  774.   Network layer operation
  775.  
  776. Support for the network layer packet as specified in [sae j1850]. 
  777. A data structures is defined to facilitate formatting 
  778. of data into network packets for requests and decoding 
  779. data from replies. The data structure contains the 
  780. entire packet, including header and checksum.
  781.  
  782. The network layer support will provide the following functions:
  783.  
  784.   otto_send Write a data packet on the specified bus.
  785.  
  786.   otto_recv Read a data packet from the specified bus.
  787.  
  788.   otto_chksum Compute the checksum of a packet.
  789.  
  790.   Diagnostic test modes
  791.  
  792. Support for the diagnostic test modes as specified in [sae j1979]. 
  793. Diagnostic test modes supported are as follows:
  794.  
  795.  Mode 0x01: Request current powertrain diagnostic data,
  796.  
  797.  Mode 0x02: Request powertrain freeze frame data, 
  798.  
  799.  Mode 0x03: Request emission-related powertrain 
  800.   diagnostic trouble codes,
  801.  
  802.  Mode 0x04: Clear/reset emission-related diagnostic information,
  803.  
  804.  Mode 0x05: Request oxygen sensor monitoring test results,
  805.  
  806.  Mode 0x06: Request on-board monitoring test results 
  807.   for non-continuously monitored systems,
  808.  
  809.  Mode 0x07: Request on-board monitoring test results 
  810.   for continuously monitored systems,
  811.  
  812.  Mode 0x08: Request control of on-board system, test, 
  813.   or component, and
  814.  
  815.  Mode 0x09: Request vehicle information.
  816.  
  817. For each test mode, data structures are defined to 
  818. facilitate formatting of data into network packets for 
  819. requests and decoding data from replies. Data 
  820. structures shall be defined based on the formats 
  821. defined in [sae j1979]. All modes shall have a request format and 
  822. a reply format defined. Modes 0x01, 0x02, 0x05, and 
  823. 0x06 have a additional reply format defined for 
  824. messages that request the mode functions (PIDs, test 
  825. IDs) supported.
  826.  
  827. Tables of constants will be also be defined based on [sae j1979]. 
  828. The following tables shall be defined:
  829.  
  830.  PIDs for modes 0x01 and 0x02,
  831.  
  832.  bitmapped data for PIDs 0x01, 0x03, 0x12, 0x13, 0x1e 
  833.   in modes 0x01 and 0x02,
  834.  
  835.  constants for PID 0x1c in modes 0x01 and 0x02,
  836.  
  837.  test IDs for mode 0x05,
  838.  
  839.  minimum, maximum, and scaling values for tests in mode 
  840.   0x05 (in unified SLOT definitions?),
  841.  
  842.  test IDs for mode 0x06,
  843.  
  844.  test IDs for mode 0x08, and
  845.  
  846.  information type IDs for mode 0x09.
  847.  
  848. Diagnostic trouble codes shall be handled separately, 
  849. via additional library functions, so that they may 
  850. customized to each vehicle.
  851.  
  852.   Enhanced diagnostic test modes
  853.  
  854. Support for enhanced diagnostic test modes as specified 
  855. in [sae j2190]. Enhanced diagnostic test modes support are the following:
  856.  
  857.  Mode 0x10: Initiate diagnostic operation,
  858.  
  859.  Mode 0x11: Request module reset,
  860.  
  861.  Mode 0x12: Request diagnostic freeze frame data,
  862.  
  863.  Mode 0x13: Request diagnostic trouble code information,
  864.  
  865.  Mode 0x14: Clear diagnostic information,
  866.  
  867.  Mode 0x17: Request status of diagnostic trouble codes,
  868.  
  869.  Mode 0x18: Request diagnostic trouble codes by status,
  870.  
  871.  Mode 0x20: Return to normal operation,
  872.  
  873.  Mode 0x21: Request diagnostic data by offset,
  874.  
  875.  Mode 0x22: Request diagnostic data by parameter identification,
  876.  
  877.  Mode 0x23: Request diagnostic data by memory address,
  878.  
  879.  Mode 0x24: Request scaling and offset or PID,
  880.  
  881.  Mode 0x25: Stop transmitting requested data,
  882.  
  883.  Mode 0x26: Specify data rates,
  884.  
  885.  Mode 0x27: Security access mode,
  886.  
  887.  Mode 0x28: Disable normal message transmission,
  888.  
  889.  Mode 0x29: Enable normal message transmission,
  890.  
  891.  Mode 0x2A: Request diagnostic data packet(s),
  892.  
  893.  Mode 0x2B: Dynamically define data packet by single 
  894.   byte offsets,
  895.  
  896.  Mode 0x2C: Dynamically define diagnostic data packet,
  897.  
  898.  Mode 0x2F: Input/output control by PID,
  899.  
  900.  Mode 0x30: Input/output control by data value ID,
  901.  
  902.  Mode 0x31: Perform diagnostic routine by test number 
  903.   -- start routine,
  904.  
  905.  Mode 0x32: Perform diagnostic routine by test number 
  906.   -- stop routine,
  907.  
  908.  Mode 0x33: Perform diagnostic routine by test number 
  909.   -- request routine results,
  910.  
  911.  Mode 0x34: Data transfer -- download (tool to module),
  912.  
  913.  Mode 0x35: Data transfer -- upload (module to tool),
  914.  
  915.  Mode 0x36: Data transfer -- transfer,
  916.  
  917.  Mode 0x37: Data transfer -- exit,
  918.  
  919.  Mode 0x38: Perform diagnostic routine at a specified 
  920.   address -- enter routine,
  921.  
  922.  Mode 0x39: Perform diagnostic routine at a specified 
  923.   address -- exit routine,
  924.  
  925.  Mode 0x3A: Perform diagnostic routine at a specified 
  926.   address -- request routine results,
  927.  
  928.  Mode 0x3B: Write data block,
  929.  
  930.  Mode 0x3C: Test device present, and
  931.  
  932.  Mode 0x7F: General response message.
  933.  
  934. For each test mode, data structures are defined to 
  935. facilitate formatting of data into network packets for 
  936. requests and decoding data from replies. Data 
  937. structures shall be defined based on the formats 
  938. defined in [sae j2190]. All modes except mode 0x3F and 0x7F shall 
  939. have a request format and a reply format defined. Modes 
  940. 0x13, 0x17, 0x18 have an additional reply format to 
  941. return the number of DTCs stored as well as the actual 
  942. DTCs. Mode 0x27 has an additionally reply format for 
  943. optional additional reply data. Mode 0x3F has a single 
  944. request format. Mode 0x7F has a single response format, 
  945. the general response that may be used in response to 
  946. any enhanced diagnostic test mode request.
  947.  
  948. Tables of constants will be also be defined based on [sae j2190]. 
  949. The following tables shall be defined:
  950.  
  951.  level of diagnostics for mode 0x10,
  952.  
  953.  bitmapped status data for mode 0x18,
  954.  
  955.  response repeat options for modes 0x21, 0x22, and 0x23,
  956.  
  957.  scaling bytes for mode 0x24 (defined in general SLOTs?),
  958.  
  959.  date rate constants for mode 0x26,
  960.  
  961.  dynamic packet definitions for mode 0x2C, and 
  962.  
  963.  response codes for mode 0x7F.
  964.  
  965. Diagnostic trouble codes shall be handled separately, 
  966. via additional library functions, so that they may 
  967. customized to each vehicle.
  968.  
  969.   Header and packet decode
  970.  
  971. Support for header and packet decode as specified in [sae j1850, sae j2178-1]. 
  972. Data structures are defined to facilitate formatting of 
  973. data into network packets for requests and decoding 
  974. data from replies. Data structures defined are the following:
  975.  
  976.  single byte header,
  977.  
  978.  one byte consolidated header, and
  979.  
  980.  three byte consolidated header.
  981.  
  982. Tables of constants are defined for the following information:
  983.  
  984.  header flags,
  985.  
  986.  message types,
  987.  
  988.  message operations,
  989.  
  990.  extended addressing types, and
  991.  
  992.  geographical address map.
  993.  
  994.   Physical address lookup
  995.  
  996. Physical addressing as specified in [sae j2178-1]. Standard defined 
  997. types will be supported as well as manufacturer 
  998. specific addresses. Addresses will be maintained in an 
  999. extensible database to allow a user to easily provide 
  1000. additional address information.
  1001.  
  1002.   Data parameter assignment database
  1003.  
  1004. Support data parameter definitions as specified in [sae j2178-2]. 
  1005. Data structures and tables of constants are defined to 
  1006. facility decode the various data parameter assignments. 
  1007. Where applicable, manufacturer definitions are 
  1008. supported and defined separately from standard 
  1009. definitions. The following data structures are defined: 
  1010. PID bit mapping.
  1011.  
  1012. For ease of diagnostics, data is referenced according 
  1013. to the parameter reference number (PRN) structure. A 
  1014. table of PRN groupings is defined, as well as detailed 
  1015. PRN assignments for the following groups:
  1016.  
  1017.  [sae j1979] compatible,
  1018.  
  1019.  engine,
  1020.  
  1021.  transmission,
  1022.  
  1023.  brakes/tires/wheels,
  1024.  
  1025.  steering,
  1026.  
  1027.  suspension,
  1028.  
  1029.  restraints,
  1030.  
  1031.  driver information,
  1032.  
  1033.  HVAC,
  1034.  
  1035.  convenience,
  1036.  
  1037.  security,
  1038.  
  1039.  electric vehicle energy transfer system,
  1040.  
  1041.  configuration codes, and
  1042.  
  1043.  miscellaneous.
  1044.  
  1045. Values are specified according to the scaling, limit, 
  1046. offset, and transfer function (SLOT) definitions. This 
  1047. provides the meaning for any particular data. The 
  1048. following SLOT definitions are used:
  1049.  
  1050.  packeted (PKT),
  1051.  
  1052.  bitmapped without mask (BMP),
  1053.  
  1054.  unsigned numeric (UNM):
  1055.  
  1056.    zero,
  1057.  
  1058.    short (<8 bit),
  1059.  
  1060.    8 bit,
  1061.  
  1062.    16 bit,
  1063.  
  1064.    24 bit,
  1065.  
  1066.    32 bit,
  1067.  
  1068.  two's complement signed numeric (SNM), and
  1069.  
  1070.  state encoded (SED).
  1071.  
  1072.   Single byte header messages
  1073.  
  1074. Support for single byte messages as specified in [sae j2178-3]. A 
  1075. table of constants shall be defined for frame IDs for 
  1076. all one byte headers, both single byte headers and 
  1077. consolidated three byte headers. A table of constants 
  1078. shall also be defined for the secondary IDs for 
  1079. electric vehicle energy transfer system (EV-ETS) messages.
  1080.  
  1081.   Three byte header messages 
  1082.  
  1083. Support for three byte header messages as specified in [sae j2178-4]
  1084. . A table of constants shall be defined for primary IDs 
  1085. for functional addressing with three byte headers. 
  1086. Additionally, tables of secondary IDs shall be defined 
  1087. for the following message types:
  1088.  
  1089.  engine torque,
  1090.  
  1091.  engine air intake,
  1092.  
  1093.  throttle,
  1094.  
  1095.  air conditioning clutch,
  1096.  
  1097.  engine RPM,
  1098.  
  1099.  wheels,
  1100.  
  1101.  vehicle speed,
  1102.  
  1103.  traction control,
  1104.  
  1105.  brakes,
  1106.  
  1107.  steering,
  1108.  
  1109.  transmission,
  1110.  
  1111.  engine sensors -- other,
  1112.  
  1113.  engine coolant,
  1114.  
  1115.  engine oil,
  1116.  
  1117.  engine systems -- other,
  1118.  
  1119.  suspension,
  1120.  
  1121.  vehicle speed control,
  1122.  
  1123.  electric vehicle energy transfer system,
  1124.  
  1125.  charging system,
  1126.  
  1127.  electrical energy management,
  1128.  
  1129.  odometer,
  1130.  
  1131.  fuel system,
  1132.  
  1133.  ignition switch/starter,
  1134.  
  1135.  tell tales,
  1136.  
  1137.  climate control (HVAC),
  1138.  
  1139.  window wiper/washer,
  1140.  
  1141.  mirrors,
  1142.  
  1143.  door locks,
  1144.  
  1145.  external access,
  1146.  
  1147.  seat motion/control,
  1148.  
  1149.  windows,
  1150.  
  1151.  steering column,
  1152.  
  1153.  seat switches,
  1154.  
  1155.  restraints,
  1156.  
  1157.  exterior lamps outage,
  1158.  
  1159.  exterior lamps,
  1160.  
  1161.  interior lamps outage,
  1162.  
  1163.  interior lamps,
  1164.  
  1165.  tires,
  1166.  
  1167.  defrost,
  1168.  
  1169.  displays,
  1170.  
  1171.  exterior environment,
  1172.  
  1173.  interior environment,
  1174.  
  1175.  time/date,
  1176.  
  1177.  vehicle identification, and
  1178.  
  1179.  network control.
  1180.  
  1181. Tables will be defined for extended addresses for each 
  1182. of the following function:
  1183.  
  1184.  brakes, tires, and wheels,
  1185.  
  1186.  HVAC zones,
  1187.  
  1188.  window wiper/washer, defrost, photocell,
  1189.  
  1190.  doors and door locks,
  1191.  
  1192.  seats and restraints,
  1193.  
  1194.  windows,
  1195.  
  1196.  external lamps, and
  1197.  
  1198.  internal lamps.
  1199.  
  1200.   Diagnostic trouble code databases
  1201.  
  1202. Support for a diagnostic trouble codes (DTC) as 
  1203. specified in [sae j2012]. A database shall be defined to store and 
  1204. manage DTCs as defined by standards as well as by 
  1205. manufacturer. The databases will be in a form that can 
  1206. be updated easily at runtime by the user. The database 
  1207. schema for storing DTCs is specified in table .
  1208.  
  1209. +----------+------------------------------------------------------+
  1210. |  member  | description                                          |
  1211. +----------+------------------------------------------------------+
  1212. +----------+------------------------------------------------------+
  1213. |     dtc  | DTC specified in all numeric format (P0000 is 0000). |
  1214. +----------+------------------------------------------------------+
  1215. | message  | Description.                                         |
  1216. +----------+------------------------------------------------------+
  1217.  
  1218.  
  1219. <tab:DTC-Database-Schema>DTC Database Schema
  1220.  
  1221. The database access functions will provide system group 
  1222. information when an unknown DTC is requested. The 
  1223. database will provide the following functions:
  1224.  
  1225.   otto_dtclookup Returns a diagnostic message from 
  1226.   looking up the specified DTC in the database.
  1227.  
  1228.  non-obd protocols
  1229.  
  1230. Non-OBD protocols will be supported as a single library 
  1231. per protocol. Initially no such protocols will be supported.
  1232.  
  1233.  High Level Application Functions (libotto)
  1234.  
  1235. todo: much work needed here, define this functionality
  1236.  
  1237. todo: compute horsepower
  1238.  
  1239. todo: fuel economy calc
  1240.  
  1241.   functions
  1242.  
  1243. todo
  1244.  
  1245.  Applications
  1246.  
  1247.  Interface Configuration (ottoconfig)
  1248.  
  1249. The interface configuration utility provides a 
  1250. convenient method to query and modify the settings for 
  1251. a bus interface. All of the settings available at the 
  1252. interface level, including network type and speed and 
  1253. initialization type, are available.
  1254.  
  1255.  Network Monitor (ottodump) 
  1256.  
  1257. The network monitor provides the ability to analyze and 
  1258. log network traffic. The application will connect to a 
  1259. single bus and dump network traffic. This program shall 
  1260. decode and display network traffic in a compact textual 
  1261. representation, log network traffic to a file in a form 
  1262. that can be read back later, read network traffic from 
  1263. a file saved previously, and filter traffic displayed 
  1264. or logged based on a user supplied expression.
  1265.  
  1266. The decoded packet data will include, where applicable, 
  1267. the following information:
  1268.  
  1269.  Network protocol used,
  1270.  
  1271.  Header information as specified in [sae j2178-1],
  1272.  
  1273.  Data parameter adjusted value, as specified in [sae j2178-2], and
  1274.  
  1275.  Frame ID meaning as specified in [sae j2178-3, sae j2178-4].
  1276.  
  1277.  Network Scanner (ottoprobe? ottomap? ottoscan?)
  1278.  
  1279. The network scanner tool provides the ability to run 
  1280. scans of the automotive network to determine what 
  1281. devices are available. The scanner will attempt to 
  1282. determine all the modules present in the vehicle, and 
  1283. identify each module as much as possible.
  1284.  
  1285.  Network Exploration Tool (ottocat)
  1286.  
  1287. The network exploration tool provides the ability to 
  1288. read and write arbitrary data on the automotive 
  1289. network. Data received on standard input is passed to 
  1290. the network and data from the network is relayed back 
  1291. on standard output. Data is escaped according to the 
  1292. OBD over stream protocol specified in section [sec:OBD-Over-Stream] to 
  1293. preserve packet boundaries.
  1294.  
  1295.  Scan Tool (scantool/xscantool)
  1296.  
  1297.   Scan Tool Functionality
  1298.  
  1299. The scan tool provides scan tool functionality as 
  1300. specified by [sae j1978]. Accordingly, communication between the 
  1301. scan tool and the vehicle will support:
  1302.  
  1303.  Automatic determination of busses present in the 
  1304.   vehicle from the hardware interface present,
  1305.  
  1306.  Completion and support of on-board system readiness tests,
  1307.  
  1308.  Malfunction indicator light status and, if applicable, 
  1309.   reason or reasons for illumination,
  1310.  
  1311.  Obtaining and displaying emissions related diagnostic 
  1312.   trouble codes, and
  1313.  
  1314.  Obtaining and displaying emissions related current 
  1315.   data, freeze frame data, and test parameters and results.
  1316.  
  1317. Where the scan tool is only specified to support a 
  1318. limited range of diagnostic procedures, the scan tool 
  1319. application will be expanded to provide the full range 
  1320. of similar functionality. For example, all diagnostic 
  1321. trouble codes, and all freeze frame data and test 
  1322. parameters will be supported, not only those related to 
  1323. emissions control.
  1324.  
  1325. The user interface of the scan tool will support a line 
  1326. oriented text interface and a graphical interface mode.
  1327.  
  1328.   Textual User Interface
  1329.  
  1330. The textual user interface to the scan tool will be 
  1331. line oriented. Functionality that would be awkward with 
  1332. a text display, such as graphing and continuously 
  1333. updated results, will not be supported with this interface.
  1334.  
  1335.   Graphical User Interface
  1336.  
  1337. The graphical user interface to the scan tool will 
  1338. provide a simple, intuitive interface to the common 
  1339. scan tool functions. The scan tool window will provide 
  1340. icons for initiating commands scan tool commands. 
  1341. Results will be displayed alphanumerically or 
  1342. graphically in the same window. Displaying multiple 
  1343. results will be supported. The user will be able select 
  1344. whether or not results are continuously updated. The 
  1345. user may also initiate an update of a result value.
  1346.  
  1347.  Otto Mann (ottomann)
  1348.  
  1349. The Otto Mann tool provides high level control and 
  1350. monitoring of vehicle parameters via the automotive 
  1351. bus. The application will provide both text and 
  1352. graphical interfaces.
  1353.  
  1354.   Shell
  1355.  
  1356. The application will contain a text based command line 
  1357. interface. This interface will allow the user to 
  1358. initiate commands to the application (and, depending on 
  1359. the command, requests on the automotive bus). This 
  1360. interface will also allow, where applicable, return of 
  1361. alphanumeric results of commands. The shell interface 
  1362. is an intrinsic part of the application; it is not 
  1363. optional as a plugin.
  1364.  
  1365.   Windows
  1366.  
  1367. The application will provide graphic windows for 
  1368. graphical access to similar functionality available 
  1369. through the shell. This functionality includes scantool 
  1370. commands and results as well as configuration of the 
  1371. application and configuration of plugins.
  1372.  
  1373.   Analysis
  1374.  
  1375. The application will provide augmented vehicle 
  1376. operation facilities. These facilities will be 
  1377. available as commands to the shell, and results will be 
  1378. available to graphical and alphanumeric result plugins. 
  1379. The facilities provided include:
  1380.  
  1381.  Estimated power calculation (dynamometer),
  1382.  
  1383.  Fuel economy calculation, including moving average 
  1384.   fuel consumption and estimated distance for remaining fuel,
  1385.  
  1386.  Wheel speed and slip display, and
  1387.  
  1388.  ABS and ETC activity.
  1389.  
  1390. The application will provide a configurable facility to 
  1391. recommend proper vehicle operation procedures. These 
  1392. procedures will include:
  1393.  
  1394.  Headlights operation as compared to sunrise and set 
  1395.   time and outside brightness,
  1396.  
  1397.  Door position as compared to vehicle speed,
  1398.  
  1399.  Door locks as compared to vehicle speed, and
  1400.  
  1401.  Wiper operation as compared to headlight operation.
  1402.  
  1403.   Extended Commands
  1404.  
  1405. The application will allow extended control over 
  1406. vehicles functions, including:
  1407.  
  1408.  Disable ABS/ETC functionality, and
  1409.  
  1410.  Manual control of ABS/ETC operation on a per wheel, 
  1411.   per axle, or per side basis.
  1412.  
  1413.   Plugins
  1414.  
  1415. The application will support a plugin method whereby 
  1416. optional functionality can be implemented separate from 
  1417. the main application. The plugin architecture will 
  1418. allow a plugin to support one or more of the following 
  1419. facilities: command and result. Plugins will be allowed 
  1420. the ability to have more than one instance of the 
  1421. plugin active at one time. This will allow two or more 
  1422. different plugin configurations for a single plugin to 
  1423. be active at one time.
  1424.  
  1425. The following standard plugins will be implemented:
  1426.  
  1427.  X11 window, providing a themable graphic display of data,
  1428.  
  1429.  Audio out, providing an audible output of data as 
  1430.   sound effects or text to speech,
  1431.  
  1432.  Bitmap output, providing the ability to write static 
  1433.   graphical representation of data to a file,
  1434.  
  1435.  Fifo control, providing an interface similar to the 
  1436.   shell interface on a local filesystem fifo, and
  1437.  
  1438.  External program, providing the ability to run an 
  1439.   arbitrary program based on configurable events.
  1440.  
  1441.  OSI Model
  1442.  
  1443.   Layer 1 Physical layer, defined in [sae j1850] for VPW and PWM, 
  1444.   in [iso 9141-1, iso 14230-1] for ISO, and in [sae j2284] for CAN.
  1445.  
  1446.   Layer 2 Data Link layer, defined in [sae j1850] for VPW and PWM, 
  1447.   in [iso 9141-2, iso 14230-2] for ISO, and in [sae j2284] for CAN.
  1448.  
  1449.   Layer 3 Network layer, defined in [sae j2178-1, sae j2178-2, sae j2178-3, sae j2178-4].
  1450.  
  1451.   Layer 4 Transport layer, not defined by SAE or ISO.
  1452.  
  1453.   Layer 5 Session layer, not defined by SAE or ISO.
  1454.  
  1455.   Layer 6 Presentation layer, not defined by SAE or ISO.
  1456.  
  1457.   Layer 7 Application layer, defined in [sae j2178-1, sae j2178-2, sae j2178-3, sae j2178-4] for VPW and 
  1458.   PWM, and in [iso 14230-3] for ISO.
  1459.  
  1460.  Interface Hardware Support
  1461.  
  1462. todo: reference all devices mentioned by freediag, on 
  1463. opendiag and other lists
  1464.  
  1465.  Supported Devices
  1466.  
  1467. none yet!
  1468.  
  1469.  Unsupported Devices
  1470.  
  1471.   OpenOtto Devices Devices defined by the OpenOtto Project.
  1472.  
  1473.   Serial Supports VPW, PWM, ISO, and CAN? bus types.
  1474.  
  1475.   Parallel Supports VPW, PWM, ISO, and CAN? bus types.
  1476.  
  1477.   GPIO Support depends on processor performance.
  1478.  
  1479.   Microcontroller Support depends on microcontroller 
  1480.     performance and firmware.
  1481.  
  1482.   Programmable Hardware Support depends on hardware 
  1483.     performance and firmware.
  1484.  
  1485.   Development Board Supports VPW, PWM, ISO, and CAN? bus types.
  1486.  
  1487.   Andy Whittaker Interface schematic that supports ISO 
  1488.   bus type.
  1489.  
  1490.   B. Roadman Complete device that supports VPW, PWM, and 
  1491.   ISO bus types.
  1492.  
  1493.   Jeff Noxon Interface schematic that supports ISO bus type.
  1494.  
  1495.   ELM3xx Interface ICs that support VPW, PWM, and/or 
  1496.   ISO bus types, depending on model.
  1497.  
  1498.   Multiplex Engineering Complete devices that support 
  1499.   VPW, PWM, and/or ISO bus types, depending on model.
  1500.  
  1501.   Mobydic Interface IC that supports VPW, PWM, ISO, and 
  1502.   CAN bus types. (todo: CAN support limited?)
  1503.  
  1504.   Silicon Engines Complete device that supports ISO bus type.
  1505.  
  1506.  Protocol Support
  1507.  
  1508. The status of support for other protocols, including 
  1509. proprietary and obsolete protocols, is described below. 
  1510.  
  1511.  Supported
  1512.  
  1513.   [iso 3779, iso 3780] VIN support is incomplete due to unavailability of spec.
  1514.  
  1515.   [sae j1850] VPW and PWM bus physical layer supported by hardware.
  1516.  
  1517.   [sae j1978] OBD2 scan tool implemented in 
  1518.  
  1519.   [sae j1979, sae j2190] OBD2 diagnostic test modes implemented in 
  1520.  
  1521.   [sae j2012] SAE DTC definitions
  1522.  
  1523.   [sae j2178-1, sae j2178-2, sae j2178-3, sae j2178-4] OBD2 network messages
  1524.  
  1525.   [sae j2186] Data link security
  1526.  
  1527.   [sae j2284] OBD2 CAN support 
  1528.  
  1529.   [iso 9141-1, iso 9141-2, iso 9141-3] ISO bus format
  1530.  
  1531.   [iso 14230-1, iso 14230-2, iso 14230-3, iso 14230-4] ISO bus format for 24V vehicles
  1532.  
  1533.  Support in Development
  1534.  
  1535.   everything still working
  1536.  
  1537.  Unsupported
  1538.  
  1539. The following protocols are not (yet) supported. The 
  1540. status of each protocol is given below.
  1541.  
  1542.   Standard
  1543.  
  1544.   EOBD ISO 15031-5, Europe OBD?
  1545.  
  1546.   OBDI On-Board Diagnostics I.
  1547.  
  1548.   Proprietary
  1549.  
  1550.   VAG VW/Audi Group
  1551.  
  1552.     KWP82 No info.
  1553.  
  1554.     KWP1281 VAG 1552?
  1555.  
  1556.     KWP2000 VW version of [iso 14230-1, iso 14230-2, iso 14230-3, iso 14230-4]. Possibly the same?
  1557.  
  1558.   GM General Motors
  1559.  
  1560.     ALDL Assembly Line Data Link. GM vehicles 1982-1986?
  1561.  
  1562.     GM ECU Not yet investigated.
  1563.  
  1564.   Mercedes Benz
  1565.  
  1566.     Gearbox Not yet investigated.
  1567.  
  1568.   Nissan
  1569.  
  1570.     Consult Not yet investigated.
  1571.  
  1572. References
  1573.  
  1574. SAE J1850 -- Class B Data Communications Network Interface
  1575.  
  1576. References
  1577.  
  1578. SAE J1962 -- Diagnostic Connector
  1579.  
  1580. References
  1581.  
  1582. SAE J1978 -- OBD II Scan Tool
  1583.  
  1584. References
  1585.  
  1586. SAE J1979 -- E/E Diagnostic Test Modes
  1587.  
  1588. References
  1589.  
  1590. SAE J2012 -- Recommended Practice for Diagnostic 
  1591. Trouble Code Definitions
  1592.  
  1593. References
  1594.  
  1595. SAE J2178-1 -- Class B Data Communication Network 
  1596. Messages -- Detailed Header Formats and Physical 
  1597. Address Assignments
  1598.  
  1599. References
  1600.  
  1601. SAE J2178-2 -- Class B Data Communication Network 
  1602. Messages -- Data Parameter Definitions
  1603.  
  1604. References
  1605.  
  1606. SAE J2178-3 -- Class B Data Communication Network 
  1607. Messages -- Frame IDs for Single-Byte Forms of Headers
  1608.  
  1609. References
  1610.  
  1611. SAE J2178-4 -- Class B Data Communication Network 
  1612. Messages -- Message Definitions for Three Byte Headers
  1613.  
  1614. References
  1615.  
  1616. SAE J2186 -- E/E Data Link Security
  1617.  
  1618. References
  1619.  
  1620. SAE J2190 -- Enhanced E/E Diagnostic Test Modes
  1621.  
  1622. References
  1623.  
  1624. SAE J2284 -- High-Speed CAN (HSC) for Vehicle 
  1625. Applications at 500 KBPS
  1626.  
  1627. References
  1628.  
  1629. ISO 9141-1 -- Road Vehicles -- Diagnostic Systems -- 
  1630. Requirements for interchange of digital information
  1631.  
  1632. References
  1633.  
  1634. ISO 9141-2 -- Road Vehicles -- Diagnostic Systems -- 
  1635. Part 2: CARB requirements for interchange of digital
  1636.  
  1637. References
  1638.  
  1639. ISO 9141-3 -- Road Vehicles - Diagnostic Systems -- 
  1640. Part 3: Verification of the communication between 
  1641. vehicle and OBD II scan tool
  1642.  
  1643. References
  1644.  
  1645. ISO 14230-1 -- Road Vehicles -- Diagnostic Systems -- 
  1646. Part 1: Physical Layer
  1647.  
  1648. References
  1649.  
  1650. ISO 14230-2 -- Road Vehicles -- Diagnostic Systems -- 
  1651. Part 2: Data Link Layer
  1652.  
  1653. References
  1654.  
  1655. ISO 14230-3 -- Road Vehicles -- Diagnostic Systems -- 
  1656. Part 3: Application Layer
  1657.  
  1658. References
  1659.  
  1660. ISO 14230-4 -- Road Vehicles -- Diagnostic Systems -- 
  1661. Part 4: Requirements for emission-related systems
  1662.  
  1663. References
  1664.  
  1665. TIA-232 -- Interface Between Data Terminal Equipment 
  1666. and Data Circuit-Terminating Equipment Employing Serial 
  1667. Binary Data Interchange
  1668.  
  1669. References
  1670.  
  1671. IEEE 1284 -- Standard Signaling Method for a 
  1672. Bidirectional Parallel Peripheral Interface for 
  1673. Personal Computers
  1674.  
  1675. References
  1676.  
  1677. United States Code of Federal Regulations, Title 49, 
  1678. Volume 5, Part 565 -- Vehicle Identification Number Requirements
  1679.  
  1680. References
  1681.  
  1682. ISO 3779 -- Road Vehicles -- Vehicle identification 
  1683. number (VIN) -- Content and structure
  1684.  
  1685. References
  1686.  
  1687. ISO 3780 -- Road vehicles -- World manufacturer 
  1688. identifier (WMI) code
  1689.