arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | List of all members
USBAudioHostEvents Class Referenceabstract

Upcalls from a USB host backend into the stack independent UAC host class logic (USBAudioHostBase). All methods are called from the USB stack context (TinyUSB: inside tuh_task(); ESP-IDF: the USB host task). More...

#include <USBAudioHostBackend.h>

Inheritance diagram for USBAudioHostEvents:
USBAudioHostBase USBAudioHostESP32 USBAudioHostTinyUSB USBAudioHostTinyUSBFreeRTOS

Public Member Functions

virtual ~USBAudioHostEvents ()=default
 
virtual uint16_t onAttach (uint8_t daddr, uint16_t vid, uint16_t pid, const uint8_t *desc, uint16_t len)=0
 
virtual void onConfigured (uint8_t daddr)=0
 
virtual void onControlComplete (bool ok, uint16_t len)=0
 
virtual void onDetach (uint8_t daddr)=0
 The device was removed.
 
virtual void onIsoIn (UsbHostStreamRole role, const uint8_t *data, uint16_t len)=0
 One isochronous IN packet was received (RxData or Feedback).
 
virtual uint16_t onIsoOut (uint8_t *data, uint16_t max)=0
 

Detailed Description

Upcalls from a USB host backend into the stack independent UAC host class logic (USBAudioHostBase). All methods are called from the USB stack context (TinyUSB: inside tuh_task(); ESP-IDF: the USB host task).

Constructor & Destructor Documentation

◆ ~USBAudioHostEvents()

virtual ~USBAudioHostEvents ( )
virtualdefault

Member Function Documentation

◆ onAttach()

virtual uint16_t onAttach ( uint8_t  daddr,
uint16_t  vid,
uint16_t  pid,
const uint8_t *  desc,
uint16_t  len 
)
pure virtual

A device was enumerated: desc points to the descriptors starting with an Audio Control interface descriptor and len is the number of bytes which are available after it. Returns the number of bytes which belong to the audio function (0 if the interface was not accepted).

Implemented in USBAudioHostBase.

◆ onConfigured()

virtual void onConfigured ( uint8_t  daddr)
pure virtual

The device configuration is active: the class logic can start to select the alternate settings and open the streaming endpoints.

Implemented in USBAudioHostBase.

◆ onControlComplete()

virtual void onControlComplete ( bool  ok,
uint16_t  len 
)
pure virtual

Completion of control() or setInterface(). For IN requests len is the number of bytes which were received into the request buffer.

Implemented in USBAudioHostBase.

◆ onDetach()

virtual void onDetach ( uint8_t  daddr)
pure virtual

The device was removed.

Implemented in USBAudioHostBase.

◆ onIsoIn()

virtual void onIsoIn ( UsbHostStreamRole  role,
const uint8_t *  data,
uint16_t  len 
)
pure virtual

One isochronous IN packet was received (RxData or Feedback).

Implemented in USBAudioHostBase.

◆ onIsoOut()

virtual uint16_t onIsoOut ( uint8_t *  data,
uint16_t  max 
)
pure virtual

Provide the next isochronous OUT packet (TxData): fill at most max bytes into data and return the packet length.

Implemented in USBAudioHostBase.


The documentation for this class was generated from the following file: