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

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().

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

close a device [OPTIONAL]

Definition at line 70 of file knet.h.

Referenced by knet_close(), knet_i2c_init(), 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().

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

cleanup the private data in the bus structure [OPTIONAL]

Definition at line 60 of file knet.h.

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

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().

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]

Definition at line 63 of file knet.h.

Referenced by knet_i2c_init(), knet_open(), 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]

Definition at line 80 of file knet.h.

Referenced by knet_i2c_init(), knet_llread(), knet_lltransfer(), 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]

Definition at line 74 of file knet.h.

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

Definition at line 100 of file knet.h.

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

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]

Definition at line 86 of file knet.h.

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


The documentation for this struct was generated from the following file:
Generated on Mon Dec 3 09:43:50 2012 for KoreBot Library by  doxygen 1.6.3