USB components provide at least one service. When a service is available for use, it is `ready`. For example, the USBSerial component enters the `ready` state after a serial port has been opened on the host PC. To determine whether a USB component's service is ready, you can use the `ready()` function. It returns `true` if the USB component is ready for use and `false` otherwise. Some components provide multiple services, such as USBAudio, which can send or receive data and has two separate ready functions - `read_ready()` and `write_ready()`. Furthermore, for each `ready()` function, there is also a corresponding `wait_ready()` function, which you can use to block until the USB component's service is available.
0 commit comments