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...
Functions | |
| 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). | |
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.
| 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 |
1.6.1