fixme review
review functionality missing over 0.1
endianness of control setup, issues when resubmitting transfers
-doxygen warnings
serialization of handle_events
internal docs for OS porters
* endpoint. This is useful for setting up isochronous transfers.
*
* \param dev a device
+ * \param endpoint address of the endpoint in question
* \returns the wMaxPacketSize value, or LIBUSB_ERROR_NOT_FOUND if the endpoint
* does not exist.
*/
* \param dev a device handle
* \param interface_number the <tt>bInterfaceNumber</tt> of the
* previously-claimed interface
- * \param altsetting the <tt>bAlternateSetting</tt> of the alternate setting
- * to activate
+ * \param alternate_setting the <tt>bAlternateSetting</tt> of the alternate
+ * setting to activate
* \returns 0 on success
* \returns LIBUSB_ERROR_NOT_FOUND if the interface was not claimed, or the
* requested alternate setting does not exist
len = (int)(buffer - begin);
if (!len) {
endpoint->extra = NULL;
- endpoint->extralen = 0;
+ endpoint->extra_length = 0;
return parsed;
}
extra = malloc(len);
endpoint->extra = extra;
if (!extra) {
- endpoint->extralen = 0;
+ endpoint->extra_length = 0;
return LIBUSB_ERROR_NO_MEM;
}
memcpy(extra, begin, len);
- endpoint->extralen = len;
+ endpoint->extra_length = len;
return parsed;
}
interface->num_altsetting++;
usbi_parse_descriptor(buffer, "bbbbbbbbb", ifp);
ifp->extra = NULL;
- ifp->extralen = 0;
+ ifp->extra_length = 0;
ifp->endpoint = NULL;
/* Skip over the interface */
goto err;
}
memcpy((unsigned char *) ifp->extra, begin, len);
- ifp->extralen = len;
+ ifp->extra_length = len;
}
/* Did we hit an unexpected descriptor? */
size -= config->bLength;
config->extra = NULL;
- config->extralen = 0;
+ config->extra_length = 0;
for (i = 0; i < config->bNumInterfaces; i++) {
int len;
len = (int)(buffer - begin);
if (len) {
/* FIXME: We should realloc and append here */
- if (!config->extralen) {
+ if (!config->extra_length) {
config->extra = malloc(len);
if (!config->extra) {
r = LIBUSB_ERROR_NO_MEM;
}
memcpy((unsigned char *) config->extra, begin, len);
- config->extralen = len;
+ config->extra_length = len;
}
}
*
* The data for each packet will be found at an offset into the buffer that
* can be calculated as if each prior packet completed in full. The
- * libusb_get_iso_packet_offset() and libusb_get_iso_packet_offset_simple()
+ * libusb_get_iso_packet_buffer() and libusb_get_iso_packet_buffer_simple()
* functions may help you here.
*
* \section asyncmem Memory caveats
LIBUSB_TRANSFER_TYPE_INTERRUPT = 3,
};
-/** Standard requests, as defined in table 9-3 of the USB2 specifications */
+/** \ingroup misc
+ * Standard requests, as defined in table 9-3 of the USB2 specifications */
enum libusb_standard_request {
/** Request status of the specific recipient */
LIBUSB_REQUEST_GET_STATUS = 0x00,
/** Interval for polling endpoint for data transfers. */
uint8_t bInterval;
+ /** For audio devices only: the rate at which synchronization feedback
+ * is provided. */
uint8_t bRefresh;
+
+ /** For audio devices only: the address if the synch endpoint */
uint8_t bSynchAddress;
- const unsigned char *extra; /* Extra descriptors */
- int extralen;
+ /** Extra descriptors. If libusb encounters unknown endpoint descriptors,
+ * it will store them here, should you wish to parse them. */
+ const unsigned char *extra;
+
+ /** Length of the extra descriptors, in bytes. */
+ int extra_length;
};
/** \ingroup desc
* by the bNumEndpoints field. */
const struct libusb_endpoint_descriptor *endpoint;
- const unsigned char *extra; /* Extra descriptors */
- int extralen;
+ /** Extra descriptors. If libusb encounters unknown interface descriptors,
+ * it will store them here, should you wish to parse them. */
+ const unsigned char *extra;
+
+ /** Length of the extra descriptors, in bytes. */
+ int extra_length;
};
/** \ingroup desc
* this array is determined by the bNumInterfaces field. */
const struct libusb_interface *interface;
- const unsigned char *extra; /* Extra descriptors */
- int extralen;
+ /** Extra descriptors. If libusb encounters unknown configuration
+ * descriptors, it will store them here, should you wish to parse them. */
+ const unsigned char *extra;
+
+ /** Length of the extra descriptors, in bytes. */
+ int extra_length;
};
/** \ingroup asyncio
/* caller interprets result and frees transfer */
}
-/* FIXME: does this support partial transfers? */
/** \ingroup syncio
* Perform a USB control transfer. The direction of the transfer is inferred
* from the bmRequestType field of the setup packet.
* \param timeout timeout (in millseconds) that this function should wait
* before giving up due to no response being received. For no timeout, use
* value 0.
- * \returns 0 on success
+ * \returns on success, the number of bytes actually transferred
* \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out
* \returns LIBUSB_ERROR_PIPE if the control request was not supported by the
* device