Android-cuttlefish cvd tool
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
LibUsbDevice Struct Reference

#include <usb_libusb_device.h>

Collaboration diagram for LibUsbDevice:
Collaboration graph
[legend]

Public Member Functions

 LibUsbDevice (libusb_device *device)
 
 ~LibUsbDevice ()
 
bool Read (apacket *packet)
 
bool Write (apacket *packet)
 
void Reset ()
 
uint64_t NegotiatedSpeedMbps ()
 
uint64_t MaxSpeedMbps ()
 
std::string GetSerial ()
 
bool Open ()
 
bool Close ()
 
std::string GetAddress () const
 
bool IsInitialized () const
 
USBSessionID GetSessionId () const
 
void ClearEndpoints ()
 

Static Public Member Functions

static USBSessionID GenerateSessionId (libusb_device *device)
 

Private Member Functions

void Init ()
 
std::optional< libusb_device_descriptor > GetDeviceDescriptor ()
 
bool ClaimInterface ()
 
void ReleaseInterface ()
 
bool OpenDeviceHandle ()
 
void CloseDeviceHandle ()
 
void CloseDevice ()
 
std::string GetDeviceAddress ()
 
bool RetrieveSerial ()
 
void RetrieveSpeeds ()
 
bool FindAdbInterface ()
 

Private Attributes

libusb_device * device_ = nullptr
 
libusb_device_handle * device_handle_ = nullptr
 
std::string device_address_ {}
 
std::string serial_ {}
 
int zlp_mask_ {}
 
int out_endpoint_size_ {}
 
int interface_num_ = 0
 
unsigned char write_endpoint_ {}
 
unsigned char read_endpoint_ {}
 
std::atomic< bool > interface_claimed_ = false
 
uint64_t negotiated_speed_ {}
 
uint64_t max_speed_ {}
 
bool initialized_ = false
 
USBSessionID session_
 

Constructor & Destructor Documentation

◆ LibUsbDevice()

LibUsbDevice::LibUsbDevice ( libusb_device *  device)
explicit

◆ ~LibUsbDevice()

LibUsbDevice::~LibUsbDevice ( )

Member Function Documentation

◆ ClaimInterface()

bool LibUsbDevice::ClaimInterface ( )
private

◆ ClearEndpoints()

void LibUsbDevice::ClearEndpoints ( )

◆ Close()

bool LibUsbDevice::Close ( )

◆ CloseDevice()

void LibUsbDevice::CloseDevice ( )
private

◆ CloseDeviceHandle()

void LibUsbDevice::CloseDeviceHandle ( )
private

◆ FindAdbInterface()

bool LibUsbDevice::FindAdbInterface ( )
private

◆ GenerateSessionId()

USBSessionID LibUsbDevice::GenerateSessionId ( libusb_device *  device)
static

◆ GetAddress()

std::string LibUsbDevice::GetAddress ( ) const

◆ GetDeviceAddress()

std::string LibUsbDevice::GetDeviceAddress ( )
private

◆ GetDeviceDescriptor()

std::optional< libusb_device_descriptor > LibUsbDevice::GetDeviceDescriptor ( )
private

◆ GetSerial()

std::string LibUsbDevice::GetSerial ( )

◆ GetSessionId()

USBSessionID LibUsbDevice::GetSessionId ( ) const

◆ Init()

void LibUsbDevice::Init ( )
private

◆ IsInitialized()

bool LibUsbDevice::IsInitialized ( ) const

◆ MaxSpeedMbps()

uint64_t LibUsbDevice::MaxSpeedMbps ( )

◆ NegotiatedSpeedMbps()

uint64_t LibUsbDevice::NegotiatedSpeedMbps ( )

◆ Open()

bool LibUsbDevice::Open ( )

◆ OpenDeviceHandle()

bool LibUsbDevice::OpenDeviceHandle ( )
private

◆ Read()

bool LibUsbDevice::Read ( apacket packet)

◆ ReleaseInterface()

void LibUsbDevice::ReleaseInterface ( )
private

◆ Reset()

void LibUsbDevice::Reset ( )

◆ RetrieveSerial()

bool LibUsbDevice::RetrieveSerial ( )
private

◆ RetrieveSpeeds()

void LibUsbDevice::RetrieveSpeeds ( )
private

◆ Write()

bool LibUsbDevice::Write ( apacket packet)

Member Data Documentation

◆ device_

libusb_device* LibUsbDevice::device_ = nullptr
private

◆ device_address_

std::string LibUsbDevice::device_address_ {}
private

◆ device_handle_

libusb_device_handle* LibUsbDevice::device_handle_ = nullptr
private

◆ initialized_

bool LibUsbDevice::initialized_ = false
private

◆ interface_claimed_

std::atomic<bool> LibUsbDevice::interface_claimed_ = false
private

◆ interface_num_

int LibUsbDevice::interface_num_ = 0
private

◆ max_speed_

uint64_t LibUsbDevice::max_speed_ {}
private

◆ negotiated_speed_

uint64_t LibUsbDevice::negotiated_speed_ {}
private

◆ out_endpoint_size_

int LibUsbDevice::out_endpoint_size_ {}
private

◆ read_endpoint_

unsigned char LibUsbDevice::read_endpoint_ {}
private

◆ serial_

std::string LibUsbDevice::serial_ {}
private

◆ session_

USBSessionID LibUsbDevice::session_
private

◆ write_endpoint_

unsigned char LibUsbDevice::write_endpoint_ {}
private

◆ zlp_mask_

int LibUsbDevice::zlp_mask_ {}
private

The documentation for this struct was generated from the following files: