protocol_methods Struct Reference

The Hub's protocol methods. More...

#include <ports.h>

Data Fields

int(* probe )(struct dyn_prop_t *hub)
 [M] Probe ports on a Hub The probe function inserts all attached devices found into the 'ports' member of the Hub structure
int(* create )(uint32_t hub, const char *name)
 [M] Create a connection to a port
int(* open )(struct DCDevice *d, int portindex)
 Open device on Hub.
int(* close )(struct DCDevice *d)
 Close the device.
int(* send )(struct peer *p, struct property_packet_hdr *h, const char *data, size_t len)
 Method to send packet data to the device.
int(* recv )(struct peer *p, struct property_packet_hdr **h, unsigned short timeout)
 Method to receive data from the device.

Detailed Description

As a Hub represents a driver for a physical communication protocol (abbreviated as 'Phy' in this document), it has to implement a few methods to access its (possibly virtual) ports.

Some methods are relevant for the Master only and are marked with a [M].

See tcp.c and ipcommon.c for details.


Field Documentation

int(* open)(struct DCDevice *d, int portindex)
Parameters:
portindex The index of the port within the Hubs port list

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

Generated on Thu Feb 24 13:50:16 2011 for Device Control library by  doxygen 1.6.1