Fork of https://developer.mbed.org/users/bscott/code/STM32_USBDevice/
Fork of STM32_USBDevice by
Diff: USBSerial/USBWebUSBSerial.h
- Branch:
- feature_WebUSB
- Revision:
- 78:ba3f68a86e6d
- Parent:
- 77:a98f786d05d4
--- a/USBSerial/USBWebUSBSerial.h Tue Jul 24 13:08:29 2018 +0200 +++ b/USBSerial/USBWebUSBSerial.h Wed Jul 25 09:35:08 2018 +0200 @@ -21,7 +21,6 @@ #include <string> #include "USBDevice.h" -#include "Stream.h" #include "CircBuffer.h" #include "USBEndpoints.h" #include "USBDescriptor.h" @@ -40,7 +39,7 @@ * Handles outputting to standard CDC or WebUSB endpoint depending on mode * */ -class USBWebUSBSerial: public USBDevice, public Stream +class USBWebUSBSerial: public USBDevice { public: @@ -54,6 +53,7 @@ * */ USBWebUSBSerial(uint16_t vendor_id, uint16_t product_id, uint16_t product_release = 0x0001, bool connect_blocking = true); + virtual ~USBWebUSBSerial(); const std::string& manufacturerName() const { return m_manufacturerName; } void setManufacturerName(const std::string &manufacturerName); @@ -65,19 +65,12 @@ void setSerialNumber(const std::string &serialNumber); /** - * Send a character. You can use puts, printf. + * Read up to size bytes from input buffer * - * @param c character to be sent - * @returns true if there is no error, false otherwise + * @returns the number of bytes read */ - virtual int _putc(int c); - /** - * Read a character: blocking - * - * @returns character read - */ - virtual int _getc(); + int read(uint8_t *buf, uint16_t size); /** * Check the number of bytes available.