knet_bus_s Struct Reference

Collaboration diagram for knet_bus_s:

Collaboration graph
[legend]

Data Fields

int(* exit )(struct knet_bus_s *bus)
struct knet_dev_s *(* open )(struct knet_bus_s *bus, knet_ext_t ext, knet_mod_t mod, const char *name, int argc, char *argv[])
void(* close )(struct knet_bus_s *bus, struct knet_dev_s *device)
int(* transfer )(struct knet_bus_s *bus, struct knet_dev_s *device, const char *write_buf, unsigned int write_len, char *read_buf, unsigned read_len)
int(* read )(struct knet_bus_s *bus, struct knet_dev_s *device, char *buf, unsigned int len)
int(* write )(struct knet_bus_s *bus, struct knet_dev_s *device, const char *buf, unsigned int len)
struct knet_dev_sdevices
pthread_mutex_t lock
knet_bus_info_t bus_info
int usage_counter

Detailed Description

Definition at line 57 of file knet.h.


Field Documentation

int(* knet_bus_s::exit)(struct knet_bus_s *bus)

cleanup the private data in the bus structure [OPTIONAL]

Referenced by knet_exit(), knet_i2c_init(), and knet_rs232_init().

struct knet_dev_s*(* knet_bus_s::open)(struct knet_bus_s *bus, knet_ext_t ext, knet_mod_t mod, const char *name, int argc, char *argv[]) [read]

open a device on this bus [MANDATORY]

Referenced by knet_i2c_init(), knet_open(), and knet_rs232_init().

void(* knet_bus_s::close)(struct knet_bus_s *bus, struct knet_dev_s *device)

close a device [OPTIONAL]

Referenced by knet_close(), knet_i2c_init(), and knet_rs232_init().

int(* knet_bus_s::transfer)(struct knet_bus_s *bus, struct knet_dev_s *device, const char *write_buf, unsigned int write_len, char *read_buf, unsigned read_len)

device transfer (write + read ) data [OPTIONAL]

Referenced by knet_i2c_init(), knet_lltransfer(), and knet_rs232_init().

int(* knet_bus_s::read)(struct knet_bus_s *bus, struct knet_dev_s *device, char *buf, unsigned int len)

device read data [MANDATORY]

Referenced by knet_i2c_init(), knet_llread(), knet_lltransfer(), and knet_rs232_init().

int(* knet_bus_s::write)(struct knet_bus_s *bus, struct knet_dev_s *device, const char *buf, unsigned int len)

device write data [MANDATORY]

Referenced by knet_i2c_init(), knet_lltransfer(), knet_llwrite(), and knet_rs232_init().

A pointer to the head to the device list for this bus

Definition at line 92 of file knet.h.

Referenced by knet_bus_find_device(), knet_bus_find_device_by_name(), knet_device_create(), knet_device_destroy(), and knet_exit().

pthread_mutex_t knet_bus_s::lock

This lock is used to be thread safe when accessing a bus

Definition at line 95 of file knet.h.

Referenced by knet_close(), knet_device_destroy(), knet_i2c_scan_callback(), knet_init(), knet_llread(), knet_lltransfer(), knet_llwrite(), knet_open(), and knet_set_order().

This member is dedicated to the lower communication layer

Definition at line 98 of file knet.h.

Referenced by knet_i2c_exit(), knet_i2c_init(), knet_i2c_open(), knet_i2c_read(), knet_i2c_transfer(), and knet_i2c_write().

Definition at line 100 of file knet.h.

Referenced by knet_exit(), knet_init(), and knet_open().


The documentation for this struct was generated from the following file:

Generated on Wed Dec 15 11:49:30 2010 for KoreBot Library by  doxygen 1.5.5