• Home
  • Raw
  • Download

Lines Matching defs:LibusbConnection

115 struct LibusbConnection : public Connection {  struct
117 LibusbConnection* self = nullptr; argument
124 LibusbConnection* self; argument
130 explicit LibusbConnection(unique_device device) in LibusbConnection() function
133 ~LibusbConnection() { Stop(); } in ~LibusbConnection() argument
135 void HandlePacket(amessage& msg, std::optional<Block> payload) { in HandlePacket()
144 void Cleanup(ReadBlock* read_block) REQUIRES(read_mutex_) { in Cleanup()
153 bool MaybeCleanup(ReadBlock* read_block) REQUIRES(read_mutex_) { in MaybeCleanup()
165 static void LIBUSB_CALL header_read_cb(libusb_transfer* transfer) { in header_read_cb()
215 static void LIBUSB_CALL payload_read_cb(libusb_transfer* transfer) { in payload_read_cb()
252 static void LIBUSB_CALL write_cb(libusb_transfer* transfer) { in write_cb()
273 bool DoTlsHandshake(RSA*, std::string*) final { in DoTlsHandshake()
278 void CreateRead(ReadBlock* read, bool header) { in CreateRead()
288 void SubmitRead(ReadBlock* read, size_t length) { in SubmitRead()
299 void SubmitWrite(Block&& block) REQUIRES(write_mutex_) { in SubmitWrite()
323 bool Write(std::unique_ptr<apacket> packet) final { in Write()
355 std::optional<libusb_device_descriptor> GetDeviceDescriptor() { in GetDeviceDescriptor()
366 bool FindInterface(libusb_device_descriptor* device_desc) { in FindInterface()
469 std::string GetUsbDeviceAddress() const { return std::string("usb:") + device_address_; } in GetUsbDeviceAddress()
471 std::string GetSerial() { in GetSerial()
494 static uint64_t ToConnectionSpeed(int speed) { in ToConnectionSpeed()
515 static uint64_t ExtractMaxSuperSpeed(uint16_t wSpeedSupported) { in ExtractMaxSuperSpeed()
539 static uint64_t ExtractMaxSuperSpeedPlus(libusb_ssplus_usb_device_capability_descriptor* cap) { in ExtractMaxSuperSpeedPlus()
552 void RetrieveSpeeds() { in RetrieveSpeeds()
588 bool OpenDevice(std::string* error) { in OpenDevice()
647 void CancelReadTransfer(ReadBlock* read_block) REQUIRES(read_mutex_) { in CancelReadTransfer()
667 void CloseDevice() { in CloseDevice()
737 bool StartImpl(std::string* error) { in StartImpl()
752 void OnError(const std::string& error) { in OnError()
760 virtual bool Attach(std::string* error) override final { in Attach()
776 virtual bool Detach(std::string* error) override final { in Detach()
782 virtual void Reset() override final { in Reset()
811 static std::optional<std::shared_ptr<LibusbConnection>> Create(unique_device device) { in Create() argument
862 virtual uint64_t MaxSpeedMbps() override final { return max_speed_; } in MaxSpeedMbps()
864 virtual uint64_t NegotiatedSpeedMbps() override final { return negotiated_speed_; } in NegotiatedSpeedMbps()
866 unique_device device_;
867 unique_device_handle device_handle_;
868 std::string device_address_;
869 std::string serial_ = "<unknown>";
871 uint32_t interface_num_;
872 uint8_t write_endpoint_;
873 uint8_t read_endpoint_;
897 static std::unordered_map<libusb_device*, std::weak_ptr<LibusbConnection>> usb_handles argument