38 #include <sys/types.h> 47 port_info_list_(NULL),
99 if( *port_count < GP_OK )
134 list_index = gp_port_info_list_lookup_path(
port_info_list_, port_name.c_str() );
135 if( list_index < GP_OK )
138 if( list_index == GP_ERROR_UNKNOWN_PORT )
140 std::cerr <<
"The specified port (" << port_name <<
") cannot be found. Use 'gphoto2 --list-ports' to display available ports. The prefix 'serial:' or 'usb:' is required." << std::endl;
146 if( gp_port_info_list_get_info(
port_info_list_, list_index, port_info ) != GP_OK )
161 list_index = gp_abilities_list_lookup_model(
abilities_list_, model_name.c_str() );
162 if( list_index < GP_OK )
169 if( gp_abilities_list_get_abilities(
abilities_list_, list_index, abilities ) != GP_OK )
191 ssize_t port_count = 0;
225 CameraList *working_list = NULL;
226 const char *name = NULL;
227 const char *value = NULL;
230 if( gp_list_new( &working_list ) != GP_OK )
233 gp_list_free( working_list );
241 gp_list_free( working_list );
246 count = gp_list_count( working_list );
250 gp_list_free( working_list );
258 gp_list_free( working_list );
263 for(
int i = 0; i < count; i++ )
265 gp_list_get_name( working_list, i, &name );
266 gp_list_get_value( working_list, i, &value );
268 if( name && value && match_string.compare( value ) != 0 )
274 gp_list_free( working_list );
bool loadPortInfo(ssize_t *port_count)
CameraAbilitiesList * getAbilitiesList(void)
bool autodetect(GPContext *context)
void error(const std::string &function_name)
CameraList * getCameraList(void)
GPPortInfoList * getPortInfoList(void)
GPPortInfoList * port_info_list_
bool filterCameraList(GPContext *context, const std::string &match_string)
CameraList * camera_list_
bool lookupAbilities(const std::string &model_name, CameraAbilities *abilities)
CameraAbilitiesList * abilities_list_
bool lookupPortInfo(const std::string &port_name, GPPortInfo *port_info)
bool loadAbilities(GPContext *context)