Main Page | Class List | File List | Class Members | File Members | Related Pages

include/otto/device.h File Reference

OBD2 data link implementation. More...

Go to the source code of this file.

Classes

struct  otto_device
 OBD2 data link device. More...

struct  otto_bus
 Otto data link bus interface. More...

struct  otto_driver
 OBD2 physical interface device driver. More...


Enumerations

enum  otto_link_type { OTTO_LINK_TYPE_UNKNOWN = 0, OTTO_LINK_TYPE_ISO, OTTO_LINK_TYPE_VPW, OTTO_LINK_TYPE_PWM }
 OBD2 data link type. More...


Functions

void otto_register (struct otto_driver *drv)
 Register a device driver.

otto_deviceotto_open (const char *name, const char *fname)
 Open and initialize OBD2 device.

int otto_close (struct otto_device *dev)
 Close ODB2 device.

int otto_write (struct otto_device *dev, int bus, union otto_packet *packet, size_t size)
 Transmit a packet on an OBD2 device.

int otto_read (struct otto_device *dev, int bus, union otto_packet *packet, size_t size)
 Receive a packet on an OBD2 device.

int otto_control (struct otto_device *dev, int bus, void *data, int cmd)
 Control for device.

int otto_getselectfd (struct otto_device *dev)
 Return a file descriptor for select() or poll().


Detailed Description

OBD2 data link implementation.


Enumeration Type Documentation

enum otto_link_type
 

OBD2 data link type.

Enumeration values:
OTTO_LINK_TYPE_UNKNOWN  Unknown data link protocol.
OTTO_LINK_TYPE_ISO  ISO 9141.
OTTO_LINK_TYPE_VPW  Variable pulse width modulation (SAE J1850).
OTTO_LINK_TYPE_PWM  Pulse width modulation (SAE J1850).


Function Documentation

int otto_close struct otto_device dev  ) 
 

Close ODB2 device.

Todo:
remove dev from dev->drv->dev_first list
Parameters:
dev  OBD2 device

int otto_control struct otto_device dev,
int  bus,
void *  data,
int  cmd
 

Control for device.

Returns:
Depends on function
Parameters:
dev  Otto device handle
bus  Device bus number
data  Pointer to optional parameters, depending on function
cmd  Function identifier

int otto_getselectfd struct otto_device dev  ) 
 

Return a file descriptor for select() or poll().

Returns:
file descriptor

struct otto_device* otto_open const char *  name,
const char *  fname
 

Open and initialize OBD2 device.

Returns:
Otto device handle

Todo:
add dev to dev->drv->dev_first list
Parameters:
name  Name of driver to use
fname  Name of device file to use

int otto_read struct otto_device dev,
int  bus,
union otto_packet packet,
size_t  size
 

Receive a packet on an OBD2 device.

Parameters:
dev  Otto device handle
bus  OBD2 bus interface
packet  Received packet
size  Size of the packet parameter

void otto_register struct otto_driver drv  ) 
 

Register a device driver.

Parameters:
drv  Device driver operations

int otto_write struct otto_device dev,
int  bus,
union otto_packet packet,
size_t  size
 

Transmit a packet on an OBD2 device.

Parameters:
dev  Otto device handle
packet  /< Device bus interface Packet to send
size  Size of packet structure


Generated on Thu Jul 8 19:26:06 2004 for OpenOtto by doxygen 1.3.7