NETPP server functionality

A netpp server must initialize its properties and call a few functions within its main loop to listen to property protocol requests on various interfaces. More...


uint32_t local_getroot (struct DCDevice *d)
 Get Root node token.
int slave_handler (RemoteDevice *d)
 Enters the slave handler reacting to a property protocol request.
int device_write (struct DCDevice *d, uint32_t addr, const unsigned char *buf, unsigned long size)
 Device backend write register or memory function.
int device_read (struct DCDevice *d, uint32_t addr, unsigned char *buf, unsigned long size)
 Device backend read register.
void register_proplist (struct device_desc_t *d, int n)
 Register property list with netpp backend (Slave side).

Detailed Description

Currently, TCP and some USB devices are implemented.

If you don't have a source release of the NETPP library, you can link your netpp server code against the libslave library (Linux or standalone: libslave.a or Windows: libslave.lib).

See slave_test::c and associated handler::c on how to implement a netpp server.

Function Documentation

int device_write ( struct DCDevice d,
uint32_t  addr,
const unsigned char *  buf,
unsigned long  size 
d Device handle
addr Raw register or memory address
buf Buffer pointer
size Size of data to write to device
uint32_t local_getroot ( struct DCDevice d  ) 

A netpp server must implement this function to return its device root node. When using a single device which is the standard case, this function must return 0. When a backend implements more than one device functionality, it must select and return the appropriate root node.

int slave_handler ( RemoteDevice d  ) 

This handler exits after a certain protocol specific timeout, if no protocol command phase was initiated. This function is only to be used directly by protocols that do not need to initiate a connection (like USB). For TCP/UDP connections, see net_serve_users().

d Remote device handle
Error code or 0 if no error

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