This reverts commit 139683f9ca864a8e4fcfaf3a454c293539547903. This accidently broke the API and will be recommitted at a later point. After applying this and may the earlier 7-patch patchset, a version 1.4.1, 1.4a or 1.5 should be released as API-fix version with a clear statement not to use broken version 1.4. --- include/openobex/obex_const.h | 18 -------------- lib/usbobex.c | 53 ----------------------------------------- lib/usbobex.h | 9 ------- 3 files changed, 0 insertions(+), 80 deletions(-)
diff --git a/include/openobex/obex_const.h b/include/openobex/obex_const.h index df03a98..ea29195 100644 --- a/include/openobex/obex_const.h +++ b/include/openobex/obex_const.h @@ -51,22 +51,6 @@ typedef struct { void * customdata; } obex_ctrans_t; -/** USB-specific OBEX service information - * provided by optional Service Identification Functional Descriptor - * (CDC WMC specification section 6.5.2.5) - */ -typedef struct { - /** Role bit mask: bit 0 is set if client, unset if server */ - uint8_t role; - /** Service UUID */ - uint8_t uuid[16]; - /** Service version */ - uint16_t version; - /** Set if the service provides/expects - * an OBEX Default Server (spec section 6.5.2.5.2) */ - int is_default_uuid; -} obex_usb_intf_service_t; - /** USB-specific OBEX interface information */ typedef struct { /** Manufacturer, e.g. Nokia */ @@ -83,8 +67,6 @@ typedef struct { char *data_interface_idle; /** Active data interface description, typically empty */ char *data_interface_active; - /** Service information descriptor, may be NULL if absent */ - obex_usb_intf_service_t *service; /** Internal information for the transport layer in the library */ struct obex_usb_intf_transport_t *intf; } obex_usb_intf_t; diff --git a/lib/usbobex.c b/lib/usbobex.c index 3d1f619..b067bac 100644 --- a/lib/usbobex.c +++ b/lib/usbobex.c @@ -124,7 +124,6 @@ static int find_obex_data_interface(unsigned char *buffer, int buflen, struct us union_header = (struct cdc_union_desc *)buffer; break; case CDC_OBEX_TYPE: /* maybe check version */ - case CDC_OBEX_SERVICE_ID_TYPE: /* This one is handled later */ case CDC_HEADER_TYPE: break; /* for now we ignore it */ default: @@ -203,8 +202,6 @@ static struct obex_usb_intf_transport_t *check_intf(struct usb_device *dev, next->control_interface = dev->config[c].interface[i].altsetting[a].bInterfaceNumber; next->control_interface_description = dev->config[c].interface[i].altsetting[a].iInterface; next->control_setting = dev->config[c].interface[i].altsetting[a].bAlternateSetting; - next->extra_descriptors = buffer; - next->extra_descriptors_len = buflen; err = find_obex_data_interface(buffer, buflen, dev->config[c], next); if (err) @@ -222,52 +219,6 @@ static struct obex_usb_intf_transport_t *check_intf(struct usb_device *dev, } /* - * Helper function to usbobex_find_interfaces - */ -static void find_obex_service_descriptor(unsigned char *buffer, int buflen, obex_usb_intf_service_t **service) -{ - if (!buffer) { - DEBUG(2, "Weird descriptor references"); - return ; - } - while (buflen > 0) { - if (buffer[1] != USB_DT_CS_INTERFACE) { - DEBUG(2, "skipping garbage"); - goto next_desc; - } - switch (buffer[2]) { - case CDC_OBEX_SERVICE_ID_TYPE: /* we've found it */ - if (buflen < 22) /* Check descriptor size */ - DEBUG(2, "Invalid service id descriptor"); - else if (*service == NULL) { - *service = malloc(sizeof(obex_usb_intf_service_t)); - if (*service != NULL) { - (*service)->role = buffer[3]; - memcpy((*service)->uuid, buffer+4, 16); - (*service)->version = (buffer[20]<<8)|(buffer[21]); - if (memcmp((*service)->uuid, WMC_DEFAULT_OBEX_SERVER_UUID, 16) == 0 ) - (*service)->is_default_uuid = 1; - else - (*service)->is_default_uuid = 0; - } - } - break; - case CDC_OBEX_TYPE: /* maybe check version */ - case CDC_UNION_TYPE: - case CDC_HEADER_TYPE: - break; - default: - DEBUG(2, "Ignoring extra header, type %d, length %d", buffer[2], buffer[0]); - break; - } -next_desc: - buflen -= buffer[0]; - buffer += buffer[0]; - } -} - - -/* * Function usbobex_find_interfaces () * * Find available USBOBEX interfaces on the system @@ -334,9 +285,6 @@ int usbobex_find_interfaces(obex_interface_t **interfaces) current->data_interface_idle_description); get_intf_string(usb_handle, &intf_array[num].usb.data_interface_active, current->data_interface_active_description); - find_obex_service_descriptor(current->extra_descriptors, - current->extra_descriptors_len, - &intf_array[num].usb.service); usb_close(usb_handle); current = current->next; num++; } @@ -372,7 +320,6 @@ void usbobex_free_interfaces(int num, obex_interface_t *intf) free(intf[i].usb.control_interface); free(intf[i].usb.data_interface_idle); free(intf[i].usb.data_interface_active); - free(intf[i].usb.service); free(intf[i].usb.intf); } diff --git a/lib/usbobex.h b/lib/usbobex.h index f3ffbd4..d0e1dfe 100644 --- a/lib/usbobex.h +++ b/lib/usbobex.h @@ -37,8 +37,6 @@ struct obex_usb_intf_transport_t { * If non-zero, use usb_get_string_simple() from * libusb to retrieve human-readable description */ - unsigned char *extra_descriptors; /* Extra master interface descriptors */ - int extra_descriptors_len; /* Length of extra descriptors */ int data_interface; /* OBEX data/slave interface */ int data_idle_setting; /* OBEX data/slave idle setting */ int data_interface_idle_description; /* OBEX data/slave interface string descriptor number @@ -76,18 +74,11 @@ struct cdc_union_desc { #define CDC_UNION_TYPE 0x06 #define CDC_COUNTRY_TYPE 0x07 #define CDC_OBEX_TYPE 0x15 -#define CDC_OBEX_SERVICE_ID_TYPE 0x19 /* Interface descriptor */ #define USB_DT_CS_INTERFACE 0x24 #define CDC_DATA_INTERFACE_TYPE 0x0a -#define WMC_DEFAULT_OBEX_SERVER_UUID ((const uint8_t []) \ -{ 0x02, 0xae, 0xb3, 0x20, \ -0xf6, 0x49, 0x11, 0xda, \ -0x97, 0x4d, 0x08, 0x00, \ -0x20, 0x0c, 0x9a, 0x66 } ) - #define USB_MAX_STRING_SIZE 256 #define USB_OBEX_TIMEOUT 10000 /* 10 seconds */ -- 1.5.6.5 ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Openobex-users mailing list Openobex-users@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/openobex-users