Hello all,
I’m trying to write data to an isochronous endpoint of a USB device but it seems that the data is not transmitted. I checked the return codes of all functions and it says no error. Any ideas? Here is the relevant code:
static void send_isoc_complete(struct usbd_urb* urb, struct usbd_pipe* pipe, void* handle) {
int status = -1, alen = -1, ustatus = -1;
usb_iface_t* iface = (usb_iface_t*)handle;
status = usbd_urb_status(urb, &ustatus, &alen);
SLOG(_SLOG_INFO, "isoc send complete urb %p pipe %p handle %p status %i (ustatus=%i, alen=%i)",
urb, pipe, handle, status, ustatus, alen);
sem_post(&iface->isochronous->out_sem);
return;
}
int send_isoc(void* user, unsigned char* buf, uint32_t len) {
usb_iface_t* iface = (usb_iface_t*)user;
int RC;
sem_wait(&iface->isochronous->out_sem);
memcpy(iface->isochronous->out_buf, buf, len);
// hexdump(iface->isochronous->out_buf, len, NULL);
RC = usbd_setup_isochronous(iface->isochronous->out_urb, URB_DIR_OUT | URB_ISOCH_ASAP | URB_SHORT_XFER_OK, 0, iface->isochronous->out_buf, len);
SLOG(_SLOG_INFO, "usbd_setup_isochronous (OUT) returned %i", RC);
RC = usbd_io(iface->isochronous->out_urb, iface->isochronous->ep_out, send_isoc_complete, iface, USBD_TIME_DEFAULT);
SLOG(_SLOG_INFO, "usbd_io (OUT) returned %i", RC);
return 0;
}
Many thanks,
Albrecht