Chapter 2. API Reference
Values:
USB_DEVICE_STATE_NOT_ATTACHED
The device was previously configured or suspended, but is no longer attached (either suddenly discon-
nected or a port error)
USB_DEVICE_STATE_ATTACHED
Device is attached to the USB, but is not powered.
USB_DEVICE_STATE_POWERED
Device is attached to the USB and powered, but has not been reset.
USB_DEVICE_STATE_DEFAULT
Device is attached to the USB and powered and has been reset, but has not been assigned a unique address.
Device responds at the default address.
USB_DEVICE_STATE_ADDRESS
Device is attached to the USB, powered, has been reset, and a unique device address has been assigned.
Device is not configured.
USB_DEVICE_STATE_CONFIGURED
Device is attached to the USB, powered, has been reset, has a unique address, is configured, and is not
suspended. The host may now use the function provided by the device.
USB_DEVICE_STATE_SUSPENDED
Device is, at minimum, attached to the USB and is powered and has not seen bus activity for 3 ms. It
may also have a unique address and be configured for use. However, because the device is suspended,
the host may not use the device’s function.
Code examples for this API section are provided in the peripherals directory of ESP-IDF examples.
2.3 Application Protocols
2.3.1 ASIO port
Overview
Asio is a cross-platform C++ library, see https://think-async.com. It provides a consistent asynchronous model using
a modern C++ approach.
ASIO documentation Please refer to the original asio documentation at https://think-async.com/Asio/
Documentation. Asio also comes with a number of examples which could be find under Documentation/Examples
on that web site.
Supported features ESP platform port currently supports only network asynchronous socket operations; does not
support serial port. SSL/TLS support is disabled by default and could be enabled in component configuration menu
by choosing TLS library from
• mbedTLS with OpenSSL translation layer (default option)
• wolfSSL
SSL support is very basic at this stage and it does include following features:
• Verification callbacks
• DH property files
• Certificates/private keys file APIs
Internal asio settings for ESP include
• EXCEPTIONS are enabled in ASIO if enabled in menuconfig
• TYPEID is enabled in ASIO if enabled in menuconfig
Espressif Systems 507
Submit Document Feedback
Release v4.4