TinyWifiDongle 0.1.0
Header-only USB WiFi dongle for Arduino
Loading...
Searching...
No Matches
twd::UsbTransport Class Referenceabstract

Moves Ethernet frames between the MCU and the USB host. More...

#include <Interfaces.h>

Inheritance diagram for twd::UsbTransport:

Public Member Functions

virtual ~UsbTransport ()=default
virtual bool begin (const char *productName)=0
 Registers the USB network interface (before the USB stack is started).
virtual bool ready ()=0
 The host has enumerated and configured the device.
virtual bool send (const uint8_t *frame, uint16_t len)=0
 Queues a frame for the host. Never blocks; false if it was dropped.
virtual void setReceiver (FrameReceiver *receiver)=0
 Frames coming from the host are passed to receiver.
virtual void setHostMac (const uint8_t mac[6])=0

Detailed Description

Moves Ethernet frames between the MCU and the USB host.

Hides the USB network class (CDC-NCM, ECM, ...) and the USB stack of the MCU behind four operations: register, query, send and receive.

See also
FrameReceiver

Definition at line 37 of file Interfaces.h.

Constructor & Destructor Documentation

◆ ~UsbTransport()

virtual twd::UsbTransport::~UsbTransport ( )
virtualdefault

Member Function Documentation

◆ begin()

virtual bool twd::UsbTransport::begin ( const char * productName)
pure virtual

Registers the USB network interface (before the USB stack is started).

Implemented in twd::Esp32UsbNcm, and twd::Rp2040UsbNcm.

◆ ready()

virtual bool twd::UsbTransport::ready ( )
pure virtual

The host has enumerated and configured the device.

Implemented in twd::Esp32UsbNcm, and twd::Rp2040UsbNcm.

◆ send()

virtual bool twd::UsbTransport::send ( const uint8_t * frame,
uint16_t len )
pure virtual

Queues a frame for the host. Never blocks; false if it was dropped.

Implemented in twd::Esp32UsbNcm, and twd::Rp2040UsbNcm.

◆ setHostMac()

virtual void twd::UsbTransport::setHostMac ( const uint8_t mac[6])
pure virtual

MAC address of the adapter as the host sees it (default: derived from the chip id). Call before begin().

Implemented in twd::Esp32UsbNcm, and twd::Rp2040UsbNcm.

◆ setReceiver()

virtual void twd::UsbTransport::setReceiver ( FrameReceiver * receiver)
pure virtual

Frames coming from the host are passed to receiver.

Implemented in twd::Esp32UsbNcm, and twd::Rp2040UsbNcm.


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