GPhoto2-Port-Info-List

Name

GPhoto2-Port-Info-List -- 

Synopsis



enum        GPPortType;
            GPPortInfo;
            GPPortInfoList;
int         gp_port_info_list_new           (GPPortInfoList **list);
int         gp_port_info_list_free          (GPPortInfoList *list);
int         gp_port_info_list_load          (GPPortInfoList *list);
int         gp_port_info_list_count         (GPPortInfoList *list);
int         gp_port_info_list_get_info      (GPPortInfoList *list,
                                             int n,
                                             GPPortInfo *info);
int         gp_port_info_list_lookup_path   (GPPortInfoList *list,
                                             const char *path);
int         gp_port_info_list_lookup_name   (GPPortInfoList *list,
                                             const char *name);
int         gp_port_info_list_append        (GPPortInfoList *list,
                                             GPPortInfo info);

Description

Details

enum GPPortType

typedef enum { 
	GP_PORT_NONE        =      0,
	GP_PORT_SERIAL      = 1 << 0,
	GP_PORT_USB         = 1 << 2
} GPPortType;


GPPortInfo

typedef struct {
	GPPortType type;
	char name[64];
	char path[64];

	/* Private */
	char library_filename[1024];
} GPPortInfo;


GPPortInfoList

typedef struct _GPPortInfoList GPPortInfoList;

The internals of this list are private.


gp_port_info_list_new ()

int         gp_port_info_list_new           (GPPortInfoList **list);

Creates a new list which can later be filled with port infos (GPPortInfo) using gp_port_info_list_load.

list :

Returns :

a gphoto2 error code


gp_port_info_list_free ()

int         gp_port_info_list_free          (GPPortInfoList *list);

Frees a list.

list :

a GPPortInfoList

Returns :

a gphoto2 error code


gp_port_info_list_load ()

int         gp_port_info_list_load          (GPPortInfoList *list);

Searches the system for io-drivers and appends them to the list. You would normally call this function once after gp_port_info_list_new and then use this list in order to supply gp_port_set_info with parameters.

list :

a GPPortInfoList

Returns :

a gphoto2 error code


gp_port_info_list_count ()

int         gp_port_info_list_count         (GPPortInfoList *list);

Returns the number of entries in the list.

list :

a GPPortInfoList

Returns :

The number of entries or a gphoto2 error code


gp_port_info_list_get_info ()

int         gp_port_info_list_get_info      (GPPortInfoList *list,
                                             int n,
                                             GPPortInfo *info);

Retreives an entry from the list.

list :

a GPPortInfoList

n :

the index of the entry

info :

Returns :

a gphoto2 error code


gp_port_info_list_lookup_path ()

int         gp_port_info_list_lookup_path   (GPPortInfoList *list,
                                             const char *path);

Looks for an entry in the list with the supplied path. If no exact match can be found, a regex search will be performed in the hope some driver claimed ports like "serial:*".

list :

a GPPortInfoList

path :

a path

Returns :

The index of the entry or a gphoto2 error code


gp_port_info_list_lookup_name ()

int         gp_port_info_list_lookup_name   (GPPortInfoList *list,
                                             const char *name);

Looks for an entry in the list with the given name.

list :

a GPPortInfoList

name :

a name

Returns :

The index of the entry or a gphoto2 error code


gp_port_info_list_append ()

int         gp_port_info_list_append        (GPPortInfoList *list,
                                             GPPortInfo info);

Appends an entry to the list. This function is typically called by an io-driver during gp_port_library_list. If you leave info.name blank, gp_port_info_list_lookup_path will try to match non-existent paths against info.path and - if successfull - will append this entry to the list.

list :

a GPPortInfoList

info :

the info to append

Returns :

The index of the new entry or a gphoto2 error code