rename GP_PORT_TCP -> GP_PORT_IP

as we just use it specify an IP, regardless of what the driver does
This commit is contained in:
Marcus Meissner
2019-07-01 08:34:33 +02:00
parent 8f929c5bdc
commit b331c5aeaf
4 changed files with 12 additions and 18 deletions

View File

@@ -134,7 +134,6 @@ camera_capture_preview (Camera *camera, CameraFile *file, GPContext *context)
struct sockaddr_in serv_addr;
unsigned char buffer[65536];
GPPortInfo info;
char *xpath;
int i, start, end, tries;
switchToRecMode (camera);
@@ -149,7 +148,6 @@ camera_capture_preview (Camera *camera, CameraFile *file, GPContext *context)
}
gp_port_get_info (camera->port, &info);
gp_port_info_get_path (info, &xpath); /* xpath now contains tcp:192.168.1.1 */
memset(&serv_addr, 0, sizeof(serv_addr));
@@ -411,8 +409,8 @@ loadCmd (Camera *camera,char* cmd) {
curl = curl_easy_init();
gp_port_get_info (camera->port, &info);
gp_port_info_get_path (info, &xpath); /* xpath now contains tcp:192.168.1.1 */
snprintf( URL,100, "http://%s/%s", xpath+4, cmd);
gp_port_info_get_path (info, &xpath); /* xpath now contains ip:192.168.1.1 */
snprintf( URL,100, "http://%s/%s", xpath+strlen("ip:"), cmd);
GP_LOG_D("cam url is %s", URL);
curl_easy_setopt(curl, CURLOPT_URL, URL);
@@ -772,8 +770,8 @@ GetPixRange(Camera *camera, int start, int num) {
list = curl_slist_append(list, "Accept: text/xml");
gp_port_get_info (camera->port, &info);
gp_port_info_get_path (info, &xpath); /* xpath now contains tcp:192.168.1.1 */
snprintf( URL, 1000, "http://%s%s",xpath+4, CDS_Control);
gp_port_info_get_path (info, &xpath); /* xpath now contains ip:192.168.1.1 */
snprintf( URL, 1000, "http://%s%s",xpath+strlen("ip:"), CDS_Control);
curl_easy_setopt(curl, CURLOPT_URL, URL);
lmb.size = 0;
@@ -1758,7 +1756,7 @@ int camera_abilities (CameraAbilitiesList *list) {
memset(&a, 0, sizeof(a));
strcpy(a.model, "Panasonic:LumixGSeries");
a.status = GP_DRIVER_STATUS_EXPERIMENTAL;
a.port = GP_PORT_TCP;
a.port = GP_PORT_IP;
a.operations = GP_CAPTURE_IMAGE| GP_OPERATION_CAPTURE_VIDEO | GP_OPERATION_CONFIG;
a.file_operations = GP_FILE_OPERATION_PREVIEW ;
/* it should be possible to browse and DL images the files using the ReadImageFromCamera() function but for now lets keep it simple*/
@@ -1799,7 +1797,6 @@ int
camera_init (Camera *camera, GPContext *context)
{
GPPortInfo info;
char *xpath;
int ret;
camera->pl = calloc(sizeof(CameraPrivateLibrary),1);
@@ -1823,9 +1820,6 @@ camera_init (Camera *camera, GPContext *context)
GP_LOG_E ("Failed to get port info?");
return ret;
}
gp_port_info_get_path (info, &xpath);
/* xpath now contains tcp:192.168.1.1 */
gp_filesystem_set_funcs (camera->fs, &fsfuncs, camera);
if (switchToRecMode (camera) != NULL) {

View File

@@ -39,7 +39,7 @@ typedef enum {
GP_PORT_PTPIP = 1 << 4, /**< \brief PTP/IP port. */
GP_PORT_USB_DISK_DIRECT = 1 << 5, /**< \brief Direct IO to an usb mass storage device. */
GP_PORT_USB_SCSI = 1 << 6, /**< \brief USB Mass Storage raw SCSI port. */
GP_PORT_TCP = 1 << 7 /**< \brief generic TCP port. */
GP_PORT_IP = 1 << 7 /**< \brief generic IP address port. */
} GPPortType;
/**

View File

@@ -186,16 +186,16 @@ gp_port_library_list (GPPortInfoList *list)
gp_port_info_list_append (list, info); /* do not check return */
gp_port_info_new (&info);
gp_port_info_set_type (info, GP_PORT_TCP);
gp_port_info_set_name (info, _("TCP Connection"));
gp_port_info_set_path (info, "tcp:");
gp_port_info_set_type (info, GP_PORT_IP);
gp_port_info_set_name (info, _("IP Connection"));
gp_port_info_set_path (info, "ip:");
CHECK (gp_port_info_list_append (list, info));
/* Generic matcher so you can pass any IP address */
gp_port_info_new (&info);
gp_port_info_set_type (info, GP_PORT_TCP);
gp_port_info_set_type (info, GP_PORT_IP);
gp_port_info_set_name (info, "");
gp_port_info_set_path (info, "^tcp:");
gp_port_info_set_path (info, "^ip:");
gp_port_info_list_append (list, info); /* do not check return */
#ifdef HAVE_MDNS_BONJOUR
ret = DNSServiceBrowse (

View File

@@ -107,7 +107,7 @@ run_test ()
case GP_PORT_USB_SCSI: port_type_str = "USBSCSI"; break;
case GP_PORT_DISK: port_type_str = "DISK"; break;
case GP_PORT_PTPIP: port_type_str = "PTPIP"; break;
case GP_PORT_TCP: port_type_str = "TCP"; break;
case GP_PORT_IP: port_type_str = "IP"; break;
default: port_type_str = "UNKNOWN"; return 3; break;
}
printf ("No: %d\n"