Added boolean operator and more

Added a bool operator to check if a midi device is connected, added methods to get vid and pid to match those of Teensy's 3.6 built-in USB Host.
This commit is contained in:
neroroxxx 2018-01-18 11:03:05 -05:00 committed by Kristian Sloth Lauszus
parent 03933edb41
commit 8ef3db254d

View file

@ -66,6 +66,9 @@ protected:
public:
uint16_t pid, vid;
USBH_MIDI(USB *p);
operator bool() { return (pUsb->getUsbTaskState()==USB_STATE_RUNNING && isMidiFound); }
uint16_t idVendor() { return vid; }
uint16_t idProduct() { return pid; }
// Methods for recieving and sending data
uint8_t RecvData(uint16_t *bytes_rcvd, uint8_t *dataptr);
uint8_t RecvData(uint8_t *outBuf, bool isRaw=false);