raw1394_get_port_info

Name

raw1394_get_port_info -- get information about connected ports

Synopsis

int raw1394_get_port_info(raw1394handle_t handle, struct raw1394_port_info *pinf, int maxports);

Arguments

pinf

Pointer to an array of structure of type raw1394_port_info which will be filled in by the function.

maxports

Maximum number of pinf structures to fill in. Zero is valid.

Return Value

The number of ports currently existing.

Description

Before you can set which port to use, you use this function to find out which ports exist. The raw1394_port_info structure looks like this:

struct raw1394_portinfo {
        int nodes;
        char name[32];
};
	  

The field nodes contains the number of nodes that are currently connected to that port, the field name contains the name of the hardware type. If your program is interactive, you should present the user with this list to let them decide which port to use. A non-interactive program (and probably interactive ones, too) should provide a command line option to choose the port.